on 10-16-2006 6:17 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Post the code.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);
}
}
}
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.