cancel
Showing results for 
Search instead for 
Did you mean: 

Finding execute() method in an Executable Model Object

Former Member
0 Kudos

hi all,

how to find the execute() method of an Executable Model Object of a BAPI.

that is..when an event is fired the event will trigger the execute() method of an Executable Model Object, which in turn would display the data from SAP backend.

kindly help me out in finding out this execute() method.

eagerly waiting for the replies....

Regards,

Ajay

Accepted Solutions (0)

Answers (1)

Answers (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

U can find the execute method here.

<BAPI name> inst=new <BAPI name>();

wdContext.node<BAPI name>().bind(inst);

wdContext.current<BAPI name>().modelObject().execute();

Regards,

Vijay

Former Member
0 Kudos

hi vijay,

thanks for the reply....

well i have already done whatever you have mentioned. but iam still getting the error. below i have mentioned the steps that i followed(iam following the SDN sample project),

1) created a model using BAPI_FLIGHT_GETLIST.

2) corresponging INPUT and OUTPUT model classes is created for the model.

3) included the model as the used models

4) created the context structure for the custom controller by model binding by choosing Bapi__Flight_Getlist_Input.

5) mapped the custom controller context to the view controller context.

6) created an action for the SEARCH button in the view

7) created a method execute_Bapi_Flight_Getlist_Input in the custom controller.

😎 in the implementation area of the view, i have included the coding..

wdThis.wdGetFlightListCustController().executeBapi_Flight_Getlist_Input();

NOTE: after this code is given, i get an error "cannot invoke executeBapi_Flight_Getlist_Input()on the primitive type void.

why is this problem occuring. what should be done to resolve this problem.

have you seen this problem before

eagerly waiting for your reply..

regards,

Ajay

Former Member
0 Kudos

hi vijay,

i think i was not clear in my first mail. when a model is created using a BAPI, then an INPUT(Bapi_Flight_Getlist_Input) and OUTPUT(Bapi_Flight_Getlist_output) model objects are created for the BAPI. and INPUT model object is the only executable model object of the BAPI. according to Web Dynpro Bapi_Flight_Getlist_Input model object will always contain an execute() method within it.

now my question is - how to find out the execute() method from the Bapi_Flight_Getlist_Input model object.

hope iam clear now. kindly reply me if more clarifications are required.

eagerly waiting for your replies..

Regards,

Ajay

vijayakhanna_raman
Active Contributor
0 Kudos

Hi ajay,

Can u write the code in the onAction search method itself.

wdContext.currentBapi__Flight_Getlist_InputElement().modelObject().execute();

Regards,

Vijay

Former Member
0 Kudos

hi vijay,

sorry for the delay in replying.

i have solved the problem myself. now its working fine. thanks for the effort you have taken.

i require a clarification related to BAPI.

the scenario is:

i have a view with a button named "REJECT" and iam using "SAP_WAPI_REJECT_WORKITEM" for this view which is used to reject a workitem. on clicking the REJECT button the BAPI should reject the workitem and ultimately update the tables.

how should i invoke the BAPI??

waiting for replies..

Regards,

Ajay