Skip to Content

User Defined Toolbar buuton text needs to be changed at runtime

Apr 20, 2017 at 09:47 AM


avatar image

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.


Ashutosh Vikram

10 |10000 characters needed characters left characters exceeded

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


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.


Ashutosh Vikram

* Please Login or Register to Answer, Follow or Comment.

2 Answers

Raymond Giuseppi
Apr 20, 2017 at 10:18 AM

Did you look at sample program BCALV_GRID_05?

10 |10000 characters needed characters left characters exceeded
Evgeny Gubenko Apr 20, 2017 at 10:21 AM


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.


Show 2 Share
10 |10000 characters needed characters left characters exceeded

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?


Ashutosh Vikram


Try to call it again after refreshing the ALV