‎2008 May 06 3:58 PM
Hi All,
I need a FM in which i can pass date i.e DATS and i want the output with month in char format.
eg.
input - 29/01/08 or any format
output should be 29-JAN-08.
plz help..
Thanks,
Riya.
‎2008 May 06 4:29 PM
Hi,
parameters: p_date type sy-datum obligatory.
data: month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
data: v_month like t247-ktx, v_result(20).
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = sy-langu
TABLES
month_names = month_names
EXCEPTIONS
month_names_not_found = 1
OTHERS = 2.
read table month_names with key mnr = p_date+4(2).
if sy-subrc = 0.
v_month = month_names-ktx.
endif.
concatenate p_date6(2) v_month p_date2(2) into v_result separated by '-'.
write:/ v_result.
‎2008 May 06 4:03 PM
‎2008 May 06 4:05 PM
get month names from table : T247 or use FM
MONTH_NAMES_GET to get month names ..
Get the required month name passing month ...
‎2008 May 06 4:20 PM
Hi Riya,
First u have to convert ur date from dd/mm/yy to yyyymmdd and then pass this to FM CONVERSION_EXIT_SDATE_OUTPUT.
Thanks,
Vinod.
‎2008 May 06 4:29 PM
Hi,
parameters: p_date type sy-datum obligatory.
data: month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
data: v_month like t247-ktx, v_result(20).
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
language = sy-langu
TABLES
month_names = month_names
EXCEPTIONS
month_names_not_found = 1
OTHERS = 2.
read table month_names with key mnr = p_date+4(2).
if sy-subrc = 0.
v_month = month_names-ktx.
endif.
concatenate p_date6(2) v_month p_date2(2) into v_result separated by '-'.
write:/ v_result.