cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute automatically

Former Member
0 Kudos

hi

i want to execute bapi first time when first time view displays

so please let me know how to execute the BAPI when first view executes.

regards

mmukesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Yes u need to write the execute method in the init method of the Customcontroller or View.

import the model and context mapping from the contextcontroller to view controller

and design ur view and add the following code.

BAPI_input input = new BAPI_input();

wdContext.nodeBAPI_inputElement().bind(input);

//pass the input for the BAPI.

input.set<params1>();

input.set<params2>();

try{

wdContex.currentBAPI_inputElement().modelObject().execute();

wdContext.nodeOutput().Invalidate();

}catch(Exception e)

{

}

It migh helps u .

Thanks,

Lohi.

Former Member
0 Kudos

Hi Mukesh,

you must simply put the executeBAPI method into the wdDoInit() method of your Component controller.

Regards,

Gianluca Barile