Application Development 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: 

User Defined Toolbar buuton text needs to be changed at runtime

0 Kudos

Dear Gurus,

I am adding a custom button on toolbar of ALV (CL_GUI_ALV_GRID).

My requirement is based on some condition at runtime I need to change the text of this button.

I search SCN but did not get any helpful answer.

Please help.

Regards,

Ashutosh Vikram

6 REPLIES 6

raymond_giuseppi
Active Contributor
0 Kudos

Did you look at sample program BCALV_GRID_05?

former_member400468
Active Participant
0 Kudos

Hi!

You need to call method SET_TOOLBAR_INTERACTIVE of CL_GUI_ALV_GRID, it will trigger again TOOLBAR event. And you can change your buttons texts in the handler method.

Evgeny.

0 Kudos

Hi Gubenko,

Actually i tried calling method SET_TOOLBAR_INTERACTIVE and changed the text but after my code method REFRESH_TABLE_DISPLAY is called and all the change reverted to default text which i have given to button while creating it.

In my requirement based on the function code of this button i am changing ALV data so REFRESH_TABLE_DISPLAY is being called.

What to do to retain the changed text?

Regards,

Ashutosh Vikram

0 Kudos

Try to call it again after refreshing the ALV

Sandra_Rossi
Active Contributor
0 Kudos

How do you add your custom button to the toolbar, via event toolbar of cl_gui_alv_grid, or other way?

0 Kudos

Hi Sandra,

I added the button through event 'toolbar' of CL_GUI_ALV_GRID only.

My requirement is on trigger of function code of this button i need to change few fields of ALV as well as text of this button also accordingly.

But after the call of REFRESH_TABLE_DISPLAY the changed text of button is getting reset.

Please suggest.

Regards,

Ashutosh Vikram