SAP – ABAP – gui – hiding selection components
If you want to make your reports more functional you can start controling the properties of different components based on selections that are performed by the user.
For instance in this post I’ll show you a quick example of how to hide a on-screen component based on user selection.
PARAMETER: cb_a AS CHECKBOX DEFAULT 'X'
USER-COMMAND batch MODIF ID ida,
cb_bAS CHECKBOX DEFAULT 'X'
USER-COMMAND batch MODIF ID idb.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'IDA' AND cb_b NE 'X'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'IDB' AND cb_a NE 'X'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
This example will hide each of the check boxes depending on the selection of the other check-box. If both are selected then both are visible, if one is un-checked then the other is hidden.
The active attribute controls the visibility of a particular screen component. Explicitly: 0 = hidden, 1 = visible.