Skip to Content
0
Former Member
Apr 01, 2009 at 09:33 PM

Adding a push button in OO ALV Grid

3925 Views

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