on 07-23-2008 12:14 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
why dont you create another model for other bapi? there wont be any problem.
PradeeP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.