cancel
Showing results for 
Search instead for 
Did you mean: 

wdcopyservice

Former Member
0 Kudos

hi

i have model called IT_XXX and

and i have a value node calles IT_YY

and i have created all the context attributes of the

model similarly in the valuenode

now i want to copy value node in to model node

but when i write

WDCOPYService(wdcontext.nodeIT_XX,wdcontext.nodeIt_yy)

and in the next step i have called the RFC mode

its showing error for the wdcopyservice as

wdcopyservice is not application for view .

scenario as soon as soon i click the button table should get populate

can any one help me ?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi

You have model node right. Click that model and from the properties note the structure.

Then destination node right click and select structure binding and select the structure that you had previously noted. So that all the attributes will be created under the destination node with the same name and data type.

Now in coding part wdCopyService.copyElements((IWDNode)<Model Node>,(IWDNode)<DestinatiuonNode>)

Regards

Chandran S

Former Member
0 Kudos

Hi,

while making use of copy service,you need to make sure of following things:

1. Structure of model node and value nodeis exactly same.

2. Attribute name in model node and value node is same.

3. CopySercvice is used as:

wdCopyService.copyElements(model node,data node);

4. Copy service is used only after executing the RFC.

5. Moreover copy service has one morelimitation.It can copy elements from model node to value node.Reverse is not possible.

regards,

amit bagati

Former Member
0 Kudos

Hi Kishore,

If the cardinality of the nodes is 0..n, use the following code :

for(int i=0; i<wdContext.nodeIT_XXX().size(); i++)

WDCopyService.copyCorresponding

(wdContext.nodeIT_YY().getIT_YYElementAt(i), wdContext.nodeIT_XXX).getIT_XXXElementAt(i));

If the cardinality of the nodes are 1..1, use the following code :

WDCopyService.copyCorresponding(wdContext.currentIT_YYElement(), wdContext.currentIT_XXXElement());

Regards,

Sayan Ghosh

Edited by: sayan ghosh on May 16, 2008 4:47 PM

Former Member
0 Kudos

Hi,

Its not the way you have written. Its like this:

WDCopyService.copySubtree(sourceNode, destNode);

Please do organize imports if it does not recognize the WDCopyService.

Please check the docs for other methods of the WDCopyService.

Hope this helps.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi Kishore,

The method WDCopyService.copyElements copies only those attributes from "source" which are present in "target" and if they match (the names equal case-sensitive and the types are compatible).

and your contexts nodes have the same sets of attributes.

Thanks n Regards,

Jhansi Miryala