资 源 简 介
No more LOOP AT SCREEN
To handle selection screens using "LOOP AT SCREEN" statement can be very boring and it consumes some time when developing and maintaining such logic. If you work on complicated screens the screens logic become opacity.
Imagine that you have selection screen with two radio buttons and two input fields. When the first radio button is selected, the first input field is open for input only. When the second radio button is selected, the second input field is open for input only. How would you match this result by old way?
```
PARAMETERS: xopt1 RADIOBUTTON GROUP opt USER-COMMAND option_selected.
PARAMETERS: p_carrid TYPE scarr-carrid.
PARAMETERS: xopt2 RADIOBUTTON GROUP opt DEFAULT "X".
SELECT-OPTIONS: scarrid FOR pcarrid.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
CASE screen-name.
WHEN "P_CARRID".
IF xopt1 = "X".
screen-input = 1.
ELSE.
screen-input = 0.
ENDIF.
WHEN "S_CARRID-LOW".