简体   繁体   中英

at selection-screen output VS on radiobutton group

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM