cancel
Showing results for 
Search instead for 
Did you mean: 

Identify selected row by LinkToAction

Former Member
0 Kudos

Hi,

i have a table element with several lines. One column is a LinkToAction. If the user presses on it, the WDA needs to jump into a new view passing a parameter to the outbound plug.

The parameter is in another column in the table (this column is hidden).

how can i identify in which row the user pressed on the LinkToAction? the only thing I need would be the index of the row. I could then read the context, determine the exporting parameter for the outbound plug and fire to it.

Thanks for your help!

Hendrik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Hendrick ,

You can use the WDEVENT ( Importing parameter of Action Handler mehtod) .

You can get the context element by calling the method as follows :

wdevent->get_context_element( 'CONTEXT_ELEMENT').

this will retrun you the row in which user has pressed link to action .

Hope this will help you .

Regards

Vivek

PS: Please provide the points if answer is helpful .

Former Member
0 Kudos

Hello Vivek,

thanks for you fast response!

I think I was a little bit confused. I need to apply your coding to the event of the LinkToAction?

I thought that this will only provide the name and value of the LinkToAction-Element and not the table row.

The thing is. I dont want to make any row "selectable" in the table due to the layout requirements. Furthermore I want to hide the table key because its only for internal purposes. I want to apply the LinkToAction on the description, because this is the only think the user can judge about. then I need to determine the hidden table key of the row on which the used executed the LinkToAction.

So is your coding really to be applied to the LinkToAction or on any table event?

Sorry for this additional answer. Normally I simply try out an answer like yours, but my view and logic is not complete yet.

Could you give me some additional help?

Thanks,

Hendrik

Former Member
0 Kudos

Hendrik,

As Vivek said you need to write this code on the ActionHandler of LinkToAction

data: lr_element type ref to if_wd_context_element,

lv_index type i.

lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

CALL METHOD lr_element->get_attribute

EXPORTING

name = 'MATNR' " Give the name of your hidden column in here

IMPORTING

value = lv_matnr. " Your column value would get saved into this variable

add this lv_mantr to your url and invoke that on the click of LinkToAction

for reference check this thread

https://forums.sdn.sap.com/click.jspa?searchID=19318964&messageID=6336039

Thanks

Bala Duvvuri

arjun_thakur
Active Contributor
0 Kudos

hi,

pls refer to this thread:

https://forums.sdn.sap.com/click.jspa?searchID=19324709&messageID=6334339

i hope it helps.

regards

arjun

Edited by: arjun on Dec 1, 2008 10:26 AM

Former Member
0 Kudos

Thanks you very much for your answers, folks.

I really appreciate this forum and your help!

Answers (0)