cancel
Showing results for 
Search instead for 
Did you mean: 

Method GET_ELEMENTS( ) is returning only 1 element

Former Member
0 Kudos

'

Hi,

I am using the method GET_ELEMENTS( ) and returning it to table type WDR_CONTEXT_ELEMENT_SET but even if there is more than 1 element in the node, it only returns 1 element.

Below is part of my code.

I could not figure out what I am doing wrong.

I have also tried using GET_METHOD() without parameters but that doesn't work either. It only returns 1 element.

Need your help.

Thanks.

Giscard

DATA:

lv_node_name TYPE string,

DATA:

lo_nd_dynamic TYPE REF TO if_wd_context_node,

lo_el_dynamic TYPE REF TO if_wd_context_element,

lt_el_dynamic TYPE WDR_CONTEXT_ELEMENT_SET.

DATA:

lv_el_count TYPE i.

lo_nd_dynamic = wd_context->get_child_node( name = lv_node_name ).

lv_el_count = lo_nd_dynamic->get_element_count( ).

lt_el_dynamic = wd_context->get_elements( from = 1 to = lv_el_count ).

LOOP AT lt_el_dynamic INTO lo_el_dynamic.

ENDLOOP.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

Found out what was wrong.

Should be:

lt_el_dynamic = lo_nd_dynamic->get_elements( from = 1 to = lv_el_count ).

Sorry about that...

Thanks...