Skip to Content
0
E M
Apr 17, 2008 at 02:58 PM

Menu Button in ALV toolbar (multiple choices for a button)

6771 Views

Hi abapers,

I would like to have a button with multiple choices in the toolbar;

at the moment I have created a menu button with just one function.

Here is my code:

----


  • CLASS lcl_event_receiver (Definition)

----


CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_toolbar

FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive.

ENDCLASS. "lcl_event_receiver DEFINITION

----


  • CLASS lcl_event_receiver (Implementation)

----


CLASS lcl_event_receiver IMPLEMENTATION.

*

METHOD handle_toolbar.

DATA: ls_toolbar TYPE stb_button.

*Separator

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

*Button

CLEAR ls_toolbar.

MOVE 1 TO ls_toolbar-butn_type.

MOVE 'EDIT' TO ls_toolbar-function.

MOVE icon_change TO ls_toolbar-icon.

MOVE ' Modifica'(l02) TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

MOVE 'Modifica' TO ls_toolbar-quickinfo.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD. "handle_toolbar

ENDCLASS. "lcl_event_receiver IMPLEMENTATION