cancel
Showing results for 
Search instead for 
Did you mean: 

Call BAPI in Web Dynpro

Former Member
0 Kudos

I want to call a BAPI using web Dynpro.

In my case, the BAPI without input parameter, it only give out a out table after execute.

So that I include this Bapi in the model and directly call it in wdDoInit like this :

wdContext.nodeZbapi_Outvendor_Input().currentZbapi_Outvendor_InputElement().modelObject().execute();

wdContext.nodeZbapi_Outvendor_Input().invalidate();

However, no any result can see. Anybody could tell me what is the correct way to call BAPI in WD?

Thanks!

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Edmond,

have you tried to debug the ABAP to see if/what input comes in and what output is generated?

I had a similar problem and my ABAP colleague told me that the input was empty.

Kind regards

Matthias

Former Member
0 Kudos

Hi

why dont u use a servicce controller to execute ur BAPI.

After adding ur model just map it with component controller in ur component view,Right click ur component and do apply tempelate.

Select service controller and then choose ur model.

For execution of ur bapi a method will be automatically generated in ur component controller.

U can call this method in ur init() method of view without doing anything.It will surely work.

regards

Surender Dahiya

Former Member
0 Kudos

Hi .

Use this code after executing the bapi

wdContext.nodeZbisk.bind(wdContext.nodeZbapi_Outvendor_Input().currentZbapi_Outvendor_InputElement().modelObject().getOutput().getZbisk());

After this line,Print the size of the node Zbisk using

wdcomponentAPI.getMessageManager.reportSuccess("size"+wdcontext.nodezbisk().size());

If the size is greater than zero then your output is coming...

Still not working revert.

Best wishes

Idhaya R

Former Member
0 Kudos

Hi,

Don't invalidate the zbapi node...

If your output can be recieved from the node say.., output from the bapi side and you mapped it to controller to node say OutVend...

Then use this code

wdContext.nodeOutVend().bind(wdContext.nodeZbapi_Outvendor_Input().currentZbapi_Outvendor_InputElement().modelObject().getOutput());

Any queries revert back.

If this is not working post your context structure in your reply and tell where you are expect the output

Best Wishes,

Idhaya R

Former Member
0 Kudos

It is not work...

the context structure :

Zbapi_Outvendor_Input
   |____Output
              |____Zbisk
                         |____Lifnr

I want to show the Zbisk into a table.

Edited by: Edmond Lam on Jun 3, 2008 4:53 PM

Former Member
0 Kudos

Hi Edmund,

In wdDoInit of your component controller write following code:

wdContext.nodeZbapi_Outvendor_Input().bind(new Zbapi_Outvendor_Input());
wdContext.nodeZbapi_Outvendor_Input().currentZbapi_Outvendor_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();

Regards,

Gopal

nikhil_bose
Active Contributor
0 Kudos

replace

wdContext.nodeZbapi_Outvendor_Input().invalidate();

by


wdContext.nodeZbisk().invalidate();

nikhil

Former Member
0 Kudos

Not work...

nikhil_bose
Active Contributor
0 Kudos

Zbapi_Outvendor_Input input = new Zbapi_Outvendor_Input(/* new Model()*/); // pass model object if needed.
wdContext.nodeZbapi_Outvendor_Input().bind(input);
wdContext.currentZbapi_Outvendor_Input().getModelObject().execute();
wdContext.nodeZbisk().invalidate();

nikhil