ABAP Program to Add Toolbar to Selection-Screen

0
573

This tutorial shows the sample code to insert Toolbar at the Selection-Screen and there handling, when user interacts with them. It is a nice code to look at for a beginner.

 

Custom Toolbar
Custom Toolbar

REPORT ZTEST_TOOLBAR.
TABLES: sscrfields.
* Specify the buttons
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
INITIALIZATION.
* Add Text to buttons
sscrfields-functxt_01 = ‘Custom Button1’.
sscrfields-functxt_02 = ‘Custom Button2’.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETERS: vbeln LIKE vbak-vbeln.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
* Handling the button event
  IF sy-ucomm EQ ‘FC01’.
    PERFORM toolbar_test.
  ENDIF.
  IF sy-ucomm EQ ‘FC02’.
    PERFORM toolbar_test.
  ENDIF.

LEAVE A REPLY

Please enter your comment!
Please enter your name here