在abap的设计过程中经常会出现账务期输入,格式为年月。如果我们使用spmon元素为参考,但是系统无输入帮助,用户常常出错,为了避免输入错误。我们可以自定义输入帮助,步骤如下:
1、定义选择变量
parameter p_spmon type spmon default sy-datum+0(6) obligatory.
select-options s_spmon for s031-spmon default sy-datum+0(6) obligatory.
2、定义帮助子过程
form monat_f4.
data: begin of mf_dynpfields occurs 1.
include structure dynpread.
data: end of mf_dynpfields.
data: mf_returncode like sy-subrc,
mf_monat like isellist-month,
mf_hlp_repid like sy-repid.
field-symbols: <mf_feld>.
get cursor field mf_dynpfields-fieldname.
append mf_dynpfields.
mf_hlp_repid = sy-repid.
do 2 times.
call function 'DYNP_VALUES_READ'
exporting
dyname = mf_hlp_repid
dynumb = sy-dynnr
tables
&n

在ABAP编程中,为避免用户在输入年月格式的账务期时出错,可以自定义输入帮助。本文介绍了创建选择变量、定义帮助子过程以及设置输入帮助事件的步骤,以实现对SPMON元素的有效支持。
最低0.47元/天 解锁文章

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



