下面介绍在选择画面中创建下拉列表(list box),
语法
1 |
PARAMETER xxx AS LISTBOX VISIBLE LENGTH vlen [USER-COMMAND fcode] |
然后用函数VRM_SET_VALUES向下拉列表中添加值。
代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
REPORT ztest_listbox. TYPE-POOLS: vrm . DATA:git_function TYPE vrm_values, gwa_function LIKE LINE OF git_function. PARAMETERS: p_fun TYPE char5 AS LISTBOX VISIBLE LENGTH 10. *&---------------------------------------------------------------------* *&初始化 *&---------------------------------------------------------------------* INITIALIZATION. PERFORM frm_fill_function. *&---------------------------------------------------------------------* *& Form FRM_FILL_FUNCTION *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM frm_fill_function . REFRESH:git_function. gwa_function-key = '1'. "个就是变量下拉框的值 gwa_function-text = 'ABAP'. "这个是text APPEND gwa_function TO git_function. gwa_function-key = '2'. "个就是变量下拉框的值 gwa_function-text = 'BASIS'. "这个是text APPEND gwa_function TO git_function. gwa_function-key = '3'. "个就是变量下拉框的值 gwa_function-text = 'SD'. "这个是text APPEND gwa_function TO git_function. gwa_function-key = '4'. "个就是变量下拉框的值 gwa_function-text = 'MM'. "这个是text APPEND gwa_function TO git_function. "调用函数显示listbox里面的值 CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = 'P_FUN' values = git_function. ENDFORM. |
运行结果:
以上。
发表评论