SAP SELECTION-SCREEN PUSHBUTTON ABAP Statements
Get Example source ABAP code based on a different SAP table
• MODIF ID SELECTION-SCREEN PUSHBUTTON
• PUSHBUTTON SELECTION-SCREEN
SELECTION-SCREEN>, PUSHBUTTON> Short Reference >
ABAP_SYNTAX
SELECTION-SCREEN PUSHBUTTON $[/$]$[pos$|POS_LOW$|POS_HIGH$](len) button_text>
USER-COMMAND fcode>
$[VISIBLE LENGTH vlen$]
$[ MODIF ID modid>$]
$[ldb_additions>$].>
ABAP Addition
1 ... $[/$]$[pos$|POS_LOW$|POS_HIGH$](len)>
2 ... USER-COMMAND fcode>
3 ... VISIBLE LENGTH vlen>
What does it do?
This statement creates a pushbutton> on the current selection screen>. The text on the pushbutton is determined by the content of button_text>. The rules that apply to text> in the addition COMMENT>> also apply to button_text>. The addition MODIF ID>> assigns the pushbutton to the modification group> modid>.
The ldb_additions>> can only be used in the selection include of a logical database>.
Latest notes:
The function module ICON_CREATE>> can be used to assign an icon, a tooltip>, and a text to a pushbutton. The length len> of a pushbutton for the internal display of the icon must be set to a sufficient length and the visible length must be modified using VISIBLE LENGTH>.
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.
ABAP_HINT_END
• / SELECTION-SCREEN PUSHBUTTON
• POS_LOW SELECTION-SCREEN PUSHBUTTON
• POS_HIGH SELECTION-SCREEN PUSHBUTTON
ABAP Addition
What does it do?
The position of the pushbutton must be specified using this addition. The syntax and meaning are the same as when creating horizontal lines>, although in this case len> defines the length of the pushbutton in the dynpro of the selection screen>. If a pushbutton extends beyond position 83 or a block> with a frame, it is truncated on the right.
• USER-COMMAND SELECTION-SCREEN PUSHBUTTON
ABAP Addition
What does it do?
If the addition USER-COMMAND> is specified, the pushbutton must be assigned a function code fcode>. The function code fcode> must be specified directly and can only contain a maximum of 20 characters.
To enable the pushbutton, the statement TABLES>> must be used to declare an interface work area> of the structure SSCRFIELDS >> from the ABAP Dictionary.
If the user selects the pushbutton on the selection screen, the runtime framework raises the event AT SELECTION-SCREEN>> and the function code fcode> is passed to the component ucomm> in the interface work area sscrfields>.
Latest notes:
If the function code of a pushbutton corresponds to a function code used in the GUI status of the selection screen, the selection screen processing> is affected accordingly.
It is not recommended that the system field sy-ucomm> is evaluated instead of sscrfields-ucomm>, since this does not guarantee that sy-ucomm> is always given the correct value in selection screen processing>.
ABAP_HINT_END
• VISIBLE LENGTH SELECTION-SCREEN PUSHBUTTON
ABAP Addition
What does it do?
The addition VISIBLE LENGTH> defines the visible length vlen > of the pushbutton and its text. The syntax and meaning of this addition are the same as when creating output fields>, although a pushbutton is never displayed shorter than the text defined for it.
Example ABAP Coding
Defines and accesses a standalone selection screen> 500> with two pushbuttons in an executable program. An icon and a tooltip are created for the second pushbutton.
ABEXA 00579
ABAP_EXAMPLE_END
Return to menu