We can Hide parameter / select option in selection screen dynamically by manipulating screen object.
SCREEN
is like an internal table with a header line. However, you do not have
to declare it in your program. Go to debugging mode and then view
structure of screen.
You can modify SCREEN in your ABAP program
during the PBO event of a screen. Its contents override the static
attributes of the screen fields for a single screen call. The only
statements that you can use with SCREEN are:
LOOP AT SCREEN.
...
MODIFY SCREEN.
...
ENDLOOP.
We can hide parameter by set screen-active to 0.
Here is example of how to hide parameter in selection screen. Write it, and change click on radiobutton to hide parameter.
REPORT ZAALGAL0006.
DATA: d_ucomm LIKE sy-ucomm.
PARAMETERS: p_grpa1(10) MODIF ID A,
p_grpa2(5) MODIF ID A,
p_grpb1(2) MODIF ID B.
PARAMETERS: p_actA RADIOBUTTON GROUP rad1 USER-COMMAND ACT DEFAULT 'X',
p_actB RADIOBUTTON GROUP rad1.
AT SELECTION-SCREEN.
d_ucomm = sy-ucomm.
AT SELECTION-SCREEN OUTPUT.
LOOP AT screen.
IF p_actA = 'X'.
IF screen-group1 = 'B'.
screen-active = 0.
ENDIF.
ELSEIF p_actB = 'X'.
IF screen-group1 = 'A'.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY screen.
ENDLOOP.
START-OF-SELECTION.
Serkan AKKAVAK
Computer Engineer
SAP Department Deputy Manager
Contact : serkurumsal@yandex.com
Social Plugin