on 01-15-2010 12:48 PM
Hi all,
I'm using WDCopyService.copyCorresponding to copy elements from work area to work area then add work area to Node. Please check out Java code below.
I'm trying to move data from nodeZPr_Account to Bapi node by looping nodeZPr_Account into model then using WDCopyService.copyCorresponding to move row values as below.
if(wdContext.nodeZPr_Account().size() > 0){
IPrivateMainView.IZPr_AccountNode acctNode = wdContext.nodeZPr_Account();
IPrivateMainView.IIt_PraccountNode bapiNode = wdContext.nodeIt_Praccount();
Bapimereqaccount acctModel = new Bapimereqaccount();
for(int i=0; i<acctNode.size(); i++){
IPrivateMainView.IZPr_AccountElement acctElem = acctNode.getZPr_AccountElementAt(i);
WDCopyService.copyCorresponding(acctElem,acctModel);
prNode.addIt_Praccount(acctModel);
}
};
Unfortunately, the return table shows the last row of acctNode for example:
acctNode
22222 | 222222 | 22222222 |
55555 | 555555 | 55555555 |
66666 | 666666 | 66666666 |
return table
66666 | 666666 | 66666666 |
66666 | 666666 | 66666666 |
66666 | 666666 | 66666666 |
Please advise me on this. Thanks in advance.
Peerasit
Here is the solution:
if(wdContext.nodeZPr_Account().size() > 0){
IPrivateMainView.IZPr_AccountNode acctNode = wdContext.nodeZPr_Account();
for(int i=0; i<acctNode.size(); i++){
IPrivateMainView.IZPr_AccountElement acctElem = acctNode.getZPr_AccountElementAt(i)
Bapimereqaccount acctModel = new Bapimereqaccount();
WDCopyService.copyCorresponding(acctElem,acctModel);
prNode.addIt_Praccount(acctModel);
}
};
o Move "Bapimereqaccount acctModel = new Bapimereqaccount();" within a loop
: )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is not about WDCopyService.copyCorresponding function.
Btw, i'm finding the solution why it returns duplicated rows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.