Skip to Content
author's profile photo Former Member
Former Member

date data conversion from MM/DD/YYYY to YYYYMMDD

HAI

I have date data(ZDATE) in the form of MM/DD/YYYY format in oracle source system ...

I want this date data(ZDATE) in the form of YYYYMMDD format in BW.

SO hw can change this format. I think , it can be done by writing the ABAP code in TS.

So pls give the ABAP code for converting the date format from MM/DD/YYYY to YYYYMMDD

rizwan

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 10:52 AM

    Hi Rizwan,

    You can also do this in the transfer rules using a conversion routine. Goto transfer rules -> Transfer str/Data structure -> for the date field -> select the conversion "PDATE" and then try the load.

    Bye

    Dinesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 10:55 AM

    hai Dinesh

    Is that conversion routine converts source data from MM/DD/YYYY to YYYYMMDD format in Bw.

    pls tell me confidently .

    rizwan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 10:58 AM

    Hi,

    ***********************888

    DATA : year type char 4,

    month type char 2,

    day type char 2,

    zdate type char 8.

    year = TRANSFER_STRUCTURE-/bic/ZDATE(4).

    month = TRANSFER_STRUCTURE-/bic/ZDATE+4(2).

    day = TRANSFER_STRUCTURE-/bic/ZDATE+6(2).

    CONCATENATE year month day into zdate.

    result = zdate.

    *****************************

    Regards,

    San!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 31, 2006 at 11:00 AM

    Hi,

    You can use std. FM 'CONVERSION_EXIT_PDATE_INPUT', this is for DD/MM/YYYY to YYYYMMDD. you can enhance this as per your requirement.

    regards,

    Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2013 at 05:37 AM

    hi

    to do it simpy you can extract the year , month and day into different variabales and then concatenate according to the format you want.

    dest_year = sourc_date + 7(4)

    dest_mm = sourc_date + 4(2)

    dest_day = sourc_date + 1(2).

    then concatenate all into the format you require

    Concatenate dest_year dest_mm dest_day dest_day into new_date separated by /

    with reaards

    Suneesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2013 at 06:51 AM

    There are no of ways for date conversion depends on requirement some are listed below

    1. You can use WRITE FORMATING.

    Here the sample code:

    DATA: BEGDA TYPE TEXT10,

    ENDDA TYPE SY-DATUM.

    WRITE SY-DATUM TO BEGDA MM/DD/YYYY.

    WRITE SY-DATUM TO ENDDA MM/DD/YYYY.

    And of course you can use other format, like:

    ... DD/MM/YY

    ... MM/DD/YY

    ... DD/MM/YYYY

    ... MM/DD/YYYY

    ... DDMMYY

    ... MMDDYY

    ... YYMMDD

    2. you can use concatenate statement:

    concatenate SY-DATUM+4(2) SY-DATUM+6(2) SY-DATUM(4) INTO BEGDA separated by '/'.

    Or

    3. use FM CONVERT_DATE_TO_EXTERNAL

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.