Skip to Content

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

regarding selection of row?

Hi All,

I have a table in my view.

i want to select the entire row when i click anywhere on the table.

i am using

event_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ) to get the particular row.but i am getting ' Access via 'NULL' object reference not possible'.

Could anyone pls give me the exact code ..how to proceed for this? where shall i write the code in select event handler or onleadselection event handler method?

Regards,

Lakshmi.

Former Member
replied

Hi,

DATA:lv_outputelement TYPE REF TO if_wd_view_element,

lr_table TYPE REF TO cl_wd_table,

lt_el_userenty TYPE wdr_context_element_set,

lt_el_user TYPE wdr_context_element_set.

DATA lo_nd_userenty TYPE REF TO if_wd_context_node.

DATA lo_el_userenty TYPE REF TO if_wd_context_element.

DATA ls_userenty TYPE wd_this->element_userenty.

DATA lo_el_user TYPE REF TO if_wd_context_element.

clear lt_el_user[].

CASE iv_ui_element_name.

WHEN 'TABLE'.

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

lo_nd_userenty = wd_context->get_child_node( name = wd_this->wdctx_userenty ).

CALL METHOD lo_nd_userenty->get_elements

RECEIVING

set = lt_el_userenty.

lt_el_user = lt_el_userenty.

endcase.

LOOP AT lt_el_user INTO lo_el_user.

CALL METHOD lo_el_user->set_selected

EXPORTING

flag = abap_true.

ENDLOOP.

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