cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a RFC of a remote system from an ABAP webdynpro component

Former Member
0 Kudos

Dear Experts,

I am a newbie in ABAP Webdynpro.

I am working on a requirement where I have a webdynpro component on ECC system.I need to call a RFC located on CRM system from my webdynpro component on the ECC system.

How do I do that ?? Please help.

Regards,

Mamai.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mamai,

RFC can be called from webdynpro same as how we are calling from normal abap.below is the code.

CALL FUNCTION 'Function module name' DESTINATION loc_dest

EXPORTING

contract_no = gv_tender

IMPORTING

zzremarks = gv_desc.

Regards,

Simi A M

Former Member
0 Kudos

Hi,

Thanks for your prompt response.

But since I am new to the technology,I am not able to follow should I do the context mapping n all like calling a RFC from the same system.

It would be of great help if you provide the step by step procedure or any links where I can follow how to call a RFC of a remote system onto my webdynpro component.

Regards,

Mamai.

Former Member
0 Kudos

Try to use the 'Pattern' button in the toolbar. This would generate the code for you. Then just add the destination part to it.

gill367
Active Contributor
0 Kudos

Calling RFC from some other system is same as local except the difference is that you have to give destination name while calling.

And the regarding the method of calling it depends on your FM.

if it is big RFC with complex structure, you can create the service call for it with destination given as RFC desitination.

if it is simple straight forward RFC you can directly call it.

for creating RFC service call call use this method


1. Starting the Wizard
To start the wizard, position the cursor on the Web Dynpro component to be edited in the object list at the left margin of the 
workbench window. Open its context menu and choose the entry Create->Service Call. The wizard is started and leads you 
through the creation process. 

Press Continue.

2. Choice of Controller

On the second dialog window of the wizard, you can choose whether the service call is to be embedded in an existing 
controller or whether a new controller is to be created for this purpose. Service calls can only always be embedded in 
global controllers u2013 that is, in the component controller or in additionally created custom controllers. It is not possible, to 
embed service calls in view controllers.
a. Select radio button Use Existent Controller
b. Do not change the default entry for component: <CC name>
c. Enter for controller COMPONENTCONTROLLER
d. Press Continue.

3. Service Type and Service Selection
a. You now select, which service type should be used for this service call. Select radio button Function Module. Fill the 
destination here. Press Continue.
b. Select the service: for Function Module enter <RFC name>. Press Continue.
4. The Required Methods and Context Elements
On the two subsequent dialog windows, default values are listed for giving names to the context nodes and attributes 
required by the service call as well as to the required methods. The proposed names are based on the names of the 
embedded service, but you can change them as required. However, heed the respective notes in the corresponding dialog 
box.
a. Adapt Context: Select from Nodes/Attributes . Press Continue.


b. Specify Method Name: leave all entries as provided: Component:  Controller: COMPONENTCONTROLLER Method: EXCUTE_ Press Continue.
5. Completing the Choice
When you have confirmed the last dialog box, the generation is triggered. Afterwards you now have the required methods 
and contexts at your disposal for using them within your Web Dynpro component.

or if you want to call directly the use the call statement with destination

Former Member
0 Kudos

Hi Sabarjeet,

Thanks for the detailed and prompt response.

I have followed your steps in detail.

While mentioning the RFC name, I have called : BAPI_FLIGHT_GETLIST.

and destionation I have mentioned the remote system Id : S7R.

But I get the following error while executing the RFC :

Note

The following error text was processed in the system HE6 : RFC Exception COMMUNICATION_FAILURE with Message RFC destination S7R does not exist. Occurred

The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 1 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: EXECUTE_BAPI_FLIGHT_GETLIST of program /1BCWDY/A0Y1JBA3AWP44WKFQ27K==CP

Method: IF_COMPONENTCONTROLLER~EXECUTE_BAPI_FLIGHT_GETLIST of program /1BCWDY/A0Y1JBA3AWP44WKFQ27K==CP

Method: ONACTIONSEARCHFLIGHTS of program /1BCWDY/A0Y1JBA3AWP44WKFQ27K==CP

Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/A0Y1JBA3AWP44WKFQ27K==CP

Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP

Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP

Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP

Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP

Please tell me where I am going wrong.

Regards,

Mamai.

Former Member
0 Kudos

Hi Mamai,

Did you declare the remote system in the RFC Destination under transaction SM59? If not, do that and try again.

Regards,

Gopal.

Former Member
0 Kudos

Hi Gopal,

DO u have any document which tells the steps of creating a RFC Destination under sm59 ??

Regards,

Mamai.

Former Member
0 Kudos

Hello,

To create RFC destination under SM59 follow the steps below. Also, have a look at the following links which might be helpful.

sm59-> R/3 connections -> create

1) give rfc destination name.

2) connection type - 3.

3) technical settings tab -> Target Host - give the Application Server name -> press enter.

the ip address automatially gets filled up.

4) Logon security tab -> Assign the Logon details

http://www.abap-tutorials.com/2010/04/02/creating-rfc-destinations/

http://help.sap.com/saphelp_nw04/helpdata/en/80/09680289c751429ab3b07ad2a61c10/frameset.htm

I hope this will resolve your problem.

Regards,

Gopal.

Edited by: Gopal Yarlagadda on Mar 9, 2011 3:00 PM

Former Member
0 Kudos

Hi All,

Thanks to all of you. I am successfully able to connect to remote system all guided by you all.

Regards,

Mamai.

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There is really nothing Web Dynpro specific about this activity. You would call the RFC exactly as you would in any standard program.

Former Member
0 Kudos

Roughly to say that you need to call the FM using the DESTINATION addition. However this destination system should have been defined in rfc destinations using transaction sm59.