首页 > 代码库 > SAP ABAP编程 DIALOG屏幕中下拉框
SAP ABAP编程 DIALOG屏幕中下拉框
2. 在屏幕的flowlogic里面中的BPO中添加以下语句(例句):
PROCESS BEFORE OUTPUT.
3. 双击listbox_0100来创建该module,输入以下代码(示例代码):
MODULE listbox_0100 OUTPUT.
TYPE-POOLS vrm.
DATA: vid TYPE vrm_id VALUE ‘GW_YS_ITEM-MEINS‘,
vlist TYPE vrm_values,
values LIKE LINE OF vlist.
CLEAR vlist.
CLEAR values.
MOVE ‘H‘ TO values-key.
MOVE ‘小时‘ TO values-text.
APPEND values TO vlist.
CLEAR values.
MOVE ‘D‘ TO values-key.
MOVE ‘吨‘ TO values-text.
APPEND values TO vlist.
CALL FUNCTION ‘VRM_SET_VALUES‘
EXPORTING
id = vid
values = vlist
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ‘下拉框出错,请联系管理员!‘ TYPE ‘I‘ DISPLAY LIKE ‘S‘.
ENDIF.
ENDMODULE.
4.实例效果:
SAP ABAP编程 DIALOG屏幕中下拉框