Code: Alles auswählen.
CLASS lcl_service DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING
e_object
e_interactive,
handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING
e_ucomm
sender.
ENDCLASS. "lcl_service DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_service IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_service IMPLEMENTATION.
METHOD handle_toolbar.
DATA button TYPE stb_button.
CLEAR button.
button-function = 'CREATE'.
button-quickinfo = 'Hinzufügen'.
button-butn_type = 2.
button-disabled = ' '.
button-text = 'Benutzergruppe Hinzufügen'.
APPEND button TO e_object->mt_toolbar.
ENDMETHOD.
* Methode um Auf das ereignis des ALV Button
* zu reagieren
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'CREATE'.
BREAK-POINT.
ENDCASE.
ENDMETHOD.
ENDCLASS.
Code: Alles auswählen.
CREATE OBJECT lr_service.
SET HANDLER lr_service->handle_user_command FOR 1022_go_alv.
SET HANDLER lr_service->handle_toolbar FOR 1022_go_alv.
1022_go_alv->set_toolbar_interactive( ).
Code: Alles auswählen.
button-butn_type = 2.
Code: Alles auswählen.
button-butn_type = 0.
Folgende Benutzer bedankten sich beim Autor black_adept für den Beitrag:
JohnLocklay