有时候需要在选择屏幕中加按钮。
效果如下:
其实也很简单。用的是pushbutton
代码如下
参考代码
REPORT ZLM_PUSHPUTTON.TABLES sscrfields.SELECTION-SCREEN: PUSHBUTTON 2(10) but1 USER-COMMAND cli1。 PUSHBUTTON 20(30) but2 USER-COMMAND cli2 VISIBLE LENGTH 10.INITIALIZATION. but1 = ‘预览’. CALL FUNCTION ‘ICON_CREATE’ EXPORTING name = icon_print TEXT = ‘打印’ INFO = ‘liumeng test’* ADD_STDINF = ‘X’ IMPORTING RESULT = but2 EXCEPTIONS ICON_NOT_FOUND = 1 OUTPUTFIELD_TOO_SHORT = 2 OTHERS = 3 . IF sy-subrc <> 0.* Implement suitable error handling here ENDIF. at SELECTION-SCREEN. CASE sscrfields. WHEN ‘CLI1’. WHEN ‘CLI12’. WHEN OTHERS. ENDCASE.