on 09-16-2008 12:23 PM
hi experts...
i have two tables names as Table1 and Table2
Table1 has data coming from the backend system.
my requirement is copy the Table1 records into Table2
send me the procedure...
thanks
ramu.
Hi,
if your RFC node is TargetRFC which is bind with the table 1,
and table 2 is bind with SourceValueNode then do like this,
IPrivate<Name>View.ISourceValueNode iSourceValueNode= wdContext.nodeSourceValueNode();
IPrivate<Name>View.ISourceValueElement iSourceValueElement;
IPrivate<Name>View.ITargetRFC Element iTargetRFCElement;
for(int i=0;i<wdContext.nodeTargetRFC().size();i++){
iTargetRFCElement = wdContext.nodeTargetRFC().getTargetRFCElementAt(i);
iSourceValueElement = iSourceValueNode.createSourceValueNodeElement();
iSourceValueElement.set<attribute name>(iTargetRFCElement.get<Attribute name>());
iSourceValueNode.addElement(iSourceValueElement);
iSourceValueNode.moveNext();
}
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
If the structure of node of table1 and table2 are same then use copynode function.
if not then use
public void modeltovalue( com.sap.tc.webdynpro.progmodel.api.IWDNode source, com.sap.tc.webdynpro.progmodel.api.IWDNode target )
{
//@@begin modeltovalue()
/**
* method is reserved for filter use only.
* table and context node used for filtering are filled with data by this method.
*
**/
if (source.size() !=0){
target.invalidate();
for (int i = 0; i < source.size(); i++ ){
IWDNodeElement telem = target.createElement();
target.addElement(telem);
source.moveTo(i);
target.moveTo(i);
IWDNodeElement selem = source.getCurrentElement();
telem.setAttributeValue("attribute_1name",selem.getAttributeValue("attribute_1name"));
telem.setAttributeValue("attribute_2name",selem.getAttributeValue("attribute_2name"));
....
....
...
...
telem.setAttributeValue("attribute_n name",selem.getAttributeValue("attribute_n name"));
}
}
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 following code
WDCopyService.copyElements(source, target);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.