Share |

Initiate the 'AT selection-screen' EVENT from radiobuttons on ABAP report


In-order for the Radiobutton selection process to initiate the 'AT selection-screen' event you need to add the 'USER-COMMAND' option to the parameter declaration. See code below.


*Code used to Initiate the 'AT selection-screen' EVENT from radiobuttons.
selection-screen begin of block group with frame title text-s04.
parameters: p_sel1 type c radiobutton group sel user-command upd.
parameters: p_sel2 type c radiobutton group sel.
parameters: p_sel3 type c radiobutton group sel.
selection-screen end of block group.


AT SELECTION-SCREEN
*This event is then triggered when a user selects an option from the LISTBOX
  case sy-ucomm.
    when 'UPD'  "radiobutton selection made
*   add code here to process data
  ENDCASE.


AT SELECTION-SCREEN OUTPUT.
*This event is also trigged to re-draw ABAP report screen so can be used to hide or display fields

  case sy-ucomm.
    when 'UPD' "radiobutton selection made
*     Add code here to modify selection screen i.e. hide or display screen fields 
      LOOP at screen.
        if screen-name cs 'FIELDNAME1'.
*         Use cs to captures all elements of the field inc text
          screen-active = 0.
          modify screen.
        endif.
      ENDLOOP.
  ENDCASE.