大家好,有个问题想请教大家,请看下面的程序代码,
REPORT ytest.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
TYPE-POOLS vrm.
DATA: fname TYPE vrm_id,
vva TYPE vrm_values,
lvva LIKE LINE OF vva.
CALL SCREEN 200.
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
MODULE status_0200 OUTPUT.
SET PF-STATUS 'YTEST'.
SET TITLEBAR 'xxx'.
fname = 'dropdown'.
lvva-key = '1'.
lvva-text = 'guangzhou'.
APPEND lvva TO vva.
CLEAR lvva.
fname = 'dropdown'.
lvva-key = '2'.
lvva-text = 'shanghai'.
APPEND lvva TO vva.
CLEAR lvva.
fname = 'dropdown'.
lvva-key = '3'.
lvva-text = 'chengdu'.
APPEND lvva TO vva.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = fname
values = vva.
IF sy-subrc <> 0.
ENDIF.
ENDMODULE. " STATUS_0200 OUTPUT
----
MODULE cancel INPUT
----
*
----
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE. "cancel INPUT
----
MODULE user_command_0200 INPUT
----
*
----
MODULE user_command_0200 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'exit'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
问题1:当运行这段程序时,下拉菜单默认值为空,该怎么让默认值为第一个值呢?
问题2:当选择了一个值之后,回车。继续查看下拉菜单是发现下拉选项里面的值又增加了一倍,原来的值又在下面继续添加了,这该怎么解决呢?本人新手,问题比较菜,还请各位赐教,谢谢
Edited by: forrest.liu on May 31, 2009 4:34 AM
Edited by: forrest.liu on May 31, 2009 5:41 AM