cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro Issue

Former Member
0 Kudos

Hi,

I have a WebDynpro Java application having only one BAPI used and working fine. Now I want to add one more bapi to the existing model and then call that perticular bapi and pull the data to a table.

I reimported my model and got the bapi and mapped the context accordingly. How can i call that perticular bapi now. I created a method in Component controler which is having the following statement and then calling that method in View controler. I am getting the nullpointer exeception. There is no import variables for the bapi.

wdContext.currentZfunmoduletest_InputElement().modelObject().execute();

Help in this case please

thanks

suresh

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member189631
Active Contributor
0 Kudos

You have to write the exceute code to excute your 2nd BAPI. If you follow my above suggested method, everything will be taken care.

Ram

former_member189631
Active Contributor
0 Kudos

Suresh,

Once you reimport the model its recommended to rebuild the project and restart the

J2EE Engine by righclickinfg on SDM and select "restart process".

Then,

  • you can open the component view in diagram View.

  • Right click on the component part and select apply template

  • Create a Custom controller and create a execute method (it will come by default) select the class corresponding to ur bapi.. And do context mapping thr itself

  • Make the link from your view to the custom controller

  • right click on the view and apply template create form/button.

  • While create a button you can select the blugs/or methods.

  • Press Finish

  • The code for binding and calling the method will be generated automatically.

Ram

PradeepBondla
Active Contributor
0 Kudos

why dont you create another model for other bapi? there wont be any problem.

PradeeP

Former Member
0 Kudos

Hi pradeep bondla,

In another model i can create, but ! u know in further, i need to add the bapi's to existing model.

thanks in advace

suresh

Former Member
0 Kudos

Hi Suresh,

Its the best practice to call all BAPI's from one server into one model only. So its perfectly alright in your case.

What happens is, when you execute a model object , all bapi hook methods in the model get executed in one go. In such a case if your bapi returns a null value for a particular import parameter then null pointer exception is obvious. since in your case BAPI dont have a import parameter. you should check the BAPI first (May be there is not problem at all with your application). or check the export values from the other bapi for null values.

Warm Regards,

Suresh

lokesh_kamana
Active Contributor
0 Kudos

Hi,

In web dynpro this issue is most common.

the solution upto my nowlege is you have to restrt the J2EE Engine.

Some times it works.

I could nt assue you taht it works.

Thanks & Regards,

Lokesh.