1、拖入一个编辑控件到屏幕,设置“下拉”属性为“ListBox”
2、设置Function-CODE,
3、listbox的列表的取值有三种方法:
A)默认取Dictionary;
B)使用“VRM_SET_VALUES"函数在PBO中设置 ,代码见后面代码
C)使用Process On Value-request事件和“F4IF_INT_Table_Value_request”函数设置输入帮助
其中C优于B,B优于A
代码示例:(参见SAP的样例程序,rsdemo_dropdown_list)
*屏幕事件
process before output.
module status_0100.
module fill_carrid.
*
process after input.
module event_from_listbox.
module exit at exit-command.
process on value-request.
field sflight-carrid module set_data_carrid.
*程序
report rsdemo_dropdown_listbox .
data init.
tables scarr.
tables spfli.
tables sflight.
tables sbook.
data save_ok like sy-ucomm.
data ok_code like sy-ucomm.
call screen 100.
*&---------------------------------------------------------------------*
*&