Reputation: 925
I'm writting a report in which I have two radiobuttons of the group 'tab'. Depending on their value, I must set some screen fields to no-display, else, display them correctly.
I can make it work perfectly by using the event at selection-screen output.
, but it refuses to work when using at selection-screen on radiobutton group tab
-to test one, I comment out the other.
The code in both is exactly the same, so could someone help me understand the difference in the two events so I get why only one works?
events below, only the second one works.
at selection-screen on radiobutton group tab.
go_controller->modify_screen( ).
at selection-screen output.
go_controller->modify_screen( ).
They both call the same method
method modify_screen.
loop at screen.
case screen-group1.
when 'TAB'.
if use_otab = abap_false.
screen-invisible = 1.
screen-active = 0.
screen-input = 0.
p_int = abap_false.
p_nat = abap_false.
free p_table[].
else.
screen-active = 1.
screen-invisible = 0.
screen-input = 1.
endif.
modify screen.
endcase.
endloop.
endmethod.
Via debug, I see that both of the events are reached correctly, nevertheless, only the second one works.
Upvotes: 0
Views: 2099
Reputation: 2738
Because it is designed like this: AT SELECTION-SCREEN ON...
is a "process after input" (PAI) event. PAI is designed to react on user actions. At the end of PAI, the next dynpro is determined (even if it may be the same as the actual), and then the "process before output" (PBO) of the dynpro is processed. This is the preparation of the screen elements for the user. Only in PBO, the modification of the SCREEN
table has an influence on the visibility or editability of the screen elements.
So, in reporting you are supposed to use at selection-screen output.
to influence the visibility or editability of the parameters and select-options.
Upvotes: 2