cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Node Elements with RFC execution and dynmaic view elements

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Ramesh,

thanks, but the result is the same. I already have done it before.

The mappings between the nodes is so far ok, and even when I replace the for-loop with WDCopyService.copyElements(....), nothing change.

Cengiz

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Cengiz,

Please close this thread if your issue got resolved, else let us know the issue still you are facing.

Thanks,

Regards,

Ramesh G.