cancel
Showing results for 
Search instead for 
Did you mean: 

Access a child node data

former_member307359
Participant
0 Kudos

Hi experts,

Now to get data from Node 3.

    ------Node 1 (Cardinality [0...N])

              ------Node 2 (Cardinality [1...1])

                            ------Node 3 (Cardinality [0...N])

Accepted Solutions (1)

Accepted Solutions (1)

former_member198833
Active Participant
0 Kudos

Hi Vimal,

Try this:

* Data declaration

  DATA lo_nd_node1 TYPE REF TO if_wd_context_node.

  DATA lo_nd_node2 TYPE REF TO if_wd_context_node.

  DATA lo_nd_node3 TYPE REF TO if_wd_context_node.


* Declare internal table of type Node3

  DATA lt_node3_table TYPE wd_this->Elements_node3name.


* Navigate from CONTEXT to child node NODE1

  lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1name ).


* Navigate from NODE1 to child node NODE2

  lo_nd_node2 = lo_nd_node1->get_child_node( name = wd_this->wdctx_node2name ).


* Navigate from NODE2 to child node NODE3

  lo_nd_node3 = lo_nd_node2->get_child_node( name = wd_this->wdctx_node3name ).


* Get contents of NODE3 into internal table

  lo_nd_node3->get_stattic_attributes_table( IMPORTING Table = lt_node3_table ).


Regards,

Felipe

former_member307359
Participant
0 Kudos

Thanks for your reply Felip

Szczerbowski
Active Participant
0 Kudos

It is better to chain call, so you don't need that many intermediary variables:

lr_node  = wd_context->get_child_node( )->get_child_node( )->get_child_node( ).

former_member198833
Active Participant
0 Kudos

That's a lot easier.

Thank you for the suggestion, Michal!

Answers (0)