*&---------------------------------------------------------------------*
*& Form GET_NAME_MONTH
*&---------------------------------------------------------------------*
* Get the name of the month passed as parameter
*----------------------------------------------------------------------*
* -->P_INT_MONTH_WA_MONTH Month's Number
* <--P_MONTH_NAME Month's Name
*----------------------------------------------------------------------*
form get_name_month using p_int_month_wa_month like t247-mnr
changing p_month_name like t247-ltx.
*
data: names_month like t247 occurs 0 with header line,
subrc like sy-subrc.
*
call function 'MONTH_NAMES_GET'
exporting
language = sy-langu
importing
return_code = subrc
tables
month_names = names_month
exceptions
month_names_not_found = 1
others = 2.
if sy-subrc ne 0.
retcode_r = 21.
endif.
if subrc ne pve00_ok.
clear p_month_name.
else.
loop at names_month where mnr = p_int_month_wa_month. endloop.
if sy-subrc ne pve00_ok.
clear p_month_name.
else.
p_month_name = names_month-ltx.
endif.
endif.
endform. " GET_NAME_MONTH
Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=1857104
本文介绍了一个ABAP程序,该程序用于将月份数字转换为对应的月份名称。通过调用MONTH_NAMES_GET函数模块,实现了输入月份数字后返回相应的月份全称的功能。适用于需要进行月份信息格式化处理的应用场景。
844

被折叠的 条评论
为什么被折叠?



