SAP SELECTION-SCREEN FUNCTIONKEY ABAP Statements
Get Example source ABAP code based on a different SAP table
• FUNCTION KEY SELECTION-SCREEN
SELECTION-SCREEN>, FUNCTION KEY> Short Reference >
ABAP_SYNTAX
SELECTION-SCREEN FUNCTION KEY n $[ ldb_additions>$].>
What does it do?
In the GUI status of the selection screen> set by the system, the application toolbar> contains five inactive pushbuttons>, to which the function codes FC01> to FC05> are assigned. This statement activates the pushbutton of the function code FC0n>, where a value between 1 and 5 must be specified for n>.
To enable use of the pushbuttons, the statement TABLES>> can be used to declare an interface work area> of the structure SSCRFIELDS>> from the ABAP Dictionary.
If a text is assigned to the component functxt_0n> of the interface area sscrfields> before the selection screen is called, this text is displayed on the corresponding pushbutton. Otherwise, the pushbutton does not contain any text.
When the user chooses a pushbutton in the application toolbar, the runtime framework raises the event AT SELECTION-SCREEN>> and the associated function code is passed to the component ucomm> of the interface work area sscrfields>.
The ldb_additions>> can only be used in the selection include of a logical database>.
Latest notes:
To assign icons, a tooltip>, and appropriate text to the pushbuttons, a data object of the structured type SMP_DYNTXT> can be defined in the ABAP Dictionary. The ID of the icon, a tooltip, and the associated text must be assigned to the components of this data object. The content of the entire structure must then be assigned to the component functxt_0n> of the interface work area sscrfields>.
Once the event block in AT SELECTION-SCREEN> has been processed, the system usually returns to displaying the selection screen. To exit selection screen processing> and continue executing the program, either Execute> or Cancel> must be chosen. This means pushbuttons on selection screens are intended primarily for use for dynamic modifications to the selection screen rather than to control the program.
If the content of the component ucomm> is set to a function code used in the GUI status during selection screen processing, the selection screen processing> is modified accordingly.
It is not recommended that the system field sy-ucomm> instead of sscrfields-ucomm> is evaluated, since this does not guarantee that sy-ucomm> is always given the correct value in selection screen processing>.
ABAP_HINT_END
ABAP_EXAMPLE_ABEXA
Selection Screens, Pushbuttons in the Application Toolbar>
ABAP_EXAMPLE_END
Return to menu