Creating RFC in SAP


How to Create SAP ABAP RFC(Remote Enabled Function Module) – Creating RFC in SAP

SAP ABAP Interview Questions – Real-Time

SAP ABAP Fundamentals

Step 1: Go to T-code SE37. Enter the name of Function Module and create.

 

Step 2: Enter the name of Function Group you created before and Short text of the Function Module. Click on Save Button.

Step 3: A pop-up will display, click on button.

Step 4: Under “Processing type”, select the “Remote-enabled Module” radio button.
Under the Attributes tab, you can change the Short Text, if you want.

Step 5: Under the Import tab, create an import parameter as shown below.

Step 6: Under the Export tab, create an export parameter as shown below.

Step 7: Under Source Code tab, write the code as shown below.

FUNCTION MODULE CODE:

FUNCTION ZFUNCMOD3.
*”———————————————————————-
*”*”Local Interface:
*” IMPORTING
*” VALUE(I_VBELN) TYPE ZST_VBAP-VBELN
*” EXPORTING
*” VALUE(E_VBAP) TYPE ZTT_VBAP
*” EXCEPTIONS
*” NO_PARAMETER
*”———————————————————————-

SELECT VBELN
POSNR
MATNR
MATKL
ARKTX
FROM VBAP INTO TABLE E_VBAP
WHERE VBELN EQ I_VBELN.

ENDFUNCTION.

Step 8: Click on the save button and activate it.

Step 9: Now click on the button and enter the value in Import Parameters and click on the button.

Step 10: Output is in Export Parameter. To view the output click onbutton.

Output will be as shown below: