on 12-08-2008 12:15 PM
hi,
I have an application where i use a RFC to Zsm_Actual_Allocation_Input to take input values like startDate,endDate, skills
and execute and populate values in a table.While i pass values for 'skills' only and execute the RFC, it runs fine and
populate values in the table .But while i pass the values for startDate,endDate it always throws an exception saying
java.lang.ArrayIndexOutOfBoundsException: -1
Any clue regarding the error??
Am posting my code along with this :
IPublicTdc_DataCust.IZsm_Actual_Allocation_InputNode AllocationInputNode = wdThis
.wdGetTdc_DataCustController()
.wdGetContext()
.nodeZsm_Actual_Allocation_Input();
Zsm_Actual_Allocation_Input input = new Zsm_Actual_Allocation_Input();
for(int i = 0;i<AllocationDetailsNode.size();++i)
{
AllocationDetailsElement = AllocationDetailsNode.getCtx_vn_AllocationDetailsElementAt(i);
Date dt = AllocationDetailsElement.getStartDate();
try
{
input.setR_Skills("X");
input.setFrom_Date(dt);
input.setTo_Date(AllocationDetailsElement.getEndDate());
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException(""+ e.toString(),false);
}
}
AllocationInputNode.bind(input);
NB : AllocationDetailsNode is the node containing the values of Startdate and Enddate entered by the user from the front-end.
Hi,
Try this it may help you
for (int i = AllocationDetailsNode.size()- 1; i >= 0; --i)
It may do the trick for you.
Thanks & Regards,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I think that your problem is in this line :
AllocationInputNode.bind(input);
U should not use bind If u want to add an element , this is how u should do it:
AllocationInputNode.addElement(input);
This code will add the element named input to the node .
Hope it helps
Nitsan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is ur issue reolved or not.
Thanks & Regards,
Lokesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Mamai,
check the line number on which you are getting the exception and check the corresponding line of code in the class. This help to narrow down the code where the exception is occuring. And please post the code where you got the exception
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I suspect that you may be passing too many parameters. Check the signature of the BAPI. You said that you passed BOTH the date values and it gave you this error. See if you also get this when only passing one date. If you still dont get the error passing the 3rd parameter (last date) might be the culprit.
Cheers,
Christiaan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mamai,
try by changing the code
for(int i = 0;i<AllocationDetailsNode.size();++i)
to
for(int i = 0;i<AllocationDetailsNode.size(); i++)
ArrayIndexOutOfBoundsException is thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.