How to get the index of the clicked button on TOOLBARBUTTONCHOICE
I have used toolbarbuttonchoice and created the dropdown list of the buttons dynamically. now when any of the button is clicked i need to get the reference of the button to call appropriate code in the action, but i am unable to get the either the reference or index of the clicked button.
You would call it in the create_choice_item method.
I assume each item calls the same action. Then just transfer an ID or the current loop index to your method.
In the method additionally call:
lr_choice_item->map_on_action( lt_parameters ).
Have a llok at component WDR_TESt_p00009 in V1 in method wddomodifyview.
To fill lt_parameters you would do something like this:
INSERT INITIAL LINE INTO TABLE lt_parameters ASSIGNING <param1>.
<param1>-name = 'ID'.
<param1>-type = 'g'.
<param1>-value = A ID OR AN INDEX
Then in you action BTNCH add the import parameter ID type string or i.
Now you can check out which item has been clicked.