Date conversion from mm/dd/yyyy to 'yyyymmdd'

Hi,
I want to convert the 'mm/dd/yyyy' to 'YYYYMMDD'.
l_endlate = '12/17/2006'
gw_flatfile-zzenddate format is 'YYYYMMDD'
The following function module has error.  I think the dype is not right.  What should I put there?   Or do you have better suggestion?
    CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
      EXPORTING
        datum = l_enddate
        dtype = 'DATS'
      IMPORTING
        idate = gw_flatfile-zzenddate.
Thanks,
Helen

Hi,
You can use the following code:
*-Local variables-
  DATA: lf_length TYPE i,
            ex_date TYPE char10,
            in_date TYPE begda
*-Local constants--
  DATA:lc_8 TYPE char1 VALUE '8',
       lc_9 TYPE char1 VALUE '9',
       lc_10 TYPE char2 VALUE '10',
       lc_0 TYPE char1 VALUE '0',
       lc_limit TYPE char1 VALUE '/'.
  lf_length = STRLEN( ex_date )."Length of the external date field.
  IF NOT ex_date CA lc_limit.
   MESSAGE 'wrong format' TYPE 'E'.
  ENDIF.
  CASE lf_length.
    WHEN lc_8.
      IF ex_date1(1) EQ lc_limit AND ex_date3(1) EQ lc_limit.
        CONCATENATE ex_date+4(4) lc_0 ex_date(1)
        lc_0 ex_date+2(1) INTO int_date.
      ENDIF.
    WHEN lc_10.
      IF ex_date2(1) EQ lc_limit AND ex_date5(1) EQ lc_limit.
        CONCATENATE ex_date+6(4) ex_date(2)
         ex_date+3(2) INTO int_date.
      ENDIF.
    WHEN lc_9.
      IF ex_date1(1) EQ lc_limit AND ex_date4(1) EQ lc_limit.
        CONCATENATE ex_date+5(4) lc_0 ex_date(1)
         ex_date+2(2) INTO int_date.
      ELSEIF ex_date2(1) EQ lc_limit AND ex_date4(1) EQ lc_limit.
        CONCATENATE ex_date+5(4) ex_date(2) lc_0
        ex_date+3(1) INTO int_date.
      ENDIF .
  ENDCASE.

