Invalid Date format

Hi All, My issue is that I download data to excel from a web report and then I try to use the date fields to do some calculations, but when I do so, the fomula doesn't accepts the formats. When I check the format it shows 'Text format' for these fields. Then to do the calculation I have to convert the date fields in excel to date format and then use them. Is there a way I can get the dates downloaded in date format and then I can do the calculations without doing any processing in excel. Thanks
Puneet

Dear Peri,
This is a common problem, when carrying out BDC.
For example, while recording you met with the field --> MKPF-BUDAT.
Go to SE11 --> MKPF --> Search for BUDAT --> Double click on the Data Element i.e. BUDAT --> Double Click on the domain DATUM --> You can see under the block Output Characteristics : Output Length = 10.
While declaring the TYPES Structure, make it CHAR(10).
Consider this technique as the Rule-of-Thumb while doing BDC.
Regards,
Abir
Don't forget to award points *
Regards,
Abir
Don't forget to award Points *

Similar Messages

  • SSIS 2012 is intermittently failing with below "Invalid date format" while importing data from a source table into a Destination table with same exact schema.

    We migrated Packages from SSIS 2008 to 2012. The Package is working fine in all the environments except in one of our environment.
    SSIS 2012 is intermittently failing with below error while importing data from a source table into a Destination table with same exact schema.
    Error: 2014-01-28 15:52:05.19
       Code: 0x80004005
       Source: xxxxxxxx SSIS.Pipeline
       Description: Unspecified error
    End Error
    Error: 2014-01-28 15:52:05.19
       Code: 0xC0202009
       Source: Process xxxxxx Load TableName [48]
       Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Invalid date format".
    End Error
    Error: 2014-01-28 15:52:05.19
       Code: 0xC020901C
       Source: Process xxxxxxxx Load TableName [48]
       Description: There was an error with Load TableName.Inputs[OLE DB Destination Input].Columns[Updated] on Load TableName.Inputs[OLE DB Destination Input]. The column status returned was: "Conversion failed because the data value overflowed
    the specified type.".
    End Error
    But when we reorder the column in "Updated" in Destination table, the package is importing data successfully.
    This looks like bug to me, Any suggestion?

    Hi Mohideen,
    Based on my research, the issue might be related to one of the following factors:
    Memory pressure. Check there is a memory challenge when the issue occurs. In addition, if the package runs in 32-bit runtime on the specific server, use the 64-bit runtime instead.
    A known issue with SQL Native Client. As a workaround, use .NET data provider instead of SNAC.
    Hope this helps.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • AD 11g Trusted Recon is failing due to invalid Date format for Start Date

    We are using OIM 11g with AD 11g connector.
    we have mapped "whenCreated" attribute of AD to "Start Date" in OIM. We ran Trusted Recon, the recon failed due to invalid date format.
    we got the following error :
    Caused By: oracle.iam.reconciliation.exception.InvalidDataFormatException: Invalid data - 10/19/2012 10:33:30 AM against Date format yyyy/MM/dd HH:mm:ss z for key Start Date
    at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.convertReconFieldsToOIMFields(ReconOperationsServiceImpl.java:1610)
    at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.ignoreEvent(ReconOperationsServiceImpl.java:548)
    at oracle.iam.reconciliation.impl.ReconOperationsServiceImpl.ignoreEvent(ReconOperationsServiceImpl.java:535)
    at sun.reflect.GeneratedMethodAccessor9326.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at oracle.iam.platform.utils.DMSMethodInterceptor.invoke(DMSMethodInterceptor.java:25)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    Thanks.

    Caused By: oracle.iam.reconciliation.exception.InvalidDataFormatException: Invalid data - *10/19/2012 10:33:30 AM* against Date format yyyy/MM/dd HH:mm:ss z for key Start Date
    Error is because of invalid date format.
    You need to bring data in required format. As I remember you can configured it in one of the AD configuration lookup.

  • Invalid date format after APEX upgrade

    We are currently working on upgrading our applications from 1.6 to the new APEX 3.2 version. After the upgrade of one of our systems I have a tabular form that is returning the error 'Invalid date format found'. The date that is getting entered into the system is being displayed and choosed via a sql popup. The code for the pop up is
    SQL CODE
    create or replace view next_weeks as
    with t as (
    select
    trunc(sysdate) + (rownum - 1) / 2 d
    from
    dual
    connect
    by rownum <= 28)
    , call_info as (
    select
    c.call_identifier, c.callback_date, c.callback_cancelled
    from uid_csr_schedule c
    select
    to_char(d, 'fmDy MM/DD/YYYY AM') l
    , to_char(d, 'dd-mon-yy hh:mi:ss AM') v
    ,to_char(d, 'mm/dd/yy hh:mi:ss AM') o
    from
    t
    where
    ((select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or ci.callback_cancelled !='Y'))) <
    (select csr_calls_per_period from uid_sch_system_default)
    minus
    select
    to_char(d, 'fmDy MM/DD/YYYY AM') l
    , to_char(d, 'dd-mon-yy hh:mi:ss AM') v
    ,to_char(d, 'mm/dd/yy hh:mi:ss AM') o
    from
    t
    where
    (select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or (ci.callback_cancelled !='Y')))
    =(select override_amt from uid_sch_call_override
    where (to_char(begin_date,'dd-mon-yy') || ' ' || upper(period)) = to_char(t.d, 'dd-mon-yy AM'))
    union select
    to_char(d, 'fmDy MM/DD/YYYY AM') l
    , to_char(d, 'dd-mon-yy hh:mi:ss AM') v
    ,to_char(d, 'mm/dd/yy hh:mi:ss AM') o
    from
    t
    where
    ((select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or ci.callback_cancelled !='Y'))) >=
    (select csr_calls_per_period from uid_sch_system_default)
    and
    (select count(callback_date) from call_info ci where ci.callback_date = t.d
    and (ci.callback_cancelled is null or (ci.callback_cancelled !='Y')))
    <
    (select override_amt from uid_sch_call_override
    where (to_char(begin_date,'dd-mon-yy') || ' ' || upper(period)) = to_char(t.d, 'dd-mon-yy AM'))
    order by o
    The form then has the item set as a popup with a date format mask of dd-MON-yy hh:mi:ss AM. The popup displays fine and the date is shown in the field but the error is received when I try to save the information. If I change the application global setting of date format mask to dd-MON-yy hh:mi:ss AM then this error goes away however, it creates problems on all the rest of my pages that use this date in the where clause of the queries. Is there a way to solve the problem above without having to change the globalization parameter or do I need to change this parameter and then redo those queries?
    Thanks for your help!
    Amber

    Amber,
    It's interesting that the problem goes away if you set the global date format to be the same as the column level. The column level should trump the global setting. What process is returning the error? Are you sure it's the MRU or could it be something custom?
    You could consider adding a process before the MRU fires that uses alter session to change the date format.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Invalid date format causes system to crash

    Hello experts. I'm not sure where to even start looking to resolve this problem.
    In the shopping cart if a user changes the delivery date to an incorrect format it causes the system to hang. For example if the user enters a date in the past such as 03/01/2006 the correct error msg is returned.  However, if they enter an invalid format like <b>0/28/2006, 0328/2006</b> a pop-up box with the "invalid date" msg continuously appears. Even after pressing "ok" it pops up over and over again.
    The only way out is to terminate the application. Any help will be appreciated. Thank you

    Hi Jocelyne,
    SP contains a lot of notes including the one you want.
    If you do not want to test back all impacts generated by all the notes you do not want, you have to use option 2 which corrects only the bug you have now.
    Kind regards
    Yann

  • Invalid date format for 'Created' field in the getVersions web service Response.

    Hi all,
    I am trying to get all versions for selected document by calling getVersions method Versions.asmxweb service, but getting ‘Created’ date attribute value is in the format "29-05-2012 12:01"
    but I am expecting either one of the following date formats.
     1.      yyyy-MM-dd HH:mm:ss  or  yyyy-MM-ddTHH:mm:ssz
     2.      MM/dd/yyyy HH:mm a   (a means AM/PM)
     3.      MM/dd/yyyy
     4.      yyyyMMdd HH:mm:ss
    where do I need to change?
    what are all the formate will be support by SharePoint?
    please find attached response xml of getVersions call.
    <results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
        <list id="{6A6F6CD1-2E9C-44CC-B1F5-56G7JB5C8778}"/>
        <versioning enabled="1"/>
        <settings url="http://hbngjfgj47s20/reg/_layouts/LstSetng.aspx?List={7S6F6CD1-2E9C-44CC-B1F5-KO9J8Y7Y6H78}"/>
        <result version="@0.3" url="http://vmesxsrv47s20/register/Shared Documents/Parent/child/my_doc" created="29-05-2012 12:01" createdRaw="2014-12-02T12:46:02Z" createdBy="my_dom\agi_sharepoint"
    createdByName="AGI_Sharepoint" size="288" comments=""/>
        <result version="0.1" url="http://hbngjfgj47s20/register/_vti_history/1/Shared Documents/Parent/child/my_doc" created="29-05-2012 10:01" createdRaw="2014-12-02T10:55:18Z" createdBy="my_dom\my_sharepoint"
    createdByName="my_sharepoint" size="288" comments=""/>
        <result version="0.2" url="http://hbngjfgj47s20/register/_vti_history/2/Shared Documents/Parent/child/my_doc.txt" created="29-05-2012 11:01" createdRaw="2014-12-02T10:59:25Z" createdBy="my_dom\my_sharepoint"
    createdByName="my_sharepoint" size="288" comments=""/>
    </results>
    Kindly help me on this.

    Hi,
    According to your post, my understanding is that you want to change date format for ‘Created’ field in the getVersions web service.
    Per my knowledge, you can get the date format for ‘Created’ field as “MM/dd/yyyy HH:mm a”.
    For more information, you can refer to:
    Versions.GetVersions Method (Versions)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Invalid date format form Spool PDF

    Hi,
    When iam excuting a program thourgh batchjob iam getting Spool PDF there iam getting the invaid date format as 11-05-2283 78:42:87 .I feel this may be problem from output device.
    Please let me know where should we check the same.
    Thanks

    Hi,
    The job is running for a custom program.Not only the particular Job some of the other Jobs also giving the same date format.
    If it is spool attributes problem then where should we check this? or Printer settings problem? even that time format is not exist every where in world .
    Thanks..

  • Custom error message for invalid date format

    Hi,
    I am using af:selectInputDate component for date. When i enter wrong date format it comes up follwoing pop up error message:
    The value "12/13/2009" is not a valid date. Valid example ""29/11/2005".
    However i dont want to show this standard message but a customised error message like "the value is not in correct format...".
    Can anyone help me how can i show customised message.

    Hi Kiran
    Try these options
    1) Change your <b>Internet Explorer</b> [The Browser which you are using] language
    2) In Application Level, ie in Webdynpro
    a)Go to <b><Your project name>>Webdynpro>Applications--><Your Application>
    Double click on your Application name</b>b) Go to Application Properties TAB, Add a New Application Property
    c) Click on "<b>Browse</b>" and Select <b>DefaultLocale</b> and mention the Value as
    <b>en_US</b> [If you didnt mention any thing here by default it will take browser's language]
    3)In your Portal check the language setting of particular user in identity management
    Warm Regards
    Chaitanya.A

  • Invalid data format on EXPORTING table  to SQL-FLAT FILE (Insert type)

    Hi there!
    Writing from Slovenia/Europe.
    Working with ORACLE9i (standard version) on Windows XP with SQL-deloper 1.0.0.015.
    FIRST SQL.-DEVELOPER IS GOOD TOOL WITH SOME MINOR ERRORS.
    1.) Declare and Insert data EXAMPLE
    drop table tst_date;
    create table tst_date (fld_date date);
    insert into tst_date values (sysdate);
    insert into tst_date values (sysdate);
    2.) Retriving date with SQLPLUS
    SQL> select to_char(fld_date,'DD.MM.YYYY HH24:MI:SS') FROM TST_DATE;
    23.10.2006 11:25:23
    23.10.2006 11:25:25
    As you see TIME DATA IS CORRECT.
    When I EXPOPRT data TO SQL-insert type I got this result IN TST_DATE.SQL file:
    -- INSERTING into TST_DATE
    Insert into "TST_DATE" ("FLD_DATE") values (to_date('2006-10-23','DD.MM.RR'));
    Insert into "TST_DATE" ("FLD_DATE") values (to_date('2006-10-23','DD.MM.RR'));
    As you seel I lost TIME DATA.
    QUESTION!
    HOW CAN I SET PROPER DATE FORMAT IN SQL-DEVELOPER BEFORE I EXPORT DATA TO FLAT FILE.
    Best regards, Iztok from SLOVENIA
    Message was edited by:
    DEKUS

    A DATE-Field, is a DATE-Field and not a
    DATE-TIME-Field.
    The export-tool identifies a DATE-Field and exports
    the data into date-format.This is not true. Oracle DATE fields include a time element.
    To the original poster - I believe this is a bug in the current version.
    See this thread for possible workarounds Bad Export format --- BUG ???
    Message was edited by:
    smitjb

  • Invalid data format error for CLOB

    I am trying to migrate a piece of code from WLS 8.1.2 to WLS 8.1.5.
    WLS 8.1.2 has ojdbc14.jar with version "Oracle JDBC Driver version - 9.0.2.0.0"
    WLS 8.1.5 has ojdbc14.jar with version "Oracle JDBC Driver version - 10.1.0.4.0"
    In the older version, I am storing an encrypted string value in a clob and saving in the db.
    When I try the same in the new code, it displays an error that the data is not of the proper format.
    If I read any data entered using the older application, in the new one, it is still valid.
    But, if I enter a new value using WLS 8.1.5, only those are invalid.
    I even tried deploying the application with the old and new ojdbc14.jar files with it. In either case, it still gives an error. If I use the later version of ojdbc14.jar, the method getAsciiStream() is deprecated.
    How can I make my code independent of the version of ojdbc14.jar and store and read the clob?

    Rohit B wrote:
    I am trying to migrate a piece of code from WLS 8.1.2 to WLS 8.1.5.
    WLS 8.1.2 has ojdbc14.jar with version "Oracle JDBC Driver version - 9.0.2.0.0"
    WLS 8.1.5 has ojdbc14.jar with version "Oracle JDBC Driver version - 10.1.0.4.0"
    In the older version, I am storing an encrypted string value in a clob and saving in the db.
    When I try the same in the new code, it displays an error that the data is not of the proper format.
    If I read any data entered using the older application, in the new one, it is still valid.
    But, if I enter a new value using WLS 8.1.5, only those are invalid.
    I even tried deploying the application with the old and new ojdbc14.jar files with it. In either case, it still gives an error. If I use the later version of ojdbc14.jar, the method getAsciiStream() is deprecated.
    How can I make my code independent of the version of ojdbc14.jar and store and read the clob?Hi. You are suffering with the evolution of Oracle's driver. If you can make a standalone
    program that contains some data, inserts it and extracts it an compares it and proves
    the bug, we can open a case with Oracle. In general you want to use their latest driver,
    but if you can't keep up with their bugs/fixes, you can always keep using the same version
    of the driver everywhere. The way to do that is not to put the driver in you packages,
    but simply to keep the version you want in the weblogic installation's server\lib
    directory (ojdbc14.jar)
    Joe

  • Invalid Date Format - Italian

    When i set italiano as language in portal, instead of current date a see 'Maschera formato data non valida'.
    Where is the problem?

    Fabio,
    this bug appears in several languages. A workaround is described in this thread: http://forums.oracle.com/forums/message.jsp?id=497167
    Hth,
    Ton

  • Date format in flat file of bdc

    Hi Folks,
    In BDC I have a flat file which has to be uploaded from a flat file and 4 users are using each of one has their date format.
    so inorder to get their required date format what i need to do .

    Hi,
           use the below logic in your code.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X',                                     "SAP date format YYYYDDMM
                date2 RADIOBUTTON GROUP rad1,                                                 "Date format like aprial31, 2006
                date3 RADIOBUTTON GROUP rad1,                                                 "Date format like 31 apr,2006
                date4 RADIOBUTTON GROUP rad1,                                                 "Date format like DD/MM/YYYY
                date5 RADIOBUTTON GROUP rad1.                                                 "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
      SELECT mnr
             ktx
             ltx
       INTO TABLE T_month
       FROM t247
       WHERE spras = 'EN'.
      IF sy-subrc NE '0'.
          MESSAGE I                                                          "Message - Not able to get month values from the table T247
      ENDIF.
    ENDFORM.                                                                               
    DATA : temp_date(16)  TYPE c,
             temp1_date(60) TYPE c,
             year(4)        TYPE c,
             daymonth(11)   TYPE c,
             daymonth1(11)  TYPE c,
             month(9)       TYPE c,
             day(2)         TYPE c,
             mon            LIKE t247-ktx,
             len            TYPE i   .
      MOVE date TO temp1_date .
      CONDENSE temp1_date NO-GAPS.
      MOVE temp1_date TO temp_date .
      IF date2 EQ 'X'.                                                                     "The date format is like Aprial 31, 2007
        CONDENSE temp_date NO-GAPS.
        SPLIT date AT ',' INTO daymonth year.
        IF STRLEN( year ) NE '4'.
          error = 'X'.
          WRITE :  'Invalid date format.'.
        ELSE.
          daymonth1 = daymonth.
          CONDENSE daymonth1 NO-GAPS.
          _len      = STRLEN( _daymonth1 ).
          l_len      = 13 - len.
          SHIFT daymonth1 RIGHT BY len PLACES.
          CONDENSE daymonth1 NO-GAPS.
          month    = daymonth1.
          CONDENSE month NO-GAPS.
          SORT t_month BY monthltx.
          READ TABLE t_month WITH KEY monthltx =  month.
          IF sy-subrc <> 0.
            error = 'X'.
            WRITE : 'Invalid date format.' .
          ELSE.
            len = STRLEN( month ).
            CONDENSE daymonth NO-GAPS.
            SHIFT daymonth LEFT BY len PLACES.
            day =  daymonth.
            CONDENSE day NO-GAPS.
            CONCATENATE year t_month-monthnumber day INTO o_date.
          ENDIF.
        ENDIF.
      ELSEIF p_date3 EQ 'X'.                                                                "The date format is like 31 apr, 2007
        CONDENSE temp_date NO-GAPS.
        SPLIT i_date AT ',' INTO daymonth year.
        IF STRLEN( year ) NE '4'.
          error = 'X'.
          WRITE :  'Invalid date format.'.
        ELSE.
          daymonth1 = daymonth.
          CONDENSE daymonth1 NO-GAPS.
          SHIFT daymonth1 LEFT BY 2 PLACES.
          CONDENSE daymonth1 NO-GAPS.
          month  = daymonth1.
          CONDENSE month NO-GAPS.
          TRANSLATE month TO UPPER CASE.
          SORT t_month BY monthstx.
          MOVE month to mon.
          READ TABLE t_month WITH KEY monthstx = mon.                                 
          IF sy-subrc <> 0.
            error = 'X'.
            WRITE : 'Invalid date format.' .
          ELSE.
            CONDENSE daymonth NO-GAPS.
            day =  daymonth+0(2).
            CONDENSE day NO-GAPS.
            CONCATENATE year t_month-monthnumber day INTO o_date.
         ENDIF.
       ENDIF.
      ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'.                                             "Date format is like DD.MM.YYYY or DD/MM/YYYY
        CONDENSE temp_date NO-GAPS.
        IF STRLEN( temp_date ) EQ 10.
          o_date0(4) = temp_date6(4).
          o_date4(2) = temp_date3(2).
          o_date6(2) = temp_date0(2).
        ELSE.
          error = 'X'.
          WRITE : 'Invalid date format.' .
        ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
         error = 'X'.
         WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM.                                                                               
    regards

  • Date format in Tablecontrol....

    Dear Experts,
    I have a type '1' program in which a screen is being called. The program displays and updates some personal information (employee info )in a Z table. The screen conatain a table control. And one of the column in the table control is of type DATE (DATUM/DATS/8), which displays the joining date of employee from the Z table.
    This program works fine when the user's date format is system default ie YYYMMDD(internal date format). But if a user with a different date format runs the program (say DDMMYYYY) the date field in the table control will be displayed incorrectly ( like YY.YY.DDMM) and then the user cant trigger a PAI. System will give error message "Invalid date format".
    When i debug the report, i can find that the corresponding date fields in ABAP are in internal format (YYYYMMDD). What can be the solution?
    Do i need to change all the date values according to user parameter in the program, before display? Or is there any option in screen painter, which will automatically convert the date format according to user defaults?
    this is an urgent issue here...
    Thanking you in Anticipation
    Deepak

    Hello Friend,
    Normally incase of dates, different users may have different date settings..So the standard procedure is..
    1. take the date into a CHAR field
    2. declare a variable with type DATE (LIKE required table
       field ).
    3. assign the CHAR field to DATE field
    4. Again assign the DATE field to CHAR field using
       WRITE...TO.
    For eg.
    Please have a look at the below code.. It may help you.
        perform format_date  changing   lwa_output-DATAB_new.
    (* here 'lwa_output-DATAB_new' is an internal table field)
    FORM FORMAT_DATE CHANGING P_DAT_NEW.
      data: l_f_datum    like rv13a-datab.
      data: l_f_date(2)  type c,
            l_f_mont(2)  type c,
            l_f_year(4)  type c.
      data:  SEPER TYPE C,
             BUF(256).
    get the date fields seperator
      BUF = P_DAT_NEW.
      TRANSLATE BUF USING '0 1 2 3 4 5 6 7 8 9 '.
      CONDENSE BUF NO-GAPS.
      SEPER = BUF(1).
      clear: l_f_date, l_f_mont, l_f_year.
      SPLIT P_DAT_NEW AT SEPER INTO l_f_date
                                    l_f_mont
                                    l_f_year.
      clear p_dat_new.
    concatenate l_f_date l_f_mont l_f_year into p_dat_new.
      concatenate  l_f_year l_f_mont l_f_date into p_dat_new.
      clear l_f_datum.
      l_f_datum  =  p_dat_new.
      clear p_dat_new.
      write l_f_datum to p_dat_new.
    ENDFORM.                    " FORMAT_DATE
    Plz..Reward me if it works..

  • How to change the date format  YYYYMMDD to MM/DD/YYYY

    Hi ,
    How to change the date format  YYYYMMDD to MM/DD/YYYY .
    Ex :  20071008  to 10/08/2007
    Is there any function module for this ??
    Regards
    Rahul

    Hi Sharma,
    check the code:
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.
    PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM
    date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006
    date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006
    date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY
    date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY
    SELECTION-SCREEN END OF BLOCK b2
    FORM getmonth .
    SELECT mnr
    ktx
    ltx
    INTO TABLE T_month
    FROM t247
    WHERE spras = 'EN'.
    IF sy-subrc NE '0'.
    MESSAGE I "Message - Not able to get month values from the table T247
    ENDIF.
    ENDFORM.
    DATA : temp_date(16) TYPE c,
    temp1_date(60) TYPE c,
    year(4) TYPE c,
    daymonth(11) TYPE c,
    daymonth1(11) TYPE c,
    month(9) TYPE c,
    day(2) TYPE c,
    mon LIKE t247-ktx,
    len TYPE i .
    MOVE date TO temp1_date .
    CONDENSE temp1_date NO-GAPS.
    MOVE temp1_date TO temp_date .
    IF date2 EQ 'X'. "The date format is like Aprial 31, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    _len = STRLEN( _daymonth1 ).
    l_len = 13 - len.
    SHIFT daymonth1 RIGHT BY len PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    SORT t_month BY monthltx.
    READ TABLE t_month WITH KEY monthltx = month.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    len = STRLEN( month ).
    CONDENSE daymonth NO-GAPS.
    SHIFT daymonth LEFT BY len PLACES.
    day = daymonth.
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007
    CONDENSE temp_date NO-GAPS.
    SPLIT i_date AT ',' INTO daymonth year.
    IF STRLEN( year ) NE '4'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ELSE.
    daymonth1 = daymonth.
    CONDENSE daymonth1 NO-GAPS.
    SHIFT daymonth1 LEFT BY 2 PLACES.
    CONDENSE daymonth1 NO-GAPS.
    month = daymonth1.
    CONDENSE month NO-GAPS.
    TRANSLATE month TO UPPER CASE.
    SORT t_month BY monthstx.
    MOVE month to mon.
    READ TABLE t_month WITH KEY monthstx = mon.
    IF sy-subrc <> 0.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ELSE.
    CONDENSE daymonth NO-GAPS.
    day = daymonth+0(2).
    CONDENSE day NO-GAPS.
    CONCATENATE year t_month-monthnumber day INTO o_date.
    ENDIF.
    ENDIF.
    ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY
    CONDENSE temp_date NO-GAPS.
    IF STRLEN( temp_date ) EQ 10.
    o_date0(4) = temp_date6(4).
    o_date4(2) = temp_date3(2).
    o_date6(2) = temp_date0(2).
    ELSE.
    error = 'X'.
    WRITE : 'Invalid date format.' .
    ENDIF.
    ENDIF.
    IF STRLEN( o_date ) NE '8'.
    error = 'X'.
    WRITE : 'Invalid date format.'.
    ENDIf.
    ENDFORM. " f0100_conv_date
    Reward if helpful.
    Regards,
    Harini.S

  • Date Format problem in a Spanish OS?

    Hi Experts,
    I have been stucked with this weird problem I am experiencing right now. I am able to process the date formats using SBO 2007A PL 37 and an English OS (XP, Vista) with no problem. But when we test the same application on a Spanish version of XP, I am getting an invalid date format.
    Btw, in an English OS I can process all sbo date formats (mm/dd/ccyy, mm/dd/yy, dd/mm/yy, dd/mm/ccyy, ccyy/mm/dd, dd/month/yyyy). Is there anything else that I need to check somewhere?
    Thanks,
    Marlon

    Hi Marlon,
    The OS Local definitions. Different countries have different date formats for their location. Check the date format of the OS CultureInfo settings.
    Regards,
    Vítor Vieira

