cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI's

sureshmandalapu6
Active Contributor
0 Kudos

Hi Experts,

I am developing an application and asked ABAP guy to write the BAPI's for my application. In the BAPI , he has used some structures. When I execute them in R/3 System they are working fine.

but ! when I use them in my application I am getting the following error. I don't why it is happening .

java.lang.ArrayIndexOutOfBoundsException: -1 

    at com.sap.mw.jco.JCO$MetaData.getType(JCO.java:10161)
    at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValue(JcoBaseTypeData.java:503)
    at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getRelatedModelObject(DynamicRFCModelClass.java:738)
    at suresh1.Zhr_Empdata_Get_Output.getZp0002(Zhr_Empdata_Get_Output.java:194)
    at suresh.wdp.IPublicTestAppli$IZp0002Node.doSupplyElements(IPublicTestAppli.java:535)

can anyone help me ?

thanks

Suresh

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

hi Suresh,

This issue is might be with binding to the model. Did you reimport or rebound ? Try to check the binding from the controller to Model. The Output node (Zhr_Empdata_Get_Output) of the controller must be bound to Output node(Zhr_Empdata_Get_Output) inside of the input node (Zhr_Empdata_Get_input) in the model.

Regards,

Siva

sureshmandalapu6
Active Contributor
0 Kudos

HI,

Binding is done properly, There is no problem in that. But ! getting error. See the below steps i did.

First I added the Existing model in Data Modles

Next Apply template on component controler

-


> service controler

---> selecting model(bapi )

---> drag the right side ( Zhr_Empdata_Get_input ) into Component Controler.

Next

---> apply template on View controler

-


> select action button

--> right click on the link and Edit

---> map the "Zhr_Empdata_Get_input" from controler to View by dragging.

after that binding the elements to UI.

still getting problem,

Am i wrong here ?

thanks

Suresh

former_member197348
Active Contributor
0 Kudos

Hi Suresh,

You are not getting the data from BAPI in WD application. So first check , are you passing all the necessary parameters to BAPI before executing it?

You told that that you can execute the BAPI successfully in R/3.

Are you passing any parameters' values there?

If you are passing the mandatory parameters before calling the BAPI, try to print their values in execute BAPI method.

And comment the statements that are using any output data for testing purpose.

Regards,

Siva

sureshmandalapu6
Active Contributor
0 Kudos

Hi Siva Rama Krushna,

Congratulations for your contribution top score.

As you said that , there is an input parameter which I have to send to that BAPI and I am also passing the input parameter to BAPI by setter method before executing model.

But ! still when I bind some of model attributes to UI element. only one attribute is working . If I bind the other attributes I am getting "IndexOutofBoundException" .

I don't understand what is the problem.

can u help me Siva.

thanks

Suresh

Former Member
0 Kudos

hi Suresh,

We also faced this issue , is there any paramater which is coming as null and we are trying to access it the code. Wht i mean is there can be output paramters in the Node which does not have any data but we are trying to acess the same.

Regards

Pankaj Prasoon

sureshmandalapu6
Active Contributor
0 Kudos

Hi Pankaj Prasoon,

As you said, I tested the BAPI in R/3 System and got the result for certain output variables as without any null values. Only those output parameters I am binding in UI elements in WebDynpro, even thought I am getting the following error.

The initial exception that caused the request to fail, was:



   java.lang.ArrayIndexOutOfBoundsException: -1 

    at com.sap.mw.jco.JCO$Record.getString(JCO.java:12780)
    at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValueAsString(JcoBaseTypeData.java:669)
    at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getAttributeValueAsString(DynamicRFCModelClass.java:427)
    at sap1.Zhr_Empdata_Get_1_Output.getVorna(Zhr_Empdata_Get_1_Output.java:404)
    at sap.wdp.IPublicApp1$IOutput1Element.wdGetObject(IPublicApp1.java:833)
    ... 52 more

Even I tried to access the same attributes Component controler by component. I get the same error. Which means it is not accepting to access those attributes. I don't know why .

Could u help me ??

thanks

Suresh

Edited by: Suresh Mandalapu on Sep 13, 2008 9:13 AM

sureshmandalapu6
Active Contributor
0 Kudos

Hi,

In my portal the UME is not working ? Is this the problem ? The UME service is not working in my portal.

guide me please

thanks

suresh

Answers (1)

Answers (1)

PradeepBondla
Active Contributor
0 Kudos

Hi,

Re import the model and try to map once again.

restart server as last option.

check this also

PradeeP