ABAP代码:下拉列表框
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS S_ID(3) TYPE C DEFAULT ''
AS LISTBOX VISIBLE LENGTH 35.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_ID.
PERFORM SELECT_S_ID_FOR_LIST.
FORM SELECT_S_ID_FOR_LIST.
NAME = 'S_ID'.
VALUE-KEY = 'A01'.
VALUE-TEXT = '类型A01'.
APPEND VALUE TO LIST.
VALUE-KEY = 'A02'.
VALUE-TEXT = '类型A02'.
APPEND VALUE TO LIST.
..........
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.
ENDFORM. " SELECT_S_ID_FOR_LIST
补充说明:
1.下拉框中的选项可以入示例那样固定,也可从表中获取后用循环动态添加,这不是什么问题
2.目前没有找到一个方法捕获下拉框中值变化这一事件,从而,无法做到当下拉框的值变化时,
其他控件里的值相应发生变化。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xiaoysh/archive/2007/07/18/1696958.aspx