cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in ABAP Mapping

Chandra_Hota
Participant
0 Kudos

Hi All

I am using ABAP mapping.

After getting children of the root node, i create an iterator by the following statements:

node_collection = root_node->get_children( ).

node_iterator = node_collection->create_iterator( ).

Now, In a loop, i want to get all the children in sequence. So, in the loop i am writing this statement:

child = node_iterator->get_next( ).

For the first iteration in the loop, 'child' gets the first child. But, for the second iteration, the 'child' value is becoming NULL.

Am i doing anything wrong? How can i fix this?

Thanks

Chandra

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chandra,

you should first check the existence of the node in something like:

lo_xml_iterator = lo_xml_node_coll->create_iterator( ).
lo_xml_node = lo_xml_iterator->get_next( ).

while not lo_xml_node is initial.
  lo_xml_node = lo_xml_iterator->get_next( ).
endwhile.

Regards,

Sergio