下拉框赋值——Table Control
前言:给给SAP系统前台某增强界面Table Control下拉框赋自定义值,利用函数VRM_SET_VALUES实现。
案例:在 TABLE CONTROL 中给加油类型自定义下拉框字段设置值。
效果如下:
实现步骤:
1.在增强屏幕逻辑流PBO中添加MODULE:drop_down_list
PROCESS BEFORE OUTPUT.
...
MODULE drop_down_list.
2.实现MODULE:drop_down_list:
*&---------------------------------------------------------------------*
*& Module DROP_DOWN_LIST OUTPUT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
MODULE drop_down_list OUTPUT.
TYPE-POOLS vrm.
DATA :name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
DATA:lt_ztpm002 TYPE TABLE OF ztpm002 WITH HEADER LINE.
SELECT * INTO TABLE lt_ztpm002 FROM ztpm002.
name = 'ZTPM001-ZJYLX'. "下拉框的屏幕名称"
REFRESH list.
LOOP AT lt_ztpm002. "下拉框的值"
value-key = lt_ztpm002-zjylx.
value-text = lt_ztpm002-zjylxms.
APPEND value TO list.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
ENDMODULE.
觉得博主的文章对你有帮助的,动动鼠标一键三连,激励博主写出更多精彩文章!