cancel
Showing results for 
Search instead for 
Did you mean: 

Append records from one table to another table

Former Member
0 Kudos

Hi all,

I have two nodes node1 and node2 with same structure.I want to append the elements of node2 to node1.

I dont want to add attribute by attribute as the structure of bot the nodes are same.

Please let me know how to do this.

Thanks and Regards,

Rajesh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Rajesh,

Please crosscheck cardinality of the nodes while using CopyCorresponding statements,otherwise it will throws a error.

Thaks,

Sukalyan

gill367
Active Contributor
0 Kudos

Hello Rajesh,

You can use the function copyelements of WDCopyService it will copy all the elements

WDCopyService.copyElements(<source node>, <target node>
			);

And yeah you need to add WDCopyService in your code by writing the import statement

import com.sap.tc.webdynpro.progmodel.api.WDCopyService;

THanks

Regards,

former_member214651
Active Contributor
0 Kudos

Hi,

Use the following code:


for(int i = 0; i < node1.size(); i++)
{
   node2Element = wdContext().createAndAddnode2Element();
   WDCopyService.copyCorresponding(wdContext().nodenode1().getNode1ElementAt(i), node2Element);
}

Regards,

Poojith MV

Former Member
0 Kudos

Hi ,

make use of the WDCopyService .

[WDCopyService|http://help.sap.com/javadocs/NW04S/SPS09/wd/com/sap/tc/webdynpro/progmodel/api/WDCopyService.html]

above link will help to know about it.

regards,

ramesh