Search This Blog

Wednesday, June 8, 2011

LOOP AT SCREEN Statement | Modify Selection Screen at Run Time

Sample Code for modifying selection screen at user command :


PARAMETERS : CBOX AS CHECKBOX USER-COMMAND ACT DEFAULT ' ',
                            EBELN LIKE EKKO-EBELN MODIF ID R1.

 PARAMETERS: BLACK(10) MODIF ID A,
                            BLACK2(5) MODIF ID A,
                            WHITE1(2) MODIF ID B.

PARAMETERS: C RADIOBUTTON GROUP RAD1 USER-COMMAND ACT DEFAULT 'X',
                           D RADIOBUTTON GROUP RAD1.


AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.

IF CBOX = 'X'.
IF SCREEN-GROUP1 = 'R1'.
SCREEN-INPUT = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

LOOP AT SCREEN.
IF C = 'X'.
IF SCREEN-GROUP1 = 'B'.
SCREEN-INPUT = 0 .
ENDIF.
ELSEIF D = 'X'.
IF SCREEN-GROUP1 = 'A'.
SCREEN-INPUT = 0.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.