Use a Generic RFC Function to Call Functions in Another SAP System with Serialized Parameters

  • by George Chen, SAP Consultant, Lynk, Inc.
  • October 10, 2017
The integration of data and processes among different SAP systems has always been challenging and expensive in development. You can dramatically reduce the development effort in system integration by exploring the generic presentation of functions/methods and the generic presentation of parameters in a generic Remote Function Call (RFC).
Learning Objectives

Reading this article you will learn:

  • How to create one generic parameter for various functions to be executed in a generic Remote Function Call (RFC)
  • How to create one generic parameter for various import/export/change parameters in a generic RFC call
Key Concept

A Remote Function Call (RFC)-enabled function module is an SAP program that can be called by RFC from another system. Generic programming is a style of computer programming in which algorithms are written in terms of types to be specified later that are then instantiated when needed for specific types provided as parameters. Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object to be able to recreate it when needed. The reverse process is called deserialization.

If you want to call a function in another SAP system, you can get this done by calling a Remote Function Call (RFC)-enabled function module of the target system. For example, while you are in SAP ERP Central Component (ECC), you can call a function in the SAP BW system, or vice versa. If the function in the target system is not an RFC-enabled function module, you can wrap that function, which could be a function module, a method, or a program, into an RFC-enabled function module so that you can call this wrapped RFC-enabled function module from the source system.

However, there are two things to consider,

  • The generic format of this RFC-enabled function module. If you need to call 20+ different functions of the target system, you end up with calling 20+ RFC-enabled function modules, either customized or standard. It is not well managed. The question is, can you develop a generic RFC-enabled function module for all these 20+ different functions?
  • Parameters. For each of these 20+ function modules, you may have different import/export/ changing/return parameters. To develop a generic function module, you have to develop a generic expression of the parameters that are of generic data types, can be understood by both source and target systems, and are fit for all function requirements for parameters.

I provide a solution on one generic RFC-enabled function module with serialized parameters for you to call different functions of another system. The simplified architecture of this RFC call is illustrated in Figure 1.

George Chen

George Chen is the owner of Lynk, Inc. An SAP consultant, he has worked on SAP Netweaver ABAP/HANA/BPC/BW/IP/TPM/CRM for the past 17 years. He specializes in process integration, performance tuning, and introducing advanced ABAP design patterns in development. He has worked with SAP America many times to conduct ABAP performance tuning and troubleshooting. His focuses are ABAP for HANA and ABAP OO in SAP NetWeaver.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.