cancel
Showing results for 
Search instead for 
Did you mean: 

how to change the text of a button in ALV dynamically?

Former Member
0 Kudos

Hi Gurus,

I have a ALV with a button in the toolbar.Basically i have to change the button text each time the button is pressed.

How can i do this?

PS:points will be awarded

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

On your alv model, first call if_salv_wd_function_settings~get_function( ID = <your ID> ). This will return you a reference of cl_salv_wd_function. If your function uses a button editor, do the following:

data:

lr_button type ref to CL_SALV_WD_FE_BUTTON,

lr_function type ref to cl_salv_wd_function.

lr_function = l_alv_model->if_salv_wd_function_settings~get_function( ID = <your ID> ).

lr_button ?= lr_function->get_editor( ).

lr_button->set_text( ).

I have not tried this, but it should work.

Regards

Nithya

Former Member
0 Kudos

hi Nithya,

Thanks for the speedy response.It works fine.

Former Member
0 Kudos

Hi,

Could you please explain what is the ID('Your ID' ) to be passed here. What this ID refers to? Actually in my scenario i have to change the Export button text in ALV table. Please let me know how to do this.

Regards,

Sarathy.

former_member199125
Active Contributor
0 Kudos

Here I'd means function I'd for each ui element in alvtoolbar. Using salv_wd_function wecan place custom buttons or any ui elements in alv toolbar . Export button is standard button , for that am not surehow to change that text. But above procedure is for custom alv tool bar functionalities

Answers (0)