Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to get the index of the clicked button on TOOLBARBUTTONCHOICE

Hello Experts,

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.

Please help.



Former Member
Former Member replied

Hi Kinshuk.

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:


<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.

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question