on 11-19-2012 5:47 PM
Hi there,
My Environment: I'm working with SAP NetWeaver CE v7.1 (NWDS 7.1) and Web Dynro for Java on Windows.
Now my Question: Everytime when I start with execution of an existing RFC function, I have the same node element multiple.
My Coding:
public void executeZ_Eedm_Rfc_Quant( java.lang.String ivChange ) {
//@@begin executeZ_Eedm_Rfc_Quant()
String processId = wdThis.wdGetProfilebandManagementController().wdGetContext().currentAppCtxElement().getAppctx().getProcessId();
wdContext.currentZ_Eedm_Rfc_Quant_InputElement().setIv_Item_Guid(processId);
wdContext.currentZ_Eedm_Rfc_Quant_InputElement().setIv_Change(ivChange);
try {
wdContext.currentZ_Eedm_Rfc_Quant_InputElement().modelObject()
.execute();
wdContext.nodeZ_Eedm_Rfc_Quant_Input().nodeOutput_3().invalidate();
} catch (ARFC2ModelExecuteException e) {
String message = wdContext.nodeZ_Eedm_Rfc_Quant_Input()
.nodeOutput_3().nodeEt_Return_1()
.currentEt_Return_1Element().getMessage();
wdComponentAPI.getMessageManager().reportException(
"Exception: " + e.getMessage() + ". Message: " + message);
}
IOutput_3Node outputNode3 = wdContext.nodeZ_Eedm_Rfc_Quant_Input().nodeOutput_3();
ICt_Quanthead_1Node quanthead_1Node = outputNode3.nodeCt_Quanthead_1();
ICt_Quanthead_1Element quanthead_1El = null;
IFestmengenzuordnungNode iFestmengenzuordnungNode = wdThis.wdGetProfilebandManagementController().wdGetContext().nodeFestmengenzuordnung();
ICt_QuantheadNode quantheadNode_pfbm = iFestmengenzuordnungNode.nodeCt_Quanthead();
ICt_QuantheadElement quantheadEl = null;
for(int i=0; i<quanthead_1Node.size(); i++) {
quanthead_1El = quanthead_1Node.getCt_Quanthead_1ElementAt(i);
quantheadEl = quantheadNode_pfbm.createAndAddCt_QuantheadElement();
WDCopyService.copyCorresponding(quanthead_1El, quantheadEl);
}
}
The issue comes up only with the for loop, which in my szenario should has only one element.
Additional, please see my screenshot attached.
Many thanks,
Cengiz
Hi Cengiz,
Try to invalidate the node quantheadNode_pfbm before the for loop and check. Let me know if you still have this issue.
Regards,
Ramesh G.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Cengiz,
As per the statements you mentioned above, after executing the rfc you will get a single record from quanthead_1Node. We need to copy the data present in quanthead_1Node to Ct_Quanthead() [which is child node of Festmengenzuordnung]. Now we are trying to copy data from quanthead_1 to each and every element node of Festmengenzuordnung. Please use the below code snippet and try.
int iSize = wdContext.nodeFestmengenzuordnung().size();
for(int i=0;i<iSize;i++){
IFestmengenzuordnungElement ele1 = wdContext.nodeFestmengenzuordnung().getFestmengenzuordnungElementAt(i);
ICt_QuantheadNode node = ele1.nodeCt_Quanthead();
WDCopyService.copySubtree(wdContext.nodeQuanthead_1Node(), node);
}
Let me know if you still face any issue.
Regards,
Ramesh G.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.