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

date conversion

hi friends..

i want to convert the date

from 20070901 to 01.09.2007

is there any functional module for this conversion..

can you plz..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:11 AM

    Hello,

    Try this.

    REPORT ZTEST.

    DATA : V_DATE LIKE SY-DATUM,

    V_DATE1(10).

    V_DATE = '20070101'.

    CONCATENATE V_DATE6(2) V_DATE4(2) V_DATE+0(4) INTO V_DATE1.

    WRITE : V_DATE1.

    Some of the FM are used are:

    <b>HR_HK_CONV_DATE_TO_INTN_FORMA

    PT_IAC_GET_DATE_FORMAT

    CONVERT_DATE_TO_INTERN_FORMAT

    VALIDATE_BILLING_FORMAT

    HRGPBS_HESA_DATE_FORMAT

    HRGPBS_TPS_DATE_FORMAT

    CONVERT_DATE_FORMAT

    SLS_MISC_GET_USER_DATE_FORMAT

    SPP02_SET_DATEFORMAT</b>

    Regards,

    LIJO

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:13 AM

    Hi Deva,

    You can do it in the following way.

    data: lv_date_temp(10),

    lv_date type sy-datum.

    lv_date = sy-datum.

    concatenate lv_date6(2) lv_date4(2) lv_date+0(4) into lv_date_temp separated by '.'.

    Reward points if this helps.

    Regards,

    Ravi G

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:14 AM

    Hi deva

    if you would like to display in basic list , you can use

    WRITE sy-datum DD/MM/YYYY .

    Regards

    Wiboon

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:16 AM

    hi deva

    i dont no about FM but you can use this code.

    data : da(8) value '20070809',

    da1 type sy-datum.

    da1 = da.

    write :/ da1.

    hope it will help you.

    regards

    prajwal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:17 AM

    Hi,

    try fm

    CONVERSION_EXIT_PDATE_OUTPUT

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 07:55 AM

    Hi Deva,

    If you need this format for a BDC program then use the below code

    data: v_date type sy-datum value '20070901'.

    CONCATENATE v_date6(2) v_date4(2) v_date+0(4) INTO v_date.

    Now v_date contains '01092007'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 08:38 AM

    Hi Deva,

    If you are going to convert the date in a sapscript, then you can use SET DATE MASK = 'MM.DD.YYYY'.

    If you want to convert the format in a report, then you can use the Concatenate statement stated in other replies. This could be the simplest way.

    Hope this helps.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 08:43 AM

    Hi,

    data l_date(12) type c.

    write sy-datum to l_date using edit mask 'DD.MM.YYYY'

    • reward if helpful**

    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.