Show TOC

Checkboxes and Radio Buttons with Function CodesLocate this document in the navigation structure

Use

As on screens, where you can define checkboxes and radio buttons with function codes, you can do the same with checkboxes and radio buttons on selection screens. You do this using the USER-COMMAND addition when you declare the relevant parameters:

PARAMETERS ... AS CHECKBOX | RADIOBUTTON GROUP ... USER-COMMAND fcode.

You can assign an individual function code fcode to an individual checkbox. However, a radio button group must have one shared function code, since it is only possible to make the assignment for the first button in the group.

When you select a checkbox or radio button in a group, the runtime environment triggers the AT SELECTION-SCREEN event and places the function code fcode into the component ucomm of the interface work area sscrfields . You must use the TABLES statement to declare the sscrfields structure in the ABAP program.

After the AT SELECTION-SCREEN event has been processed, the system displays the selection screen again. The only way to exit the selection screen and continue processing the program is to choose Execute ( F8 ). Consequently, checkboxes and radio buttons with function codes are more suitable for controlling dynamic modifications on a selection screen than for controlling the program flow.


REPORT demo_sel_screen_user_command.
TABLES sscrfields.
PARAMETERS: rad1 RADIOBUTTON GROUP rad USER-COMMAND radio,
            rad2 RADIOBUTTON GROUP rad,
            rad3 RADIOBUTTON GROUP rad.
PARAMETERS  check AS CHECKBOX USER-COMMAND check.
AT SELECTION-SCREEN.
  MESSAGE i888(sabapdocu) WITH text-001 sscrfields-ucomm.
START-OF-SELECTION.
  WRITE text-002.



         

In this program, two different function codes are assigned to a radio button group and a checkbox.