How to generate a long date like "2 januari 2007" from "20070102".

DATA my_date TYPE DATUM.
my_date = '20070502'.
 
DATA wa_dates LIKE TABLE OF T247 WITH HEADER LINE.
DATA wa_date LIKE TABLE OF T247 WITH HEADER LINE.
DATA long_date TYPE STRING.
 
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
TABLES
month_names = wa_dates.
 
.
IF sy-subrc eq 0.
READ TABLE wa_dates INTO wa_date
WITH KEY MNR = my_date+4(2).
CONCATENATE: my_date+6(2) wa_date-ltx my_date+0(4) INTO long_date SEPARATED BY SPACE.
ENDIF.
 
write: long_date.

Check out the APAP tutorials page for more sample program.

Comments