1.增加status按钮:
DATA: g_textfield LIKE smp_dyntxt. INITIALIZATION. g_textfield-icon_id = ‘@[email protected]‘. g_textfield-icon_text = ‘按钮名‘. g_textfield-quickinfo = ‘鼠标指示‘. sscrfields-functxt_01 = g_textfield. AT SELECTION-SCREEN. CASE sscrfields-ucomm. WHEN ‘FC01‘. " 该user command为系统规定 * WHEN ‘FC02‘. ENDCASE.
2.在选择屏幕上加按钮
SELECTION-SCREEN PUSHBUTTON 1(16) but1 USER-COMMAND downfile. " 定义搜索按钮 INITIALIZATION. CALL FUNCTION ‘ICON_CREATE‘ " 给按钮添加图标和文本 EXPORTING name = ‘ICON_EXPORT‘ " 按钮的图片的名字 ICON_EXPORT text = ‘下载导入模版‘ "按钮的文本 info = ‘下载‘ IMPORTING RESULT = but1 EXCEPTIONS OTHERS = 0. AT SELECTION-SCREEN. CASE sy-ucomm. WHEN ‘DOWNFILE‘. perform XXX STOP. WHEN OTHERS. ENDCASE.
时间: 2024-10-10 13:30:08