cancel
Showing results for 
Search instead for 
Did you mean: 

How to data from selected row of a TABLE

Former Member
0 Kudos

Hi ,

I have a table displaying some PO order details. In the last column , I have a field with element Link to Action . My requirement is , that when I click on the link to action column of specific row , I want to get the data present( specifically the the data present on the first column which is PO number) i that specific row.

How can i get this data?

Regards

PG

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi PG,

The onAction event of link to action UI element has a paramater CONTEXT_ELEMENT

which holds the reference of the element on which action has been performed.

Use that paramater to read all the attributes of the context node...(which will give you the PO number) of the selected row.

Thanks,

Aditya.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Thanks to all.

Regards

PG

Former Member
0 Kudos

Hi PG,

If you want to get Selected row data, you can use get_selected_elements

Try this example code.. this gives you selected records into one table..

DATA lo_nd_et_postab_1 TYPE REF TO if_wd_context_node.

DATA lo_el_et_postab_1 TYPE REF TO if_wd_context_element.

DATA ls_et_postab_1 TYPE wd_this->Element_et_postab_1.

DATA lt_et_postab_1 TYPE wd_this->Elements_et_postab_1.

DATA: wa_temp TYPE REF TO if_wd_context_element,

lt_temp TYPE wdr_context_element_set.

  • navigate from <CONTEXT> to <ET_POSTAB_1> via lead selection

lo_nd_et_postab_1 = wd_context->path_get_node( path = `ZSHP_EXTENDED_DUE_LI.CHANGING_3.ET_POSTAB_1` ).

CALL METHOD lo_nd_et_postab_1->get_selected_elements

RECEIVING

set = lt_temp.

LOOP AT lt_temp INTO wa_temp.

CALL METHOD wa_temp->get_static_attributes

IMPORTING

static_attributes = ls_et_postab_1.

append ls_et_postab_1 to lt_et_postab_1.

CLEAR ls_et_postab_1.

ENDLOOP.

lo_nd_et_postab_1->bind_table( new_items = lt_et_postab_1 ).

NOW LT_ET_POSTAB_1 Contains selected records in table.

Hope it helps...

Cheers,

Kris.

former_member389677
Active Participant
0 Kudos

Hi,

You will get the index by method 'GET_INDEX' of the parameter CONTEXT_ELEMENT (type IF_WD_CONTEXT_ELEMENT) of the event method parameter . I hope u have already created the Event method for the UI element LinkToAction

Regards

Shaira.

Madhu2004
Active Contributor
0 Kudos

Hi,

Whenever you click on the UI element i.e. link to action you create a method.

This method has WDEVENT has importing parameter.

This WDEVENT have a parameter called CONTEXT_ELEMENT( Of type IF_WD_CONTEXT_ELEMENT).

Use GET_STATIC_ATTRIBUTES of this paramer to get that complete row values.

Regards,

Madhu