Below is the code snippet to hide certain selection input or screen using radio button technique.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-101.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 4(30) text-rb1.
SELECTION-SCREEN POSITION 2.
PARAMETERS: r1 RADIOBUTTON GROUP rg1 USER-COMMAND rb_com DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 4(30) text-rb2.
SELECTION-SCREEN POSITION 2.
PARAMETERS: r2 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK qsel
WITH FRAME TITLE text-s02.
SELECT-OPTIONS sp$00006 FOR lfm1-ekorg MEMORY ID eko MODIF ID sel.
SELECT-OPTIONS sp$00001 FOR lfb1-bukrs MEMORY ID buk MODIF ID sel.
SELECT-OPTIONS sp$00003 FOR lfa1-erdat MODIF ID sel.
SELECT-OPTIONS sp$00004 FOR lfa1-ernam MODIF ID sel.
SELECT-OPTIONS sp$00005 FOR lfa1-ktokk MEMORY ID kgk MODIF ID sel.
SELECT-OPTIONS sp$00002 FOR lfb1-lifnr MEMORY ID lif MODIF ID sel.
SELECTION-SCREEN END OF BLOCK qsel.
SELECTION-SCREEN BEGIN OF BLOCK stdsel WITH FRAME TITLE text-s03.
PARAMETERS %layout TYPE slis_vari MODIF ID lay.
SELECTION-SCREEN END OF BLOCK stdsel.
" To hide the the selection screen AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'SEL' AND r2 EQ 'X'.
screen-active = '0'.
MODIFY SCREEN.
CONTINUE.
ELSEIF screen-group1 = 'LAY' AND r2 EQ 'X'.
screen-active = '0'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 4(30) text-rb1.
SELECTION-SCREEN POSITION 2.
PARAMETERS: r1 RADIOBUTTON GROUP rg1 USER-COMMAND rb_com DEFAULT 'X'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 4(30) text-rb2.
SELECTION-SCREEN POSITION 2.
PARAMETERS: r2 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK qsel
WITH FRAME TITLE text-s02.
SELECT-OPTIONS sp$00006 FOR lfm1-ekorg MEMORY ID eko MODIF ID sel.
SELECT-OPTIONS sp$00001 FOR lfb1-bukrs MEMORY ID buk MODIF ID sel.
SELECT-OPTIONS sp$00003 FOR lfa1-erdat MODIF ID sel.
SELECT-OPTIONS sp$00004 FOR lfa1-ernam MODIF ID sel.
SELECT-OPTIONS sp$00005 FOR lfa1-ktokk MEMORY ID kgk MODIF ID sel.
SELECT-OPTIONS sp$00002 FOR lfb1-lifnr MEMORY ID lif MODIF ID sel.
SELECTION-SCREEN END OF BLOCK qsel.
SELECTION-SCREEN BEGIN OF BLOCK stdsel WITH FRAME TITLE text-s03.
PARAMETERS %layout TYPE slis_vari MODIF ID lay.
SELECTION-SCREEN END OF BLOCK stdsel.
" To hide the the selection screen AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'SEL' AND r2 EQ 'X'.
screen-active = '0'.
MODIFY SCREEN.
CONTINUE.
ELSEIF screen-group1 = 'LAY' AND r2 EQ 'X'.
screen-active = '0'.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDLOOP.
p/s need to put user-command at the radio button default else it wont work automatically.
No comments:
Post a Comment