Remote function calls (RFCs) are one of the popular way to integrate SAP system with any third party application. They helps to integrate SAP using a real time communication. They are specially useful when we need to validate, create transaction or read information from SAP in a synchronous fashion. This is in contrast to IDOCs which are used for batch-wise non-synchronous integration.
RFCs are similar to web-services. As similar to other web technologies, RFCs can be exposed as web-services and tested using Postman .
RFC is a standard SAP interface communicating between the SAP systems and enables the communication between two SAP systems or between SAP system and external system. Remote Function Call (RFC) is remote execution of a Remote Function Module in an external system. Each ABAP program can call a remote function module. RFC function modules in an SAP system must be proper function modules and must be registered in the SAP system as remote.
For this article, we will be using the below. As you can see below this function module is enabled for remote call. On the functionality level, it gets the invoices due for payment for a specific customer. We will discuss below on how to use the same by calling this SAP BAPI by a .NET code.
Why RFCs are popular while integrating SAP with third party applications?
RFCs are useful when the immediate response from SAP is required. This could be related to validations or creation of transactions within the application. Through real-time, this can add up to system load if many parallel RFCs calls are lined up in the application.
To communicate with SAP from external system we require connector. SAP .NET connector connects Microsoft .NET application and SAP systems by using the SAP RFC. It is also called NCO. We can connect by using Java, which is called the JCO.
SAP .NET Connector (SAP NCO) supports SAP RFCs and web services and allows us to write various applications. For example, orders received in eCommerce site and these orders should be present in SAP. By using the .Net connector we can push these orders into SAP. See an example how to integrate SAP using NCO library.
SAP NCO connector having the following benefits:
Ease of Development – You can quickly and easily develop .NET applications by using SAP’s Business Applications Programming Interface (BAPI) technology.
Use of Wizard – Use of connector is simple and we can use this connector in any of other .Net Applications.
Reliable Communication – At execution time, SAP .NET Connector provides fast, secure, and reliable communication between the .NET application and SAP applications.
Consider we have e-commerce site where the customers are placing orders, we don’t have minimum order quantity and credit check in e-commerce site but which are available in SAP. While placing order we need to check the customer is having the credit limit or not, on real time basis we can send a request to SAP to check the credit limit and accordingly we can perform an action in e-commerce site.
We have developed .NET application and sending a request to SAP for checking the credit check of a customer. This is shown in below screenshot.
We can display the error message based on the response from the SAP which is shown in below screenshot.
Considerations while integrating SAP with RFCs
Following are the key considerations to ponder about before starting the integration assignment. Paying attention to these can help you overcome any challenge.
RFCs need to be committed
RFCs for connecting the applications, you may want to check whether additional database commit function is required. This is required, since many standard BAPIs need to be explicitly committed to database before you can see the actual transaction.
We need to take care the data conversion while integrating the data. SAP supports many data types as compared to programming languages. For suppose we have a date field, we need to match the date filed otherwise this will leads to mismatch data or inaccurate data.
Make sure no endless loop in RFC code. This may lead to application crash or dead-lock scenario. It can also severely affect the business by hogging all the resources within SAP.
About us and what we do
We are passionate about seamlessly connecting SAP with other applications in your landscape. Our consultants are not only expert in SAP integration, but can also enable you to write an SAP adapter for your application and help your application talk to a SAP system.