Using the SAP Toolbar Control

Use

This section explains the general process for using an SAP Toolbar control.

Prerequisites

You should already be familiar with the basic concepts of ABAP Objects and with SAP Container controls.

Process

  1. Create a reference variable for the toolbar instance (with reference to the class CL_GUI_TOOLBAR) and any relevant data structures:

    Data Structure

    Description

    Used in

    TTB_BUTTON

    An internal table, each line of which describes a button in the toolbar

    add_button_group

    TTB_BTNMNU

    An internal table, each line of which contains the name of a menu button and the name of the context menu assigned to it.

    assign_static_ctxmenu_table

  2. Create an event handler class for the events of the toolbar.

  3. Create the toolbar instance, fill the button table with the buttons you want to use, and assign them to the toolbar.

  4. If you want to use static context menus for menu buttons, create and fill the context menus, then assign them to the relevant buttons.

  5. Register the events with the Control Framework and as ABAP Objects events.