Adding your own buttons to ALV toolbar
The standard ALV toolbar provides a number of useful functions. However, depending on the requirement, you may be asked to add new buttons to the ALV toolbar. This recipe will show how to add your own buttons to the ALV toolbar and then writing appropriate coding to be executed when the user presses the button.
We will add a new button saying View Summary to the toolbar. Upon clicking, the total number of displayed records will be shown (for purpose of illustration).
Getting ready
For creating your own toolbar buttons, we need to make a copy of the GUI status displayed in the original ALV program. We will then make changes to the copied status. Proceed as follows:
For finding out the program whose GUI status is currently being called, generate the output of the ALV program and then select the menu option System | Status.. On the dialog that appears, we will use the values shown in the Program (GUI) and GUI status fields. The GUI status being used is
ALV_TABLE_STANDARD...