Skip to content

SAP RFC Basics

Frank Wagner edited this page Nov 14, 2022 · 7 revisions

Communication between applications of different systems in the SAP environment includes connections between SAP ABAP systems1 as well as between SAP ABAP systems and non-SAP ABAP systems.

Remote Function Call (RFC) is the standard SAP interface for communication between SAP systems. RFC calls a function to be executed in a remote system. This is also supported for Non-SAP systems.

RFC SAP - Non SAP

The Non-SAP System can be the RFC client, the server or both.

SAP RFC Clients

SAP RFC clients call remote enabled ABAP functions in the SAP system by connecting with a username and logon credentials (normally a password).

Official SAP functions released as remote interfaces are also ofter called BAPIs, however this name is more a reference to the concept behind the API provided by SAP. Technical all BAPIs are also remote enabled functions and there is no difference between customer created remote enabled functions and SAP created interfaces like BAPIs.

SAP RFC client calling ABAP function

To establish the connection a client has to specify the SAP systems application server (ASHOST) and application server instance number (SYSNR). The RFC library then automatically derives the required port from the system instance (e.g. 3200 for instance 00).
For systems with multiple application servers the connection can be established by a message server (MSHOST) and a logon group (GROUP). The message server will then select a application server for the client.

A single SAP system contains multiple data areas (SAP "client") - something like a tenant. All clients in a system use the same code base but different data including the users. Therefore a SAP RFC client has to specify also the parameter CLIENT with the 3 letter client name when login on to a SAP system.

To logon to a SAP system from a RFC client you will have to specify following settings:
  • Application Server

    • Direct connection to a application server:
      ASHOST = <HostName>
      SYSNR = <InstanceNo of ashost>

    • or Message Server
      MSHOST = <HostName>
      SYSID = <SAP System ID>
      GROUP = <Logon Group>

  • Logon credentials
    USER = <username>
    PASSWD = <password of user>
    CLIENT = <SAP client>

SAP RFC Servers

TODO

SAP Netweaver RFC SDK

The SAP NetWeaver RFC SDK is a high performance C/C++ interface for connecting to SAP systems from release R/3 4.6C up to today's SAP S/4HANA systems. It allows to develop programs that call ABAP functionality (RFC clients) as well as programs that can be called from ABAP (RFC servers). As a native library the SDK is available in different platforms builds (for example Windows x86/AMD64, Linux x86/AMD64, etc..).

SAP doesn't allow that their SDKs are distributes by partners or customers. Instead every customer has to license the SDK (the license is included in almost every SAP product) and to download the binaries of the SDK.

YaNco is build in support for only a subset of commands of the RFC SDK. However, that doesn't mean that you cannot use them. You can get a list of all commands and how-to use them from the offical sap documentation: https://support.sap.com/en/product/connectors/nwrfcsdk.html

Footnotes

1 ABAP is the internal programming language of the "classic" SAP environment. SAP Java system use other communication methods - when talking here about SAP Systems, we only consider SAP ABAP systems.

Clone this wiki locally