on 06-26-2008 7:17 PM
Hi Gurus,
Can some one give me sample code to copy data from one context node to another in Webdynpro ABAP?? I need this very urgnetly?
Thanks,
Hari
Not really all that difficult. I have a working sample, so you will have to adjust for your context structure/names. You would start by reading all the data from the source context:
data lo_nd_contacts type ref to if_wd_context_node.
data lo_el_contacts type ref to if_wd_context_element.
data ls_contacts type wd_this->element_contacts.
* navigate from <MEETING> to <CONTACTS> via lead selection
lo_nd_contacts = lo_nd_meeting->get_child_node( name = wd_this->wdctx_contacts ).
* @TODO handle not set lead selection
if lo_nd_contacts is initial.
else.
data l_contacts type standard table of zpm_cust_mt_ct.
lo_nd_contacts->get_static_attributes_table( importing table = l_contacts ).
endif.
So now you have all the data from the source context back into a normal ABAP internal table - l_contacts.
Do the context nodes have the same structure? If so you could just bind this internal table directly into the second context node (destination). Otherwise you probably want to build a new ABAP internal table and loop through the source copying the data selectively (MOVE-CORRESPONDING maybe) to the second internal table.
data lo_nd_pm_contacts2 type ref to if_wd_context_node.
* navigate from <CONTEXT> to <PM_CONTACTS2> via lead selection
lo_nd_pm_contacts2 = wd_context->get_child_node( name = wd_this->wdctx_pm_contacts2 ).
lo_nd_pm_contacts2->bind_table( l_contacts ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.