Initiate the 'AT selection-screen' EVENT from a checkbox

In-order for the checkbox selection process to initiate the 'AT selection-screen' event you simply need to add the 'USER-COMMAND' option to the parameter declaration. See the ABAP code below to see how this is done. You can also just copy the code into an new ABAP program and execute it to see how it works.

The example below simply uses this functionality to make all the other checkboxes display only once the user selects one of the checkbox.


*Code used to Initiate the 'AT selection-screen' EVENT from radiobuttons.
REPORT  CHECKBOX_EXAMPLE.
DATA: gd_ucomm type sy-ucomm.
PARAMETERS: p_check1 AS CHECKBOX USER-COMMAND check1,
            p_check2 AS CHECKBOX USER-COMMAND check1.
************************************************************************
*AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
  gd_ucomm = sy-ucomm.
************************************************************************
*AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
  case 'X'.
    when p_check1.
      loop at screen.
        if screen-name CS 'P_CHECK1'.
          screen-input = 1.
        else.
          screen-input = 0.
        endif.
        modify screen.
      endloop.
    when p_check2.
      loop at screen.
        if screen-name CS 'P_CHECK2'.
          screen-input = 1.
        else.
          screen-input = 0.
        endif.
        modify screen.
      endloop.
  endcase.

Also see:
Deselect other checkboxes on selection
Initiate AT selection-screen from RADIOBUTTON
Initiate AT selection-screen from LISTBOX dropdown
<--Report selection screen main menu


Related Articles

Adding buttons to an ABAP report selection screen within SAP
Add buttons to Application toolbar of selection screen
Add buttons with icon to selection screen
Add buttons to dynamically change the selection screen entry fields
ABAP parameter as checkbox plus initiate 'AT selection-screen' EVENT to unselect other checkboxes
Dynamically alter a selection screen based on user
SAP dropdown list box for an ABAP report selection screen
Initiate the 'AT selection-screen' EVENT from a LISTBOX within an ABAP report sel screen
ABAP Radiobutton to Initiate the 'AT selection-screen' EVENT on SAP report
ABAP Begin of Block to group selection-screen fields plus add title and frame
Report Selection Screen - Example code and information on various sel screen processing techniques
Selection screen push buttons
F4 search help manually called from report selection screen
Modify Selection Screen(LOOP AT SCREEN)
Restrict select-options to only allow specific restrictions
Radiobutton (inc desc) and entry field on same line of SAP selection screen
Add blank line to SAP report selection screen
Add Tab strip to Selection Screen