Skip to Content
-2

User Defined Toolbar buuton text needs to be changed at runtime

Apr 20, 2017 at 09:47 AM

58

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.

Regards,

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?

0

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

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

2 Answers

Raymond Giuseppi
Apr 20, 2017 at 10:18 AM
-1

Did you look at sample program BCALV_GRID_05?

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

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.

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?

Regards,

Ashutosh Vikram

0

Try to call it again after refreshing the ALV

0