2007 Jan 22 6:32 AM
Hi,
Is there any event which triggers when standard toolbar icon such as insert or append button is clicked. I tried using user_command, MENU_BUTTON, TOOLBAR_BUTTON_CLICK. none of them triggers when standard button is clicked.
Regards
Rakesh
Hi,
Is there any event which triggers when standard toolbar icon such as insert or append button is clicked. I tried using user_command, MENU_BUTTON, TOOLBAR_BUTTON_CLICK. none of them triggers when standard button is clicked.
Regards
Rakesh
2007 Jan 22 6:33 AM
2007 Jan 22 6:43 AM
Hello Rakesh
Have a look at sample report
BCALV_GRID_05
with the following documentation in the header:PROGRAM BCALV_GRID_05.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Purpose:
* ~~~~~~~~
* Demonstrate the creation of an own toolbar button.
*-----------------------------------------------------------------
* To check program behavior
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* The report shows a list of flights of one airline.
* Select one or more lines and press the 'Detail'-Button to popup
* a dialog window with related bookings.
*-------------------------------------------------------------------
* Essential steps (Search for '§')
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 1.Apply steps for event handling for events TOOLBAR and
* USER_COMMAND (see example for print events)
* 2.In event handler method for event TOOLBAR: Append own functions
* by using event parameter E_OBJECT.
* 3.In event handler method for event USER_COMMAND: Query your
* function codes defined in step 2 and react accordingly.
* 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
...The crucial points are:
(1) Define event handler method
* Definition:
* ~~~~~~~~~~~
CLASS lcl_event_receiver 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.
PRIVATE SECTION.
ENDCLASS.
(2) Register event handler method
********
* ->Create Object to receive events and link them to handler methods.
* When the ALV Control raises the event for the specified instance
* the corresponding method is automatically called.
*
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_user_command FOR grid1.
SET HANDLER event_receiver->handle_toolbar FOR grid1.Regards
Uwe
2007 Jan 22 7:03 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |