04-01-2009 10:33 PM
Hello Experts,
I want to add a button to the ALV status(not main status).I am using following code inside my method
Local data
DATA: LS_TOOLBAR TYPE STB_BUTTON.
append a separator to normal toolbar
CLEAR LS_TOOLBAR.
MOVE 3 TO LS_TOOLBAR-BUTN_TYPE.
APPEND LS_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
append an icon to show legend
CLEAR LS_TOOLBAR.
MOVE 'LEGE' TO LS_TOOLBAR-FUNCTION.
MOVE ICON_DETAIL TO LS_TOOLBAR-ICON.
MOVE 'Show Legend' TO LS_TOOLBAR-QUICKINFO.
MOVE 'Legend' TO LS_TOOLBAR-TEXT.
MOVE ' ' TO LS_TOOLBAR-DISABLED.
APPEND ls_toolbar TO e_object->mt_toolbar.
Also I am registering the event using
SET HANDLER CUST_EVENT_RECEIVER->HANDLE_TOOLBAR FOR CUST_GRID.
And to raise event toolbar I am calling method
CALL METHOD CUST_GRID->set_toolbar_interactive.
When I do a syntax check it is saying
"The field 'MT_TOOLBAR' is unknown,but there is a field with the similar name 'M_HEIGHT_TOOLBAR'"
I even looked at the program BCALV_GRID_05 to check for errors.
Can anyone please tell me why this is happening and how to correct this error?
Thanks
Sandeep
04-01-2009 10:42 PM
Hi,
Please make sure you are using the correct event ..in the class definition..
METHODS:
handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object e_interactive,
Thanks
Naren
04-01-2009 10:44 PM
04-01-2009 10:46 PM
Hi,
Did you define this method in class definition.
methods:
handle_toolbar
for event toolbar of cl_gui_alv_grid
importing e_object e_interactive,
Refer to this linik...[User defined buttons in ALV |https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/userdefinedbuttonsinALV]
04-02-2009 4:57 AM
04-02-2009 5:57 AM
Hi,
Declare:-
DATA : e_object TYPE REF TO cl_alv_event_toolbar_set,
io_alv_toolbar TYPE REF TO cl_alv_event_toolbar_set.
Thanks & Regards,
Ruchi Tiwari