1.创建一个屏幕,自定义输入框
2.代码:
设置窗口屏幕坐标:http://www.baidusap.com/abap/dialog/6038
report ztest3. data:xlk type string, save_ok type sy-ucomm, ok_code type sy-ucomm. call screen 100 starting at 8 5 ending at 50 10. "设置屏幕坐标 *&---------------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* MODULE STATUS_0100 OUTPUT. SET PF-STATUS 'STATUS1'. "创建GUI 回车键ENTRY * SET TITLEBAR 'xxx'. TYPE-POOLS vrm. data :name type vrm_id value 'XLK', "屏幕上绑定的下拉框也是这个名字 list type vrm_values, value like line of list. REFRESH list. Value-key = '键1'. Value-text = '值1'. APPEND value TO list. Value-key = '键2'. Value-text = '值2'. APPEND value TO list. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = Name values = list. ENDMODULE. *&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE USER_COMMAND_0100 INPUT. clear save_ok. save_ok = ok_code. clear ok_code. CASE save_ok. WHEN 'KEY_VALUE'. WHEN 'YES' or 'ENTRY'. LEAVE PROGRAM. WHEN 'NO'. LEAVE PROGRAM. WHEN OTHERS. LEAVE PROGRAM. ENDCASE. ENDMODULE.
3.结果