Process documentationDefining GUI Elements in the Toolbar Locate this document in the navigation structure

 

Process

  1. Define an event handler method for event TOOLBAR.

  2. Declare a structure for defining a toolbar element:

    Syntax Syntax

    1. data: ls_toolbar TYPE stb_button.
    End of the code.
  3. For a pushbutton, for example, you would fill the following fields:

    Syntax Syntax

    1. CLEAR ls_toolbar.
      MOVE 0 TO ls_toolbar-butn_type.
      MOVE 'BOOKINGS' TO ls_toolbar-function.
      MOVE icon_employee TO ls_toolbar-icon.
      MOVE 'Show Bookings'(111) TO ls_toolbar-quickinfo.
      MOVE SPACE TO ls_toolbar-disabled.
    End of the code.

    Note Note

    In the butn_type field, you specify the type of the GUI element for the ALV Grid Control. For possible values, see the value range of domain TB_BTYPE.

    End of the note.
  4. Use event parameter E_OBJECT to append the new definition to table mt_toolbar:

    Syntax Syntax

    1. APPEND ls_toolbar TO e_object->mt_toolbar.
    End of the code.
  5. If you want to define additional elements, go back to step 3.

  6. Call method set_toolbar_interactive, if you want to rebuild the toolbar.

Result

In the event handler method of event USER_COMMAND, you can query the function code you specified in field function to implement the associated function.

Note Note

See also report BCALV_GRID_05 in development class SLIS.

End of the note.