09-03-2008 12:30 PM
hi
i was wondering is there a FM which convert date format YYYYMMDD to DD.MM.YYYY
instead of u know cutting the YYYY and MM and DD and concatement them again
09-03-2008 12:32 PM
09-03-2008 12:32 PM
09-03-2008 12:33 PM
Hi,
You can use FM CONVERSION_EXIT_PDATE_OUTPUT. This will always convert from system format (YYYYMMDD) to actual user format (whatever set for the user, actually using the program).
Hope this will help.
Regards,
Nitin.
07-16-2019 1:01 PM
07-16-2019 3:19 PM
Harshit Agrawal Why not using the official and documented feature:
write sy_datum to var_c_10.
(without DD/MM/YYYY means the current user date format)
09-03-2008 1:02 PM
Hi ,
See this piece of code
Data : w_date type dats value '20080903',
w_date1(10),
Constants : C(1) value '.'.
w_date1 = w_date.
concatenate w_date+6(2) w_date+4(2) w_date+0(4) into w_date1 separated by C.
Write : / w_date1.
With Regards.
Alwasy Learner
09-03-2008 1:13 PM
Hi...
Check code in this FM...
HRGPBS_HESA_DATE_FORMAT
Thanks,
Naveen.I
09-03-2008 2:34 PM
09-03-2008 2:43 PM
09-03-2008 2:54 PM
07-18-2019 4:34 PM
Hi,
if you just want to convert the date into the user format (user settings) you can use string expressions:
data date type d value '20190718'.
data(l_user_format) = |{ date date = USER }|. "RAW, ISO, USER, ENVIRONMENT
write l_user_format.
I know, the the question is very old, i just want to add new possibilities.
lg Johann
10-15-2020 11:23 AM
03-18-2021 10:29 AM
Just adding:
you can also avoid the literals at all, using the constants of class CL_ABAP_FORMAT:
DATA(current_time) = sy-uzeit.
WRITE:/ |Time: { current_time }|.
WRITE:/ |Time (User format): { current_time TIME = (cl_abap_format=>t_user) } |.
WRITE:/ |Time (Environment format): { current_time TIME = (cl_abap_format=>t_environment) } |.
WRITE:/ |Time (ISO format): { current_time TIME = (cl_abap_format=>t_iso) } |.
Regards, Michal
09-09-2022 6:38 PM