Skip to main content
Version: 5.6

SAP®

With the SAP® plug-in, you can connect the OPC Router to any number of SAP® systems and exchange data via IDocs, BAPIs, and RFC function modules. This allows SAP® systems to be integrated into OPC Router connections as both data sources and data destinations.

The prerequisite is that the respective SAP® system supports RFC technology. The plug-in communicates exclusively via RFC—including IDocs and BAPIs—either via the classic RFC protocol or the NetWeaver RFC protocol. This supports SAP® systems with an RFC interface, such as NetWeaver, ECC 6, and R/3 version 4.0b and later. SAP® systems can not only provide or receive data but also actively trigger data transfers in the OPC Router via triggers.

note

Only the SAP® NetWeaver protocol is supported in Docker.

Contents of this Documentation

Configuring the SAP® Plug-in

Describes the configuration of the SAP® connection, including login procedures, security, language, and advanced settings.

Configuring the SAP® Plug-in

Transfer Objects

Shows how to send data to or read data from SAP® systems using IDoc, BAPI, and RFC transfer objects.

Transfer Objects

Triggers

Explains how a connected SAP® system triggers data transfers in the OPC Router using IDoc and RFC triggers.

Triggers

Examples

Contains end-to-end examples for configuring SAP® transfers.

SAP® Examples

Prerequisites

Depending on the protocol used, certain libraries are required to connect to an SAP® system. SAP® files may not be provided by inray Industriesoftware GmbH (as of 2018). You therefore need a valid SAP® account to obtain the required libraries.

PrerequisiteDescription
NetWeaver RFC protocolRequires installation of the SAP® NetWeaver RFC SDK. For an overview of the SAP® libraries, see the Theobald Software documentation.
RFC Protocol (Classic)Requires the Log-on Pad or the file librfc32.dll. The DLL must be located in the \Windows\System32 directory. If the program is to run in 32-bit mode on 64-bit systems, the 32-bit version of the DLL must be located in \Windows\SysWOW64.
Microsoft Visual C++ 2005 SP1When using librfc32, Microsoft Visual C++ 2005 Service Pack 1 must be installed on some systems.
note

The classic RFC library librfc32 is no longer being developed by SAP and has not been supported since March 31, 2016 (end of support with SAP® Release 7.10). Its successor is the SAP® NetWeaver RFC SDK, which is therefore recommended for new integrations. The classic RFC protocol via librfc32 is now only available in the OPC Router for compatibility reasons.

Required SAP® Authorizations

In order for the OPC Router to communicate with the SAP® system, the SAP® user must have certain authorizations.

Minimum authorizations for establishing a connection:

S_RFC RFC_TYPE=FUGR ;RFC_NAME=SYST ;ACTVT=16 ;
S_RFC RFC_TYPE=FUGR ;RFC_NAME=RFC1 ;ACTVT=16 ;

Querying tables and table metadata:

S_RFC            RFC_TYPE=FUGR ;RFC_NAME=SDTX ;ACTVT=16 ;
S_RFC RFC_TYPE=FUGR ;RFC_NAME=SDIFRUNTIME ;ACTVT=16 ;
S_TABU_DIS ACTVT=03 ;DICBERCLS=&NC;& ;

Lookup table for IDocs (EDBAS) or the following separate authorization check for each table to be read:

S_RFC            RFC_TYPE=FUGR ;RFC_NAME=SDTX ;ACTVT=16 ;
S_RFC RFC_TYPE=FUGR ;RFC_NAME=SDIFRUNTIME ;ACTVT=16 ;
S_TABU_DIS ACTVT=03 ;DICBERCLS=XXXX ;
S_TABU_NAM ACTVT = 03; TABLE = DD02V

XXXX is the authorization group for the table. You can find out which authorization group belongs to which table in table TDDAT (for example, via SE16). If the table is not listed there, the authorization group &NC;& applies. To authorize individual tables, use the authorization object S_TABU_NAM instead of S_TABU_DIS.

When using user-defined functions such as Z_XTRACT_IS_TABLE_COMPRESSION, Z_XTRACT_IS_TABLE, or Z_XTRACT_IS_TABLE_JOIN:

S_RFC            RFC_TYPE=FUGR ;RFC_NAME=XXXX ;ACTVT=16 ;

XXXX is the name of the function group in which the user-defined function module is located.

Looking Up and Executing an SAP® Query:

S_RFC            RFC_TYPE=FUGR ;RFC_NAME=AQRC ;ACTVT=16 ;

Setting Up the SAP® Connection

  1. Open the plug-in by clicking “SAP” in the “Plug-ins” menu.
  2. Click the plus button or double-click an existing entry.
  3. Configure the necessary settings (see Configuring the SAP® Plug-in).
  4. Use “Test Connection” to verify that the connection is established.
  5. Confirm by clicking “OK.”

The SAP® system is then available for configuring a connection.

note

Use the “Test” button to check the connection and prevent runtime errors. Changes are not applied until you confirm with “OK.”

note

If the connection is secured via Secure Network Communications (SNC), the SAP® Crypto files are also required: All users must have access to the PSE file, and the environment variable SECUDIR must be set to the path to the SAP® Crypto files, for example, C:\sapcrypto\nt-x86_64\sec. These files are not required for connections using Basic Authentication.

Typical Use Cases

  • Transfer of production and order data between the shop floor and the SAP® system
  • Posting of material, warehouse, and quality data via BAPIs
  • Exchange of business documents via IDocs
  • Calling customer-specific function modules via RFC
  • Triggering data transfers by the SAP® system via IDoc and RFC triggers