Maybe you are looking for

  • How to specify which cert to use for software virt server?

    Is there a way to specify which certificate to use for each software virtual server? So, for example a user hitting https://somewhere.com would get the certificate for somewhere.com while the virtual server https://somewhereelse.com would use the cer

  • Fit Content To Frame Crashes InDesign CS3 !

    Hi iam try to fit the content to it's frame if(Utils<Facade::IFrameContentFacade>()->CanFitContentToFrame(UIDList(newPageItemRef))) ErrorCode err=Utils<Facade::IFrameContentFacade>()->FitContentToFrame((UIDList(newPageItemRef))); But whenever I execu

  • RFC Interface Generation

    Under 4.6C, in SE37 you could generate RFC interface code (.c and .h files) for a function by going to the menu bar: Utilities / RFC Interface / Generate Under 4.7, there is no RFC Interface option under Utilities. Any idea if this has been moved els

  • BSP Graphics Extension (MTA)

    Dear All, I am trying to generate an MTA using BSP graphics extension. I have managed to get the structure of the graphic: <Defaults> <ChartType>MTA</ChartType> <FontFamily>Arial</FontFamily> </Defaults> However, I am having trouble placing the value

  • If your iCal IS working after 10.5.3 update

    To further investigate the issues of calendars not being able to be written / updated, I want to investigate permissions. Could someone please post their results of the following commands so I can match to mine. Thanks. xserve:~ admin$ *ls -la /Libra