cancel
Showing results for 
Search instead for 
Did you mean: 

how to call RFC!!!

Former Member
0 Kudos

Hi!All

How to call RFC on click of button?

Regards

Parth

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Partha,

The main thing you will have to consider is the creation of the JCO destinations for the application. These are maintained in the webdynpro content administration.

After creating the model in the webdynpro project, you need to go to the url http://<host>:<port>/webdynpro/welcome/ and create the JCO destinations you gave while creating the BAPI model. There they will come with red colored icons, after success creation them they will become green.

After that you need to initialize the input elements in the code and simply execte the bapi in some action method of the button.

Reply me if you need some more help.

Answers (3)

Answers (3)

Former Member
0 Kudos

HI,

1) Create an Action say onActionButtonClick

2) create a method executeXYZRFC in this method write the following code

Bapi_User_Getlist_Input inpUser = new Bapi_User_Getlist_Input();

wdContext.nodeBapi_User_Getlist_Input().bind(inpinpUser);

try

{

wdContext.currentBapi_User_Getlist_InputElement().modelObject().execute();

}

catch(Exception e)

{

e.printStacktrace("Error while executing BAPI");

}

3) call the executeXYZRFC method in onActionButtonClick

Regards,

RK

Former Member
0 Kudos

Hi,

please refer the step by step procedure.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/creating a web dynpro application accessing abap functions.pdf

You will have to complete some pre-requisite steps for the call to be successful.

refer: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f0b0e990-0201-0010-cc96-d7e...

Hope that helps.

Regards,

S.Divakar

vijayakhanna_raman
Active Contributor
0 Kudos

Hi Partha,

U have to write the code onClick action.

Bapi_User_Getlist_Input inp = new Bapi_User_Getlist_Input();

wdContext.nodeBapi_User_Getlist_Input().bind(inp);

try

{

wdContext.currentBapi_User_Getlist_InputElement().modelObject().execute();

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("Exception "+e,true);

}

Regards,

Vijay