选择屏幕下拉框

Posted on 2023-05-25 23:16  Chris的博客  阅读(6)  评论(0编辑  收藏  举报
***定义一个内表用于存储下拉框数据,该表含有两个字段,key 和text
DATA: list  TYPE vrm_values.
 
*选择屏幕
PARAMETERS s_lsbox TYPE mara-matkl  AS LISTBOX VISIBLE LENGTH 10 DEFAULT ' '.
*此事件后释放list
AT SELECTION-SCREEN OUTPUT.
REFRESH list.
 
 "给下拉框取数
 SELECT DISTINCT matkl AS key FROM mara INTO TABLE list UP TO 10 ROWS.
**调用下拉框赋值函数
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = 'S_LSBOX'
      values = list.