on 08-18-2014 12:56 PM
Hi all,
I am trying to create multiple buttons in Webdynpro ALV toolbar, please go through the code.
What happening is, second button is replacing the first one.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv_table( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv_table( ).
DATA lv_value TYPE REF TO cl_salv_wd_config_table.
lv_value = lo_interfacecontroller->get_model(
).
DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
DATA lr_buttonui2 TYPE REF TO cl_salv_wd_fe_button.
DATA button1 TYPE REF TO cl_salv_wd_function.
DATA button2 TYPE REF TO cl_salv_wd_function.
**First button
CREATE OBJECT lr_buttonui1.
lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
button1->set_editor( lr_buttonui1 ).
**Second button
CREATE OBJECT lr_buttonui2.
lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
button2->set_editor( lr_buttonui2 ).
How can I overcome this??
Thanks
Eshwar
What happening is, second button is replacing the first one.
What do you mean by the above statement? Is it both the buttons Button1,Button2 triggering same actions?.
It is because of this.
button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON')."creating the function for alv button
button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON' )."creating the function for alv button
For both the buttons, you've given same action id. Try giving different actions then it might solve your issue.
Pls revert for further queries.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank y'all
Thanks
Eshwar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eshwar,
Hope you already got the required answers.
As suggested, you need to use unique ids for each button.
Example: btn_print, btn_submit
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eshwar,
The button Ids are same for both the buttons in your code. You need to change it as BUTTON1, BUTTON2.
**First button
CREATE OBJECT lr_buttonui1.
lr_buttonui1->set_text('Button')."setting the text of the button on alv toolbar
button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON1')."creating the function for alv button
button1->set_editor( lr_buttonui1 ).
**Second button
CREATE OBJECT lr_buttonui2.
lr_buttonui2->set_text('Button1')."setting the text of the button on alv toolbar
button2 = lv_value->if_salv_wd_function_settings~create_function( id = 'BUTTON2' )."creating the function for alv button
button2->set_editor( lr_buttonui2 ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.