Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to create a default date

How can a create a default date from SY-datum that will give a date with a format like YYYYMMDD?

Edited by: Alvin Rosales on Oct 16, 2008 10:47 AM

Tags:
Former Member
Former Member replied

Hi Alvin

Try this code

DATA : DATE TYPE CHAR10.

CALL FUNCTION 'FORMAT_DATE_4_OUTPUT'
  EXPORTING
    DATIN         = SY-DATUM
    FORMAT        = 'YYYYMMDD'
 IMPORTING
   DATEX         = DATE
          .

WRITE : / DATE.

Regards

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question