on 10-09-2009 11:59 AM
Hi,
I have a question to all experts.
My situation is the following:
I have a node NODEMAIN. This node has 3 attributes and a sub node SUBNODE, which has another 3 attributes.
I know have a function, which is returning one table with the 3 attributes for the NODEMAIN and a nested table with the
information for SUBNODE.
How can I know fill my node and subnode with this information in the easiest way? Do I have to fill at first the NODEMAIN and
loop that node to fill the SUBNODE?
What is the cardinality that you have set for both the nodes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the supply function-
http://help.sap.com/saphelp_nwmobile71/helpdata/en/f1/177741adb7167de10000000a155106/content.htm
Regards,
Lekha.
Supply function will load on demand, which can be really good if you have a lot of records in the parent table and will rarely access all the children.
On the other hand you can preload all the children by looping through an element list of the parent node. Here is an example:
****Loop Through all the Items
data element_set type wdr_context_element_set.
field-symbols <wa_set> like line of element_set.
field-symbols <wa_item> type sdemo_so_item_all.
data l_tabix type sytabix.
element_set = lo_nd_sales_items->get_elements( ).
loop at element_set assigning <wa_set>.
l_tabix = sy-tabix.
read table <wa_so>-t_item assigning <wa_item> index l_tabix.
*****Load WDCTX_SCHEDULE_LINES
data lo_nd_schedule_lines type ref to if_wd_context_node.
data lt_schedule_lines type wd_this->elements_schedule_lines.
lo_nd_schedule_lines = <wa_set>->get_child_node( name = if_componentcontroller=>wdctx_schedule_lines ).
lt_schedule_lines = <wa_item>-t_sl.
lo_nd_schedule_lines->bind_table( new_items = lt_schedule_lines set_initial_elements = abap_true ).
endloop.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.