Skip to Content
avatar image
Former Member

date format

Hi Experts,

In my script form date is displaying like yymmdd, i want to display like dd.mm.yy, please do the need full help.

Regards,

Radhakrishna.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Jul 07, 2008 at 06:35 AM

    Radha,

    you can use this code.

    concatinate date+4(2) '.' date+2(2) '.' date+0(2) into newfield.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 06:38 AM

    hi

    please try this

    /: SET DATE MASK = 'DD.MM.YYYY'

    Formatting Date Fields: SET DATE MASK Edit section

    To define the formatting of date fields, use the SET DATE MASK control command. Executing this command causes all subsequent date fields to be printed using the specified format.

    Syntax:

    /: SET DATE MASK = 'date_mask'

    In the date mask, you can use the following codes:

    DD: day (two digits)

    DDD: day name - abbreviated

    DDDD: day name - written out in full

    MM: month (two digits)

    MMM: month name - abbreviated

    MMMM: month name - written out in full

    YY: year (two digits)

    YYYY: year (four digits)

    LD: day (formatted as for the L option)

    LM: month (formatted as for the L option)

    LY: year (formatted as for the L option)

    All other characters found in a date mask are interpreted as simple text and are copied straight into the output.

    Assuming the current system date is March 1st, 1997.

    /: SET DATE MASK = 'Foster City, MM/DD/YY'

    &DATE& -> Foster City, 03/01/97

    /: SET DATE MASK = 'MMMM DD, YYYY'

    &DATE& -> March 01, 1997 The date mask may be reset to the default setting by using an empty string:

    /: SET DATE MASK = ' '

    The abbreviated and full forms of the names of the days and months are stored in the language dependent TTDTG table under the following keys:

    %%SAPSCRIPT_DDD_dd: abbreviated day name

    %%SAPSCRIPT_DDDD_dd: full form of day name

    %%SAPSCRIPT_MMM_mm: abbreviated month name

    %%SAPSCRIPT_MMMM_mm: full form of month name

    dd: day number 01 = Monday,..., 07 = Sunday

    mm: month number 01 = January,..., 12 = December

    reward points if useful,

    thanks,

    usha

    Edited by: Usha Rani Rachamalla on Jul 7, 2008 8:40 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 06:41 AM

    Hi,

    Pls do as follows : This will solve your problem :

    Seperate yymmdd as :

    Suppose v_date = yymmdd.

    v_date1 = v_date +4(2).

    v_date2 = v_date +2(2).

    v_date3 = v_date +0(2).

    Concatenate ' v_date1' '.' ' v_date2 ' '.' ' v_date3 ' into var_date seperated by Space.

    Display the variable var_date where ever you need in th for.

    This will solve the problem

    Thanks.

    Swati.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 06:43 AM

    Hi Shna,

    Pls have a look at this ...

    You can use the SET DATE MASK statement to for you requirement.

    And also we can do the manual settings in user maintainence SU01 (Generally you wont be authorized for this tcode.)

    Regards,

    Viveks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 06:44 AM

    Using /:SET DATE MASK = 'DD.MM.YY'.

    or Chnage default print settings in SU01 as you required.

    Regards,

    Dara.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 07:07 AM

    Hi,

    directly u can use this syntax.

    /: set data mask 'DD:MM:YY'.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 07:34 AM

    Use SET DATE MASK ..

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2008 at 07:56 AM

    Hi,

    Data : lv_budat type datum value '20080614'.

    Data : lv_budat_format type char10.

    WRITE lv_budat type TO lv_budat_format.

    O/P ==> lv_budat_format ---> 14.06.2008

    Reward if usefull..

    Thanks,

    Durai.V

    Add comment
    10|10000 characters needed characters exceeded