cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Webdynpro Linktoaction in table

Former Member
0 Kudos

Hi,

In my webdynro view i have a table with some fields as linktoaction.

In the context for table following attributes are set:

Initialize Lead Selection = 'X'

Singleton = 'X'

How can I get the row where the linktoaction is clicked on in the corresponding methods.

I added following code but in stru_sales_order i always get the data of index 1.

DATA:

node_z_dws_get_salesorder TYPE REF TO if_wd_context_node.

DATA:

node_changing TYPE REF TO if_wd_context_node.

DATA:

node_e_sales_orders TYPE REF TO if_wd_context_node.

DATA:

stru_sales_order TYPE ig_componentcontroller=>element_e_sales_orders.

node_z_dws_get_salesorder = wd_context->get_child_node( `Z_DWS_GET_SALESORDER` ).

node_changing = node_z_dws_get_salesorder->get_child_node( `CHANGING` ).

node_e_sales_orders = node_changing->get_child_node( `E_SALES_ORDERS` ).

node_e_sales_orders->get_static_attributes(

IMPORTING static_attributes = stru_sales_order ).

Kind regards,

Vincent.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Vincent,

There is a standard parameter CONTEXT_ELEMENT, which contains the pointer to the row. Just add it as a parameter of the action handler's method as


  CONTEXT_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT

Best regards,

Thomas

Answers (2)

Answers (2)

Former Member
0 Kudos

hi vincnt

i got the same problem ,

pl send the code , if u got it th ecod

thanks

setu

sap_cohort
Active Contributor
0 Kudos

I see that this thread is old, but can someone help add some detail to the solution for this?

Thanks!

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

As described already in the thread, there is a standard parameter on the event handler called CONTEXT_ELEMENT. This will provide you with an object reference to the source context element that triggered the action. You need only add the parameter to the event handler method.

sap_cohort
Active Contributor
0 Kudos

OK I have no idea what you said since I am new to this WDA, but I did get someone to help with this.

I had to change the table configuration to selectionMode Single and create an event for onLeadSelect.

in the onLeadSelect code I have the following:

LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'PARKED_TRANSACTIONS' ).

LR_ELEMENT = LR_NODE->GET_LEAD_SELECTION( ).

Thanks for the help all!

Former Member
0 Kudos

Hi,

You should get the index of the row at leadSelection.


data: node_elem type ref to IF_WD_CONTEXT_ELEMENT.

node_elem = node_e_sales_orders->get_lead_selection().

Regards,

Satyajit.

Former Member
0 Kudos

I have the same issue. get_lead_selection( ) always returns the selected row and not the one I clicked on.

thomas_szcs
Active Contributor
0 Kudos

Hi Ingo,

Don't use get_lead_Selection( ). Of course, it will return the row with the leadSelection. Use the predefined parameter CONTEXT_ELEMENET. You can access it by defining it as a parameter to the action handler.

Best regards,

Thomas