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

SY-DATUM ISSUE.....

Hi All,

When I write the statement like this: WRITE: /1 sy-datum, its printing the date 01/28/2008, but my requirement is I wanted to print like this: 01/28/08, how to do please let me know.

Akshitha.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 03:13 PM

    Try with this statement.

    WRITE:/ sy-datum DD/MM/YY.

    For more information , press F1 on write stmt.

    Award points if you are satisfied.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2008 at 03:17 PM

    Hi,

    DATA:FINAL_DATE(10) TYPE C.

    CONCATENATE SY-DATUM4(2) '/' SY-DATUM6(2)'/' SY-DATUM+2(2) INTO

    FINAL_DATE.

    WRITE:FINAL_DATE.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 28, 2008 at 03:17 PM

    Hi Aks

    try this way :

    CONVERSION_EXIT_PDATE_OUTPUT

    01/28/2008

    concatenate sy-datum+0(6)  sy-datum+8(2) into lv_date.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 03:22 PM

    hi

    good

    store the sy-datum value in a variable and than change the format of that field value as per your requiement.

    thanks

    mrutyun^

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 03:22 PM

    Hi,

    ther are many options. but uthis case if u change the user master record.or select the date format in table usr01.

    the hard coating is not at all god and it also have limitation .

    this function module also helps u.

    CONVERT_DATE_TO_EXTERNAL Converts date from system storage format to users specified display format

    let me know if u are not able to get it.

    reward all help full answers

    /: 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)

    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 = ' '

    In most print programs there is a function module called as below.

    By setting the export parameter PI_COUNTRY one can set the form to print all dates according to country without any further coding.

    CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'

    EXPORTING

    PI_NAST = NAST

    PI_COUNTRY = IS_DLV-LAND

    PI_ADDR_KEY = IS_ADDR_KEY

    PI_REPID = LF_REPID

    PI_SCREEN = XSCREEN

    IMPORTING

    PE_RETURNCODE = CF_RETCODE

    PE_ITCPO = LS_ITCPO

    PE_DEVICE = LF_DEVICE

    PE_RECIPIENT = CS_RECIPIENT

    PE_SENDER = CS_SENDER.

    or

    If the input is always in the format DD.MM.YYYY..Then check this..

    Use the sub field operation to get the values and then use concanate..

    Ex.

    DATA: V_INPUT(10) VALUE '27.03.2007'.

    DATA: V_OUTPUT(10).

    CONCATENATE V_INPUT3(2) '/' V_INPUT(2) '/' V_INPUT6(4)

    INTO V_OUTPUT.

    WRITE: / V_OUTPUT.

    or

    You can use function module CONVERSION_EXIT_SDATE_OUTPUT to convert the date format

    If your problem is solved please set the question as answered.

    Regards,

    Chandru

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 05:08 AM

    Hi,

    SIMPLY:

    WRITE sy-datum DD/MM/YY.

    PLS REWARD POINTS IF SOLVED YOUR ISSUE.

    Regards,

    Renjith Michael.

    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.