Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Selection Screens →  Create Selection Screens →  SELECTION-SCREEN →  SELECTION-SCREEN - screen_elements →  SELECTION-SCREEN - FUNCTION KEY 

Selection Screens - Pushbuttons in Application Toolbar

This example demonstrates the activation of pushbuttons in the application toolbar of the GUI status.

Other versions: 7.31 | 7.40 | 7.54

Source Code

REPORT demo_sel_screen_function_key.

TABLES sscrfields.

SELECTION-SCREEN BEGIN OF SCREEN 1100.
PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit.
SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.
SELECTION-SCREEN END OF SCREEN 1100.

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
      WHEN'FC01'.
      p_carrid = 'LH'.
      p_cityfr = 'Frankfurt'.
    WHEN 'FC02'.
      p_carrid = 'UA'.
      p_cityfr = 'Chicago'.
  ENDCASE.

CLASS start DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS main.
ENDCLASS.

CLASS start IMPLEMENTATION.
  METHOD main.

    sscrfields-functxt_01 = 'LH'.
    sscrfields-functxt_02 = 'UA'.

    CALL SELECTION-SCREEN 1100 STARTING AT 10 10.

  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  start=>main( ).

Description

An independent selection screen with the screen number 1100 is defined with two parameters. In the application toolbar, two pushbuttons are activated using FUNCTION KEY and supplied with the texts "LH" and "UA".

When the user clicks on a button, the AT SELECTION-SCREEN event is triggered. The input fields are filled correspondingly with default values.