SELECTION-SCREEN XXX. SELECTION-SCREEN BEGIN OF BLOCK XXX WITH FRAME TITLE t1. "选择屏幕块 PARAMETERS: p_carrid TYPE s_carr_id, p_cityfr TYPE s_from_cit. SELECTION-SCREEN SKIP. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN PUSHBUTTON 7(20) but1 USER-COMMAND search. " 定义搜索按钮 SELECTION-SCREEN END OF LINE. SELECTION-SCREEN END OF BLOCK b1. INITIALIZATION. t1 = '输入栏名称'. "but1 = '按键'. CALL FUNCTION 'ICON_CREATE' " 给按钮添加图标和文本 EXPORTING name = ICON_SEARCH " 按钮的图片的名字 text = '功能名称' "按钮的文本 info = '功能' IMPORTING RESULT = but1 EXCEPTIONS OTHERS = 0.
一条线上
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-002. SELECTION-SCREEN BEGIN OF LINE. PARAMETERS: p_search TYPE c RADIOBUTTON GROUP g1 USER-COMMAND radio DEFAULT 'X'. SELECTION-SCREEN COMMENT (5) text-003 FOR FIELD p_search. SELECTION-SCREEN POSITION 10. PARAMETERS: p_create TYPE zcreate RADIOBUTTON GROUP g1. SELECTION-SCREEN COMMENT (2) text-004 FOR FIELD p_create. SELECTION-SCREEN POSITION 20. PARAMETERS: p_update TYPE c RADIOBUTTON GROUP g1. SELECTION-SCREEN COMMENT (2) text-005 FOR FIELD p_update. SELECTION-SCREEN POSITION 30. PARAMETERS: p_delete TYPE c RADIOBUTTON GROUP g1. SELECTION-SCREEN COMMENT (2) text-006 FOR FIELD p_delete. SELECTION-SCREEN POSITION 50. SELECTION-SCREEN COMMENT (10) text-007 FOR FIELD p_id. PARAMETERS: p_id TYPE zdb_mm_zbqnshj-id. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN END OF BLOCK blk1. INITIALIZATION.
out-put
PARAMETERS P1 RADIOBUTTON GROUP G1 USER-COMMAND UC DEFAULT 'X'. SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text01. PARAMETERS : p_ktext LIKE cskt-ktext MODIF ID ty1,"领料单位 p_aufnr LIKE resb-aufnr MODIF ID ty1."内部订单号 SELECT-OPTIONS: s_rsdat FOR rkpf-rsdat MODIF ID ty1."日期区间 SELECTION-SCREEN END OF BLOCK blk1. PARAMETERS P2 RADIOBUTTON GROUP G1. SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text02. PARAMETERS : p_ktext2 LIKE cskt-ktext MODIF ID ty2,"领料单位 p_kostl LIKE csks-kostl MODIF ID ty2,"成本中心 p_bwart LIKE rkpf-bwart MODIF ID ty2 OBLIGATORY."移动类型 SELECT-OPTIONS: s_rsdat2 FOR rkpf-rsdat MODIF ID ty2." 日期区间 SELECTION-SCREEN END OF BLOCK blk2. AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. CASE screen-group1. WHEN 'TY1'. IF p1 IS INITIAL. screen-INPUT = '0'. ELSE. screen-INPUT = '1'. ENDIF. WHEN 'TY2'. IF p2 IS INITIAL. * SCREEN-REQUIRED = '0'. screen-INPUT = '0'. ELSE. screen-INPUT = '1'. ENDIF. ENDCASE. CLEAR:P_AUFNR, P_ktext ,s_rsdat, P_KOSTL,P_KTEXT2, P_BWART, S_RSDAT2. MODIFY SCREEN. ENDLOOP. AT SELECTION-SCREEN. CLEAR sy-ucomm.
来源:https://www.cnblogs.com/huangjianisgood/archive/2012/11/24/2786286.html