Convert the date to the format of user that is running ?
This tip shows how to convert the sy-datum to the current user date format.
This tip shows how to convert the sy-datum to the current user date format.
Continue Reading This Article
Enjoy this article as well as all of our content, including E-Guides, news, tips and more.
The attached function module can do this work.
FUNCTION Z_CONV_SYDATE_TOUSER. *"---------------------------------------------------------------------- *"*"Interface local: *" IMPORTING *" REFERENCE(DATUME) LIKE USR01-HDEST *" REFERENCE(UNAME) LIKE SY-UNAME *" EXPORTING *" VALUE(DATUMS) LIKE USR01-BNAME *"--------------------------------------------------------------------- select single DATFM into wDATFM from usr01 where BNAME = uname. case wDATFM. when 1. concatenate DATUME+6(2) '.' DATUME+4(2) '.' DATUME+0(4) into DATUMS. when 2. concatenate DATUME+4(2) '/' DATUME+6(2) '/' DATUME+0(4) into DATUMS. when 3. concatenate DATUME+4(2) '-' DATUME+6(2) '-' DATUME+0(4) into DATUMS. when 4. concatenate DATUME+0(4) '.' DATUME+4(2) '.' DATUME+6(2) into DATUMS. when 5. concatenate DATUME+0(4) '/' DATUME+4(2) '/' DATUME+6(2) into DATUMS. when 6. concatenate DATUME+0(4) '-' DATUME+4(2) '-' DATUME+6(2) into DATUMS. endcase. ENDFUNCTION.