Add buttons to Application toolbar of selection screen

The following code demonstrates how to add user defined push buttons to the application toolbar of a standard report selection screen.


*&----------------------------------------------------------*
*& Report  ZSSCRAPPBUT                                      *
*&                                                          *
*&----------------------------------------------------------*
*&  Adds buttons to application toolbar of selection screen.*
*&----------------------------------------------------------*
REPORT  zsscrappbut NO STANDARD PAGE HEADING.
TABLES: t030, skat, sscrfields.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
                                     TITLE text-001.
SELECT-OPTIONS: p_ktopl FOR t030-ktopl,
                p_komok FOR t030-komok,
                p_ktosl FOR t030-ktosl.
SELECTION-SCREEN SKIP.
* Add button to application toolbar
SELECTION-SCREEN FUNCTION KEY 1.  "Will have a function code of 'FC01'
SELECTION-SCREEN FUNCTION KEY 2.  "Will have a function code of 'FC02'
*                                                                 .....
SELECTION-SCREEN END OF BLOCK block1.
************************************************************************
*INITIALIZATION.
INITIALIZATION.
* Add displayed text string to buttons
MOVE 'Application button' to SSCRFIELDS-FUNCTXT_01.
MOVE 'Excecute report ????' to SSCRFIELDS-FUNCTXT_02.
*                                                 .....
************************************************************************
*AT SELECTION-SCREEN.
AT SELECTION-SCREEN.
if sscrfields-ucomm = 'FC01'.
  break-point.
elseif sscrfields-ucomm = 'FC02'.
  break-point.
endif.

Related Articles

Adding buttons to an ABAP report selection screen within SAP
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
Initiate the 'AT selection-screen' EVENT from a checkbox
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