In this tutorial, you will learn step by step process to create an RFC in SAP ABAP with proper screenshots.
What Is RFC?
RFC (Remote Function Call) is a standard SAP protocol that is used for communication between applications of two SAP systems. Normally we use RFCs when the caller and the called function module run in the same system.
How to Create RFC?
Please follow the steps below to create an RFC:
Execute t-code SE37 in the SAP command field
Next, enter the Function Module name and click on Create button.
Next enter the following details and click the Save button
- Function Group
- Short text of the Function Module.
A pop-up will appear to choose your language preference
Next, select your Transportable Workbench Request and press Enter to proceed further.
Now go to the Attributes tab, select the Remote-enabled Module radio button.
Next, go to the Import tab and create an import parameter as shown in the image below.
Similarly, go to the Export tab and create an export parameter
Now go to the Source Code tab, and write the following code
FUNCTION Z_DEMO_FM.
*”———————————————————————-
*”*”Local Interface:
*” IMPORTING
*” VALUE(I_SRTECH) TYPE ZST_SRH
*” EXPORTING
*” VALUE(E_STRC) TYPE ZTT_STE
*” EXCEPTIONS
*” NO_PARAMETER
*”———————————————————————-
SELECT SRTECH
POSNR
MATNR
MATKL
ARKTX
FROM STRC INTO TABLE E_STRC
WHERE SRTECH EQ I_SRTECH.
ENDFUNCTION.
Next, click the Save button
And then click the Activate button to activate the RFC.