Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Doubt in Multiselection in a table

Hi All,

I have a table and have to to multiselection.While doing the multiselection I have to pass the few things for the selected rows to a BAPI which will process and give the output accordingly.

In an action handler I am writing the following code:

//*****Trying the multiselection****//

IOPENITEMS_openElement tableEle = null;

IPrivateCreateResultIPView.IMultiNodeElement ele = wdContext.nodeMultiNode().createMultiNodeElement();

for(int i=0;i<wdContext.nodeOPENITEMS_open().size();i++){

wdComponentAPI.getMessageManager().reportSuccess(" Size is :"+wdContext.nodeOPENITEMS_open().size());

boolean aa = wdContext.nodeOPENITEMS_open().isMultiSelected(i);

wdComponentAPI.getMessageManager().reportSuccess("Selected : "+i " : Val "aa);

if(aa){

wdComponentAPI.getMessageManager().reportSuccess(" Selected "+i);

tableEle = (IOPENITEMS_openElement)wdContext.nodeOPENITEMS_open().getElementAt(i);

ele.setMultiDocno(tableEle.getDOC_NO());

ele.setMultiItem(tableEle.getITEM());

ele.setMultiRep(tableEle.getREP_ITEM());

ele.setMultiSub(tableEle.getSUB_ITEM());

wdContext.nodeMultiNode().addElement(ele);

}

}

//****Ends here***//

here multiNode is a local View node that I have taken to collect the records or the data for the selected rows.

The Exception that i am getting

com.sap.tc.webdynpro.progmodel.context.ContextException: Node(CreateResultIPView.multiNode): cannot bind or add element, because it is already bound to a node

at com.sap.tc.webdynpro.progmodel.context.Node.prepareAddElement(Node.java:645)

at com.sap.tc.webdynpro.progmodel.context.Node.addElement(Node.java:631)

at com.accenture.pct.rrs.installmentplan.CreateResultIPView.onActionCreateInstallmentPlan(CreateResultIPView.java:462)

at com.accenture.pct.rrs.installmentplan.wdp.InternalCreateResultIPView.wdInvokeEventHandler(InternalCreateResultIPView.java:1597)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

Kindly give a solution to the problem.I have been struggling for the past one whole day.

looking forward to you.

Regards

DK

Former Member
Former Member replied

Hi DK,

It is simple. Bring that element into the for loop.like,

IPrivateCreateResultIPView.IMultiNodeElement ele = null;

for(int i=0;i<wdContext.nodeOPENITEMS_open().size();i++){

ele = wdContext.nodeMultiNode().createMultiNodeElement();

//write your logic here

wdContext.nodeMultiNode().addElement(ele);

}

Hope it solved ur problem.Otherwise get back.

Regards,

SK

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question