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

How to convert date format dd.mm.yy into yyyymmdd?

Hello experts,

how to convert date format dd.mm.yy into yyyymmdd?

Thanx

Axel

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 08:03 AM

    Hi Axel,

    You can 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.

    If the above solution did not work then then you need to use transfer routine. The routine would be like this:

    Char v_date(8), i_date(8), day(2), month(2), year(2).
    i_date = trans_stru-<your date>.
    day = i_date +  0(2).
    month = i_date + 4(2).
    year = i_date + 7(2) + 2000.
    concatenate year month day into v_date.
    Result = v_date.
    
    

    Bye

    Dinesh

    (Do not forget to assign points!!)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 07:23 AM

    Hi

    go through these previous threads on similar question

    https://forums.sdn.sap.com/click.jspa?searchID=673529&messageID=1763194

    converting-the-dateyyyymmdd-into-monthyyyymm-forma

    date-format-conversion-from-mmddyyyy-to-yyyymmdd

    gives clear idea

    Reagrds

    Kiran

    Message was edited by:

    ravi kiran naalla

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 07:23 AM

    Where do you want to do it, in ABAP code (in a routine)?

    You need to tell what the logic would be to change yy to yyyy (ie do you fix it to 19, or 20, or specify some condition like 'yy' > '50' ==> 19).

    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.