Remote Function Call (RFC)
Remote Function Call (RFC)
RFC is used to communicate between SAP systems and SAP to Non-SAP systems using TCP/IP protocol.
RFC means that the ABAP programmer does not have to write his or her ow n communication routines. For
an RFC call, the RFC interface Converts all parameter data to the format required in the remote system
calls the communication routines that are required to communicate with the remote system handles errors
that occur during the communication.
RFCs are defined in T-Code SM59. There are 4 types of RFCs
1. Asynchronous RFC
2. Synchronous RFC
3. Transactional RFC
4. Queue RFC
1. Async hronous RFC:
Like a post card. The sending system may or may not receive it. i.e. there is no acknow ledgement from
the receiving . The transmission is not reliable.
2. Sy nchronous RFC:
It is not like ARFC. It gets an acknowledgement from the target system. ( Like a register post).
If the receiving system is not available the process goes into RFC/ CPIC/ Sleep mode and waits until it is
wakened by the target system. Target system/ Receiving system may be busy i.e. all the resources are
used up. This is reliable but time consuming and expensive (Client Copy) the job should get finished.
3. Transactional RFC:
TRFC It is an advanced version of ARFC and SRFC. T he request goes to receiving system if it is not
handled a Transaction ID is generated by the source system. A program RSARFCSE is scheduled in the
background to run for every 60 seconds. Transaction SM58 is used for Transactional RFC. It is used to
document all the transactional IDs and ensure that they are received by the recipient system. This is
consistence and reliable.
4. Queued RFC:
It is an advanced version of TRF and ensures that the transaction is committed based on FIFO/ Queue. It
ensures transaction consistency of LUW and reliability of data transmission.
SMQ1 to monitor the outbound queues of a sending system refer SCOTT for FAX
SMQ2 Provides interface to monitor inbound queues.
2.Hostname
3.RFC User / Password
4.RFC user authorizations
RFC Tables
For tRFC outbound the tables used are ARFCSSTATE and ARFCSSDATA.
For qRFC outbound the tables used are TRFCQOUT ARFC SSTATE and ARFCSSDATA.
What is BAPI?
BAPI (Business Application Programming Interface) is a set of interfaces to object-oriented
programming methods that enable a programmer to integrate third-party software into the
proprietary R/3 product from SAP. For specific business tasks such as uploading transactional data, BAPIs
are implemented and stored in the R/3 system as remote function call (RFC) modules.
Click on create icon in the above screen, which leads to below screen
Specify RFC Destination name and description and connection Type in the above screen
Please note respective connection type to be selected from dropdown based on the connection required.
Usually 3 is for ABAP system. (Pls find screenshot below)
In the below screen, please select load balancing radio button based on your system setup (i.e if there is
load balancing configured for your system, specify it as yes otherwise no)
Please provide Target host details like hostname or ipaddress and system number as below:
As shown below, Proceed to Logon & security tab and provide follow ing details :
Select trusted system as no, in case you would like to connect to a system w ith a user id and password.
If you dont want to get authenticated by credentials specify the system as trusted system which wont
prompt to enter user id/pw d credentials in the below screen.
Please provide Language details like EN (for English), Client details, User id and password for the system
you would like to create a connection.
Please leave default values in other tabs (i.e MDMP & Unicode, Special options, Administration) and then
click on Save to complete the RFC creation.
If this is fine, come back to earlier screen and execute Unicode test by clicking the button. Output similar
to below screen, should be displayed if connection is OK
Also you need to perform authorization test to make sure user id / password credentials provided are
correct.
Please navigate as below and perform the test:
Navigate to Utilities -> Test -> Authorisation test and click the same to execute.
If the RFC configuration is fine, screen shot similar above will appear. Otherwise an erro r w ill be displayed
based on which you need to troubleshoot to fix the issue.
Value
destination
Program ID
Gateway host
Enter a host name on which a gateway process of the AS ABAP runs (this can
be any application server of the AS ABAP).
Gateway
Enter the port of the gateway or the alias (usuallysapgw <nn> where <nn> is
service
Number of
processes
parallel and thus depends on the expected rate of SAML authentications per
second. For getting started, use 1.
Re pository
Application
server host
System
number
Client
Language
User
Password
In the RFC destination section and the Repository section, configure a connection to the same AS ABAP.
3. Choose Set.
The connection should appear in the list on the left side with a running symbol. If not, check the log
files to find the cause of the error.
Configuration in the AS ABAP
1. Start the Configuration of RFC Connections (transaction SM59).
2. Check whether the RFC destination SAPJ2EE is already pre-configured and points to the local AS
Java using connection data that matches the data you have found or entered in the JCo RFC
Provider of the AS Java.
3. If this is not the case:
a. Create a new RFC destination of type T.
b. On the Technical Settings tab page, choose Registered Server Program as Activation Type.
c. Enter the same Program ID, Gateway Host, and Gateway Service as you entered in the
connection on the AS Java.
d. Save your data.
e. Choose Connection Test to check whether the connection between the AS ABAP and the AS
Java is correctly established.
Result
You have an RFC destination in the AS ABAP that can be used to communicate with the AS Java.
What is the function module to c heck RFC Connection?