Similar Messages

  • Date Format Conversion from MM.DD.YYYY to YYYYMMDD

    Hi All,
    I am trying to load data from r/3, and i have date format as MM.DD.YYYY in source system.how can i convert this into YYYYMMDD format in transfer rules(I know that we have to write a routine in transfer rules).Could anybody help me out pl?..pl give me conversion routine for it.
    Here BW Filed is 0DATE and R/3 Filed is ZZDATE.
    regards
    murali.
    Message was edited by: Murali

    Hi,
    Try to under stand what I am asking :
    <b>What is the domain(or data type) used for the ZZDATE field.</b>
    Ok ,
    If some records are having proper format and others are having wrong format, even we canot correct this with routine also. So in this case you have to edit manually at PSA, then do upload.
    You are right, when we are populating data to ODS , if there is any wrong format of value, it will not disply the error at the time of loading .It will through the error at the time of activation.
    With rgds,
    Anil Kumar Sharma .P

  • Date format from DD/MM/YY to YYYYMMDD

    Hi Guys,
    Date foramt DD/MM/YY(23/09/08) is coming from the flatfiles  
    (text files). I want to convert it to YYYYMMDD format.
    Is it possible to convert date format from DD/MM/YY to
    YYYYMMDD?
      I'm in BI 7.0 environment.When I load date like DD/MM/YY
      (23/09/08) till PSA.In PSA it is showing 08.0/.06/9.
      Please suggest me the right way.It is very impartant for us.
      Thanks
      Prasad

    Hi Guys,
    I understand that this leads to degrade the loading
    Performance.But I don't have the alternative.
    When I use the RSDAT in data source conversion routine it is
    throughing the below error.
    "Error 'Date   .30.0806 contains invalid characters...' at conversion exit CONVERSION_EXIT_RSDAT_INPUT (field CALDAY record 1, value 6/30/08)"
    Can any body suggest me the other way or any other date
    converion routine from 23/09/08 to YYYYMMDD without slash?
    Thanks
    Prasad

  • How to change data format from  MM/DD/YYYY to DD/MM/YYYY

    HI,
    How can we change data format from MM/DD/YYYY to DD/MM/YYYY in Prompt and Report Level in obiee 11g.
    Please help me ont this.
    Thanks

    Hi,
    In Prompt:
    Try using EVALUATE function.
    Eg: Evaluate('TO_CHAR(%1,%2)' as character(30),"D5.Times"."Day Date",'DD-MON-YYYY')
    Report level:
    Try this in the column formula-
    Evaluate('TO_CHAR(%1,%2)' as character(30),"D5.Times"."Day Date",'MM/DD/YYYY')
    (or)
    EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 30 ), "Dim- Date".Start Date, 'MON-YY')
    http://108obiee.blogspot.in/2009/03/how-to-change-date-format-mask-in-date.html
    http://obiee-bip.blogspot.in/2011/08/customizing-obiee-calendar-display.html
    Some other methods.
    Metdhod 1:
    'Save System-Wide Column Formats' Option
    Check this.
    http://siebel-essentials.blogspot.com/2010/10/11-obiee-11g-tips-9-system-wide.html?m=1
    Thanks
    satya

  • How do i do data conversion from 11.0.3 to 11.5.10?

    Hi to all,
    If any body have any approach how to do data conversion from 11.0.3 to 11.5.10 release?
    Thanx in Advance

    ajones2 wrote:
    I got the update to work but there seems to be one thing that does not work
    I'm anxious to install 4.5 as well because I understand the music player features a sound equalizer, but I believe it's not prudent to get it from somewhere other than your carrier.  I could be wrong, but I think that each carrier tweaks the OS in some fashion...
    Does your 4.5 have the sound equalizer ?
    George from Bedford, TX
    8120 on T-Mobile with BB Unlimited Email+Internet but
    without the BlackBerry Enterprise service

  • Reg : date format conversion from dd.mm.yyyy to mmddyyyy

    hi ALL,
    is there any function module which can convert date format
    from <b>dd.mm.yyyy to mmddyyyy</b>.
    Thanks in advance

    Hi,
    Please check the following
    CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
    CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
    SCA1 Date: Conversion
    CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit
    CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    TB01_ADDON
    CONVERSION_EXIT_DATEX_INPUT
    CONVERSION_EXIT_DATEX_OUTPUT
    Hope this would surely help you out.
    Thanks and regards,
    Varun.

  • Date conversion from Excel to the SAP format

    Hi,
    I have created a BDC program which uploads daat from Excel sheet.
    There is a date field also, the format of which can be any as per the end user (it will be one of those allowed by SAP).
    However, the file will be used for execution by another user who may have a date setting which is different than that from the one in Excel.
    Eg. End User's date format: DD.MM.YYYY, SAP User's date format: MM/DD/YYYY
    So, how do I convert the date format from excel to the format which will be accepted by the transaction during the recording?
    Regards,
    Dave

    Hi Dave,
    I have faced the same issue while uploading the date to the bdc.
    if ur date format is DD.MM.YYYY in the excel file, first of all you need to change this to dats format ie YYYYMMDD ie character8 format and pass to the bdc, it will automatically convert to sap format
    ie you need to convert splitting at .
    data lv_date type char10,
            lv_dd type char02,
            lv_mm type char02,
           lv_yyyy type char04,
    v_date type char08.
    lv_date = '30.12.2011'.
    split lv_date at '.' into lv_dd lv_mm lv_yyyy.
    if strlen(lv_dd) lt 2.
       concatenate '0' lv_dd into lv_dd.
    endif.
    if strlen(lv_mm) lt 2.
       concatenate '0' lv_mm into lv_mm.
    endif.
    concatenate lv_yyyy lv_mm lv_dd into v_date.
    "Please use the variable V_DATE to populate to ur bdc"
    Edited by: Rahul Babukuttan on Aug 11, 2011 5:35 PM

  • GL Data Conversion from Legacy to Oracle EBS

    Hi All,
    I am tasked with converting legacy data into GL. I have worked on other conversions like supplier, AR and AP conversions but never worked on GL conversion, so I don't know how and where to start, what are the pre-requisites for entering data into gl_interface table how to ensure that data is correct in the .csv file etc.
    Kindly request you all to guide me in right direction. Hope to hear from you all very soon!!! :)
    Regards

    Hi,
    When you talk about GL-Data it is the trial balance to be loaded from legacy to oracle applications.
    You can use Web-ADI to upload it ,the check list are
    The balance for each account comibnation in the legacy system to be mapped to GL-Oracle code combination balance
    With respect to open AR, AP Invoices if the invoices are converted using a control account for migration in GL then
    the the balance transfered from AP,AR need not be reversed in GL from the source receivables and payables.
    In case if the same account combination are for migrating the balances from AP,AR to GL ..Then the balances transferred from AP,AR should be reversed ..so that it does not affect the TB-GL-Balance
    Finally ensure that the balance for the TB-tallys with your legacy system and upload it using Web-ADI ,import and
    review and post it.
    Hope this points helps your GL-Data conversion.
    Regards,
    Ramaa

  • Date format from mm/dd/yyyy to dd-mmm-yyyy

    How to convert the date from 01/01/2006 to 01-Jan-2006??

    Hi sravanthi,
    1. we have to apply some logic for that,
       and use the standard FM
       'MONTH_NAMES_GET'
    2. i have an independent FORM/PERFORM
       in which we give input as some date,
       and it returns date in format
       dd-mon-yyyy.
    3. just copy paste in new program and run.
    report abc.
    DATA : mname(25) TYPE c.
    PARAMETER : d TYPE sy-datum default sy-datum.
    PERFORM getmonth USING d mname.
    WRITE :/ mname.
    FORM getmonth USING d mname.
      DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
      DATA : m(2) TYPE c.
      m = d+4(2).
      CALL FUNCTION 'MONTH_NAMES_GET'
    EXPORTING
    LANGUAGE = SY-LANGU
    IMPORTING
    RETURN_CODE =
      TABLES
      month_names = month_names
      EXCEPTIONS
      month_names_not_found = 1
      OTHERS = 2
      READ TABLE month_names INDEX m.
      IF sy-subrc = 0.
        mname = month_names-ktx.
      ENDIF.
    concatenate d+6(2) '-' mname '-' d(4) into mname.
    ENDFORM. "getmonth
    regards,
    amit m.

  • Date conversion from YYYYMMDD to DD.MM.YYYY

    Hi,
    I'm trying to load some data from a flat file into BW. I have a date column in the CSV file that has the date in YYYYMMDD format. when I load it into Bw, I want to change the format to DD.MM.YYYY .
    I have written a small routine that should do this, but it doesn't seem to work.
    data:v_date like sy-datum,
    v_date1(10) type c.
    Concatenate v_date+6(2) '.' v_date+4(2) '.' v_date+0(4) into v_date1.
    RESULT = V_DATE1.
    The result of this routine is YY.YYMM.DD instead of DD.MM.YYYY.
    Can anyone tell me where I'm going wrong?
    Thanks
    Sam

    Hi Keshu,
    When I add the loop to my code, it doesn't seem to work. It gives me the following error:
    does not match the user-dependent date format --> long text
    Diagnosis
    does not correspond to the date format that is assigned to the current user ASDSAD.
    System Response
    The date cannot be converted; the process was terminated.
    Procedure
    Enter the conversion exit RSDAT for automatic date format detection.
    Any suggestions?

  • Conversion of date format from DD-MMM-YY to YYYYMMDD

    Hi all,
    i am getting date from oracle database which is in DD-MMM-YY format.   i want to change it to YYYYMMDD format .is there any func module to achieve this.
    bye

    hi srikanth,
    try this code it is exactly suite u r requiremnt
    DATA:STR(8),S1(2),DD(2),MM(2),YY(4).
    STR=SOURCE_FIELDS-/BIC-DATEFIELD(if bi7.0 )
    STR=TRANS_STRUCTURE-/BIC-DATEFIELD(if BW 3.5 )
    SPLIT STR  AT  u2018-u2018 INTO DD MM YY
    SHIFT DD  RIGHT DELETING TRAILING SPACE.
    SHIFT MM  RIGHT DELETING TRAILING SPACE.
    OVERLAY DD WITH S1.
    OVER LAY MM WITH S1.
    CONCATENATE YY  MM DD INTO STR.
    RESULT=STR.
    regards
    sasidhar

  • Date Conversion from GMT to Local and Local To GMT considering DST.

    Hi,
    I have a application which displays the time in GMT across all the screens,and saves in Local/Default TimeZone as application would be deployed in europe and India.I have written a utility which does the conversion.
    I just want to know that how to handle the Daylight Saving Time[DST] as we are taking the data from database and converting it to LocalTime Zone.This works fine but what would happen if the sever time is changes due to DST.There would be problem between the object saved before the DST and after DST because we are simply converting stored time to GMT to show on the screen.
    Please share if you some solution/suggestions.
    Thanks.
    Akash.

    YoungWinston wrote:
    jschell wrote:
    That statement is phrased oddly.
    A java.util.Date uses a UTC offset with millisecond resolution.
    A jdbc driver converts that value into a "correct" value for the target database.And from.
    The form that is stored in the database is entirely database dependent. The actual form stored in the database can take many forms.True, but it is highly likely to be an offset from some "epoch" (Progress, for example, uses 00:00:00 1/1/-3714 UTC as I recall, and has 1-second granularity).Yes but as I said the phrasing was odd. A timestamp, by definition, must be an offset of something. Doesn't matter how it is represented. After all the year 2009 is an offset in the Gregorian calander.
    However in terms of actual storage the way it is stored is unlikely to be similar to what Java does. As examples neither Oracle nor MS SQL Server uses a single numeric offset.
    It might not even have a concept of timezone.Again true, although I've yet to come across one; and since OP is only concerned about the timezone in Java I'm not quite sure how relevant that is.
    Relevant in terms of the description in terms of what java does, what the database does and how it gets from java to the database.
    I would also expect any JDBC driver that cannot translate to or from a Java date correctly to document the fact in 60-point bold type, since it's a violation of the implied contract of ResultSet.getDate().Except that depends on your definition of "correct".
    Examples of that
    - Oracle doesn't have millisecond resolution at all in its common format.
    - MS SQL Server doesn't have the same resolution as java, instead there is an odd resolution (one three-hundredth of a second).
    - MS SQL Server doesn't have timezones, so if you don't take care and your data crosses timezones the timestamp will be different.
    The drivers will not warn you of things like that. At least not that I have seen.
    Format for Oracle.
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:77562635789106]
    Format for MS SQL Server
    [http://msdn.microsoft.com/en-us/library/aa258277(SQL.80).aspx]

  • Date conversion from selections creen

    i need to convert the date input received from selection screen  which is in the format (YYYYMMDD) into a format which is of one date field type in some table in order to check the conditions in where clause..
    can any one pls help me with this
    Also how to do the validations for the date field entry in the selection screen

    Use T.Code --> SU3; go to defaults & maintain your <b>date format</b> there.
    Reward Points if it helps,
    Regards,
    N

  • Data conversion from 212 format

    I found a problem during conversion data.
    I have a file which contains ASCII characters (in fact they're look
    like ASCII on any editor) . I have to convert them to integer but I
    know that data are organised into pairs of 12bit numbers packed into
    byte triplets (format 212).
    I made some vi (which convert 2 following ASCII characters to binary,
    then divide them to pairs of 4bits, then some rotation etc..) but the
    whole conversion takes too much time (64kb file conversion is taking
    approx. 1minute).
    Thank you for any suggestions,
    Michael ([email protected])

    Dear Michal,
    I hope this vi work faster.
    Input: 3bytes, data type unsigned int (U8)
    Output: 2 values, data type integer. (INT16)
    of course read all file to memory. Don't read everytime from file by 3
    bytes.
    Deniss
    ps. vi i send by e-mail.
    "Michal Szaj" wrote in message
    news:[email protected]..
    > On Wed, 18 Sep 2002 02:27:25 GMT, Greg McKaskle
    > wrote:
    >
    > >This is one of those things that is quite sensitive to how it is coded.
    > > If you make your VI available, others, including myself can give you a
    > >hand with speeding it up.
    > >
    > >As for guessing at what might be going on, first look at the array wire.
    > > If you are using locals or property nodes to access the a
    rray, that is
    > >the cause. If the array is written to a global and later accessed via
    > >the global, that is causing it.
    > >
    > >I suspect that the bit manipulations on 64K should take something like a
    > >few seconds.
    > >
    > >Greg McKaskle
    >
    > Thank you for your support.
    >
    > In this case I have only one vi and I don't use any global/local
    > variables.
    > At the beginning of the vi I load all text character from file to
    > memory and then I'm making further operations.
    >
    > If it helps I can send the vi with data file.
    >
    > Thnx,
    >
    > Michael ([email protected])

  • Changing Date format from MM/DD/YYYY to DD/MM/YYYY

    Hello all,
              We have upgraded our portal system from EP 6.0 to EP 7.0 . Before upgrade the portal date format was in DD/MM/YYYY  format but after upgrade it has changed to MM/DD/YYYY.
              We changed the request.mandatoryCountry and Request.mandatoryLanguage parameters as GB and EN respectively .
    After this change the standard portal iview start showing date in DD/MM/YYYY format but custom web dynpro applications are still displaying date in MM/DD/YYYY format.
            Please suggest how can we change the date format for custom dynpro applications too.
    Regards,
    Ganesh

    Ganesh,
    You might find [this|http://help.sap.com/saphelp_nw04/helpdata/en/f4/d95664da179b4db731e21c2e470b72/frameset.htm] link helpful in understanding how the locale is determined for a user who logs into the portal.
    Similar discussions are on the following threads
    1 - date format
    2 - internationalization problem - default language of wd in portal
    A snippet from the above thread,
    1) Language indicator of the user  (Example: Language not set in portal)
    2) Language preference of the browser (Example: fr - Resource doesn't exists)
    3) Language indicator of the Web Dynpro Application
    4) Language preference of the system
    5) Language preference of the JVM
    Hope it helps.
    Good Luck!!!
    GLM

Maybe you are looking for

  • Problems w/ MSI PT880 Neo-LSR

    I built my sysytem last February and it ran great right out of the box with the current hardware I am still using( See Sig block). about a month ago I started getting a few windows crashes and lock-ups(win XP Pro). I wiped both my hard drives and re-

  • Dynamic color selection

    Hi Is is possiable to display the color palatte of developer during run time so that the user can chose the color for some fields based on his choice. null

  • FOR UPDATE query issue

    SELECT table_name FROM all_tables WHERE dropped = 'NO' and owner = 'test' FOR UPDATE; ERROR at line 1: ORA-02030: can only select from fixed tables/views ORA-06512: at line 9 ORA-06512: at line 16 Can any body help me out what is wrong in that query.

  • Not saving preferences after change in music folder

    I've successfully moved the Itunes location (folder) before on my laptop, changing the place where music was stored, but I had major problems getting that IBM Thinkpad to work with my brand new Ipod. So I brought the external hard drive back down to

  • How to setup Time stamp for CO-PA.

    Hello Friends, I have created CO-PA datasource in KEB0. Defaultly, the delta method has been selected as 'Generic delta'. But, I need time stamp for delta process. Where can I setup time stamp for CO-PA data source? Thanks Sumanth