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:

  1. For finding out the program whose GUI status ...

Get SAP ABAP Advanced Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.