Skip to Content

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

ABAP Web Dynpro - get the selected table values

Hello,

I'm new at Abap Web Dynpro and I try to get some information of an ALV when I click on a button. In my layout view I have a ViewContainerUIElement where I the ALV is implemented. Under this element I have a button that should read the selected data row in the ALV.

I tried this to get the data:

CHANGING is my ALV-tab.

DATA: context_element type ref to if_wd_context_element, 
      context_data    type ref to if_wd_context_node.

context_element = wdevent->get_context_element( 'CHANGING' ).
context_data    = wdevent->get_context_element( 'CHANGING' ).


*then call the get_index method..
context_element->get_index( ).
context_data->get_selected_elements( ).

When I test the Web Dynpro in IE it does not work.

Can anybody helps me?

Regards, Markus

Former Member
Former Member replied

Hi Markus

here Appr is node in context of my code.

In your case the node is 'changing'. i forgot to change that.

if you see under the attributes tab wd_this ref to If_<Viewname>.

and if you click on If_<Viewname> you will see system generated code where each node in context is declared like Element_<node>

so code will be like this .

data:

Node_Appr type ref to If_Wd_Context_Node,

Elem_Appr type ref to If_Wd_Context_Element,

Stru_Appr type Wd_This->Element_changing .

Node_Appr = wd_Context->get_Child_Node('CHANGING' ).

Elem_Appr = Node_Appr->get_Element( ).

Elem_Appr->get_Static_Attributes(

importing

Static_Attributes = Stru_Appr ).

Regards

Naresh

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question