Skip to Content

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

Problem with MultiLeadSelection in a table

Hi All,

I am still having the problem with the multilead selection in a table.

I am setting the table properties to multi and I have an event handler for the onaction property, named as leadselection.

I am writing the code below for the event handler.

public void onActionLeadSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

int selectedRow = firstNode.nodeOPENITEMS_open().getLeadSelection();

int sizeOfOpen = wdContext.nodeOPENITEMS_open().size();

IOPENITEMS_openElement element = (IOPENITEMS_openElement)firstNode.nodeOPENITEMS_open().getElementAt(selectedRow);

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

if(wdContext.nodeOPENITEMS_open().isMultiSelected(i)||selectedRow == i){

wdContext.currentContextElement().setMultiDocNumber(wdContext.nodeOPENITEMS_open().getOPENITEMS_openElementAt(selectedRow).getDOC_NO());

wdContext.currentContextElement().setMultiItemno(wdContext.nodeOPENITEMS_open().getOPENITEMS_openElementAt(selectedRow).getITEM());

wdContext.currentContextElement().setMultiRepItem(wdContext.nodeOPENITEMS_open().getOPENITEMS_openElementAt(selectedRow).getREP_ITEM());

wdContext.currentContextElement().setMultiSubitem(wdContext.nodeOPENITEMS_open().getOPENITEMS_openElementAt(selectedRow).getSUB_ITEM());

}

}

}

What i am trying to do is..On multiselection or on single leaad selection, I should pass the whole amount to the BAPI or the amount related to only the leadselection.

But when I am trying to run..this code..I am nt able to select in a multiple way..and more over if I press ctrl then I am able to make the other rows highlighted with orange color..but not normally and after making them highlighted also i am not able to pass the amount for all the selected rows..together..

Kindly suggest me..something..

Regards

DK

Former Member
Former Member replied

Hi,

Use the below code. Not in Lead Selection.

ITableElement tableEle = null;

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

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

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

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

if(aa){

tableEle = (ITableElement)wdContext.nodeTable().getElementAt(i+1);

wdComponentAPI.getMessageManager().reportSuccess("Lead Selected Val " + tableEle.getName());

}

aa=false;

}

Regards,

Sridhar K

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