Hi Everybody,
When you add abuttonto the containerwe use thisstructure.
*----------------------------------------------------------------------*
* CLASS lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
DATA: wa_toolbar TYPE stb_button,
utilities TYPE REF TO cl_gui_frontend_services.
METHODS : toolbar_handle FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object
e_interactive,
menu_bt_handle FOR EVENT menu_button OF cl_gui_alv_grid
IMPORTING e_object
e_ucomm,
ucomm_handle FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
ENDCLASS. "lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_event_handler IMPLEMENTATION.
METHOD toolbar_handle.
MOVE 3 TO wa_toolbar-butn_type.
APPEND wa_toolbar TO e_object->mt_toolbar.
MOVE : 2 TO wa_toolbar-butn_type,
'$MENU' TO wa_toolbar-function,
'@6C@' TO wa_toolbar-icon,
'User menu' TO wa_toolbar-quickinfo.
APPEND wa_toolbar TO e_object->mt_toolbar.
ENDMETHOD. "toolbar_handle
METHOD menu_bt_handle .
IF e_ucomm = '$MENU'.
CALL METHOD e_object->add_function
EXPORTING
fcode = 'CALC'
text = 'Calculator'.
CALL METHOD e_object->add_function
EXPORTING
fcode = 'INT'
text = 'Internet Explorer'.
ENDIF.
ENDMETHOD. "menu_bt_handle
METHOD ucomm_handle.
CASE e_ucomm.
WHEN 'CALC'.
IF utilities IS INITIAL.
CREATE OBJECT utilities.
ENDIF.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = 'CALC'.
WHEN 'INT'.
IF utilities IS INITIAL.
CREATE OBJECT utilities.
ENDIF.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = 'IEXPLORE'.
ENDCASE.
ENDMETHOD. "ucomm_handle
ENDCLASS. "lcl_event_handler IMPLEMENTATION
-------------------------------------
We usethismenuto add.
-------------------------------------
MOVE 3 TO wa_toolbar-butn_type.
APPEND wa_toolbar TO e_object->mt_toolbar.
MOVE : 2 TO wa_toolbar-butn_type,
'$MENU' TO wa_toolbar-function,
'@6C@' TO wa_toolbar-icon,
'User menu' TO wa_toolbar-quickinfo.
To addthebutton, sohow do we handleit that way?
And alsowherecodesof these icons?
For example,
'@6C@' : User İcon
Howmanyof themicons ?
The printericonor PDFicon.
Best Regards Rasimm...