Designing Toolbars

Implementing Your Own Functions in the Toolbar

You can add your own functions to the toolbar. To do this, you add a button to the toolbar and link it to a function code. If this pushbutton is clicked, event FUNCTION_SELECTED is triggered, which can then be processed in the application.

Interface Method
IF_SALV_GUI_TOOLBAR_IDA add_button
Interface Event
IF_SALV_GUI_TOOLBAR_IDA function_selected
Example report for an in-container display: SALV_IDA_TOOLBAR_FUNCTION

Hiding Specific ALV Functions in the Toolbar

In order to make space in the toolbar, you can select ALV functions and hide them here only. The functions will still be available in the context menu and settings dialog box.
Interface Method
IF_SALV_GUI_TOOLBAR_IDA
  • hide_all_standard_functions
  • set_visibility_std_functions

Example report for an in-container display: SALV_IDA_TOOLBAR_FUNCTION_DEL

Displaying the List Box with Available Layouts

In addition to the icons already available, a dropdown menu to select available layouts can be displayed in the ALV toolbar.

Interface Method
IF_SALV_GUI_TOOLBAR_IDA enable_listbox_for_layouts

To display the list box is in the ALV toolbar an SAP Basis release of at least SAP NetWeaver 7.4 SP07 must be installed. The SAP Basis release is checked internally: If the release is too old, the technical prerequisite is not met, and the list box is not displayed in the ALV toolbar. An explicit error message is not issued, and the layout handling functions will still work.

Examples of reports: SALV_IDA_LAYOUT_PERSISTENCE und SALV_IDA_LAYOUT_LISTBOX_FS.