cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Model Node To Value Node

Former Member
0 Kudos

Hi SDN,

I am consuming a WSDL and i am getting model node in the context. Now I am creating a Value Node with the same strucute for the same. Please let me know if the elements including the child node can be copied from source to target node?

If so please explain how to do it?

Regards,

Ganesh N

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ganesh,

Use the follwoing thread to copy the modal node to context node.

U copy the node vaues in the init method so that it copies only once.

Regards

Priya

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ganesh,

WDCopyService.copyElements(IWDNode source ,IWDNode target );

Using the above line will direcly copy all elements fromsource to target but it needs to adhere to 1 rule-->

Same Node structure with same attribute names and so should be the properties of the Node and the attribute within. I mean same cardinality and selction of node and same attribute datatypes.

Regards,

Tushar Sinha

former_member185086
Active Contributor
0 Kudos

Hi

Once data is available in model node (after executing the model) Use following code

WDCopyService.copyElements(IWDNode source ,IWDNode target );

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi,

In most cases, I prefer Context-Mapping. Are you sure you have to use a copy instead of a link/delegate?

If so, look for WDCopyService (http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/WDCopyService.html)

Its a reflection based Copy-Service that assumes that elements of the same type and with the same name are supposed to have equal values, thus it automatically copies all elements from source to dest in one line of code.

Jan