cancel
Showing results for 
Search instead for 
Did you mean: 

I have doubt in multiselection..Its urgent

Former Member
0 Kudos

Hi All,

I have a table having four fields...They are

1> DocumentNo.

2> Amount

3> Description

4> Date

I have to implement multiple selection.

And if the amount is negative then I have to display a message"Installment Plan cant b created"

And on multiselection or on single selection I will be passing the documentno to the BAPI.

I have implemented the logic..But its not working.

So as per the requirement,I need it urgently..Kindly help me with the logic and the code snippet

Regards

DK

Accepted Solutions (1)

Accepted Solutions (1)

sridhar_k2
Active Contributor
0 Kudos

Hi DK,

What is your Exact requirement? I Understood two points from your question.

1)If Amount is not negative, you want to send it to backend?

2)Table should support multiple support?

Correct me, if i am wrong?

The below code i am using to select multi row value

ITableElement tableEle = null;

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

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

if(aa){

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

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

}

amount = tableEle.getAmount();

}

//it gives us, which row is selected

amount is the selected row amount. use ur logic to check negative value or whatever you want...

Regards,

SK

Answers (1)

Answers (1)

Former Member
0 Kudos

Post the code.

Armin

Former Member
0 Kudos

Hi Armin,

This is my code..

if(element != null){

tableInstallAmount = element.getAMOUNT();

for(int i= 0; i< sizeOfOpen; i++){

if(tableInstallAmount.intValue()>0){

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

SetKeyValues[0].setDOC_NUMBER(wdContext.nodeOPENITEMS_open().getOPENITEMS_openElementAt(selectedRow).getDOC_NO());

wdContext.currentContextElement().setInstalStatus(true);

}

}else{

contextElement.setInstalStatus(false);

wdContext.currentContextElement().setErrorMsg("Installment Plans cannot be created for negative open amounts!");

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("CreateErrorMessage");

IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);

window.setWindowPosition(300,400);

window.open();

wdContext.currentContextElement().setWindowInstance(window);

}

}

}

Former Member
0 Kudos

Which method contains this code?

The following lines look strange:

if (wdContext.nodeOPENITEMS_open().isMultiSelected(i) || selectedRow == i)
{
  SetKeyValues[0].setDOC_NUMBER(wdContext.nodeOPENITEMS_open().getOPENITEMS_openElementAt(selectedRow)
      .getDOC_NO());
  wdContext.currentContextElement().setInstalStatus(true);
}

You test if the node element at index i is selected. If yes, you always set the <b>first </b>array entry to doc_no of the <b>lead </b>selected element (assuming selectedRow is the lead selected index).

What is this good for?

Armin