Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Tool Bar event

Former Member
0 Likes
860

Hi Gurus,

Am developing a report in OOPS. Double click event is working fine. But tool bar event is not triggering.

Here my class declaration is

METHODS : handle_double_click

for EVENT double_click of CL_GUI_ALV_GRID

IMPORTING E_ROW E_COLUMN,

handle_tool_bar for event toolbar of cl_gui_alv_grid

importing e_object e_interactive,

user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

and i used set handler like

SET HANDLER EVENT_HANDLER->handle_double_click for grid.

SET HANDLER EVENT_HANDLER->handle_tool_bar for grid.

SET HANDLER EVENT_HANDLER->user_command FOR GRID.

In handle_tool_bar method I written the code

DATA : ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 0 TO ls_toolbar-butn_type.

MOVE 'DISPLAY' TO ls_toolbar-function.

MOVE space TO ls_toolbar-disabled.

MOVE 'DISPLAY' TO ls_toolbar-text.

MOVE icon_change_text TO ls_toolbar-icon.

MOVE 'Click2Display' TO ls_toolbar-quickinfo.

APPEND ls_toolbar TO e_object->mt_toolbar.

But this button is not coming in tool bar?

Any suggesions?

Points will be awarded

Thanks

SC

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
826

Hi,

Have you set the toolbar as interactive? Only then you can add user defined functions to it.

Regards,

Nithya

Hi Gurus,

Am developing a report in OOPS. Double click event is working fine. But tool bar event is not triggering.

Here my class declaration is

METHODS : handle_double_click

for EVENT double_click of CL_GUI_ALV_GRID

IMPORTING E_ROW E_COLUMN,

handle_tool_bar for event toolbar of cl_gui_alv_grid

importing e_object e_interactive,

user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

and i used set handler like

SET HANDLER EVENT_HANDLER->handle_double_click for grid.

SET HANDLER EVENT_HANDLER->handle_tool_bar for grid.

SET HANDLER EVENT_HANDLER->user_command FOR GRID.

In handle_tool_bar method I written the code

DATA : ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 0 TO ls_toolbar-butn_type.

MOVE 'DISPLAY' TO ls_toolbar-function.

MOVE space TO ls_toolbar-disabled.

MOVE 'DISPLAY' TO ls_toolbar-text.

MOVE icon_change_text TO ls_toolbar-icon.

MOVE 'Click2Display' TO ls_toolbar-quickinfo.

APPEND ls_toolbar TO e_object->mt_toolbar.

But this button is not coming in tool bar?

Any suggesions?

Points will be awarded

Thanks

SC

6 REPLIES 6
Read only

Former Member
0 Likes
827

Hi,

Have you set the toolbar as interactive? Only then you can add user defined functions to it.

Regards,

Nithya

Read only

0 Likes
826

Hi Nithya,

Thanks for your reply. How to set the toolbar as interactive?

Thanks

SC

Read only

0 Likes
826

there is a method set_toolbar_interactive in cl_guid_alv_grid. Use that to set the property. Then your button will get added.

Read only

0 Likes
826

HI Nithya,

I used that method but the button is not displaying?

Thanks

SC

Read only

0 Likes
826

Hi Nithya,

Thanks for your valuable suggestion. I used that method before adding the button. Now I used that method after adding the button. It is coming in the toolbar. Thanks once again.

Regards

SC

Read only

Former Member
0 Likes
826

Hi,

check this program , u may get some idea.

<b>BCALV_GRID_05</b>.

Reward Points if it is Useful.

Thanks,

Manjunath MS