cancel
Showing results for 
Search instead for 
Did you mean: 

how to read the current selected row of a table

Former Member
0 Kudos

what is the code to read the current selected value of a field from a table UI element? I have an event handler method called ONACTIONSELECT for the onLeadSelect event of the table UI element. I need the code for this method.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Tiberiu,

http://help.sap.com/saphelp_nw04s/helpdata/en/66/18b44145143831e10000000a155106/frameset.htm

CONTEXT_ELEMENT

CONTEXT_ELEMENT is of type IF_WD_CONTEXT_ELEMENT, which directly contains the pointer to the context element in question. This is the context element of the dataSource of a table or multipane, for which the event has been triggered:

○ If the element is located in a Table, the context element is the element from the row in which the action was triggered (vertical coordinate).

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Hi Maksim - do you have a sample code for that?

former_member182372
Active Contributor
0 Kudos

shwetars
Advisor
Advisor
0 Kudos

Hi,

Sample code:

note: wdevent is the importing parameter of your event handler.

assume: node_name = TABLE and viewName = test_view

data: elem_table type ref to if_wd_context_element,

stru_elem_table type if_test_view=>element_TABLE.

elem_table = wdevent->get_context_element( ).

elem_table->get_static_attributes( static_attributes = stru_elem_table ).

Regards,

Shweta

Answers (0)