You have three options of connecting SAP with SAP PI – IDoc Adapters, RFC Adapters and Proxies. In an earlier blog, we discussed IDOC Adapter in SAP PI. This article specifically deals with understanding the basics of RFC adapter in SAP PI.
Here we will cover the configuration steps for the RFC sender and the receiver adapter.
About RFC Adapter
RFC Adapter converts the incoming RFC calls to XML and XML messages to outgoing RFC calls. We can have both synchronous (sRFC) and asynchronous (tRFC) communication with SAP systems. The former works with Best-Effort QoS (Quality of Service) while the latter by Exactly Once (EO).
Now let us understand the configuration needed to set up RFC communication.
RFC Sender Adapter
In this case, the Sender SAP system requests PI to process RFC calls. This could either be synchronous or asynchronous.
Configuration in SAP system:
- Go to transaction SM59.
- Create a new RFC connection of type ‘T’ (TCP/IP Connection).
- On the Technical Settings tab, select the “Registered Server Program” radio button and specify an arbitrary Program ID. Note that the same program ID must be specified in the configuration of the sender adapter communication channel. Also, note that this program ID is case-sensitive.
- When using the RFC call in your ABAP program you should specify the RFC destination created above. For example,
CALL FUNCTION ‘<NAME_OF_THE_RFC_FUNCTION_MODULE>’
DESTINATION ‘<RFC_DESTINATION_NAME>’.
Also, in case you are setting up an asynchronous interface, the RFC should be called in the background. For example,
CALL FUNCTION ‘<NAME_OF_THE_RFC_FUNCTION_MODULE>’
IN BACKGROUND TASK
DESTINATION ‘<RFC_DESTINATION_NAME>’.
SAP PI Configuration:
- Now, create the relevant communication channel of Adapter Type as RFC Sender (Please see the figure below).
- Specify the Application server and Gateway service of the sender SAP system.
- Specify the program ID. Specify exactly the same program ID that you provided while creating the RFC destination in the SAP system. Note that this program ID is case-sensitive.
- Provide Application server details and login credentials in the RFC metadata repository parameter.
- Save and activate the channel.
RFC Receiver Adapter
In this case, PI sends the data in the RFC format (after conversion from XML format by the receiver adapter) to the target system where the RFC is executed.
- Configuring the receiver adapter is even simpler.
- Create a communication channel of type RFC Receiver (Please see the figure below).
- Specify the RFC Client parameters like the Application server details, login credentials, etc
- Activate the channel.