Changes to SAP CoNNectors with sapnwrfc Library

Problem

In NLINK Server version 5.x (or later), the SAP CoNNectors use a newer version of the SAP RFC Library. There are several differences in this library that affect the NLINK Server.

Solution

INI file

The new library uses a different ini file: sapnwrfc.ini instead of saprfc.ini.

  • The file name has to be “sapnwrfc.ini” and is in UTF-8 format.
  • The location of this ini file is NLINK’s Config folder. The location is not configurable.

Location of SAP Trace Files

SAP’s sapnwrfc library does not use the old environment constants to specify where the SAP trace files go. This information is now in the sapnwrfc.ini file.

  • Set “RFC_TRACE_DIR” in sapnwrfc.ini. It should be set to fully qualified path e.g., RFC_TRACE_DIR=C:\Program Files\Junot Systems\Logs

Note

Do not include double-quotes around the path name, even if parts of the path have spaces.

RFC Listener

Connections still show up in SAP even though a network error disconnects NLINK and SAP machines.
Please see SAP Note 1332022 for information about setting various gateway parameters in SAP system.

Inbound Docs

In order to establish the registered connection, the new library requires that the client (NLINK) provide a full definition of the SAP function IDOC_INBOUND_ASYNCHRONOUS. This definition exists in the SAP data dictionary, but NLINK needs a user in order to connect and get the definition.

Thus, inbound IDocs now need all the SAP connection parameters:

  • NLINK->SAP Destination or Hostname / System Number
  • Client
  • User ID
  • Password
  • Language

Inbound IDoc and RFC Listener Settings in sapnwrfc.ini

The new library requires a parameter PROGRAM_ID in the ini file instead of the old parameter PROGID.

For example an entry in sapnwrfc.ini could be as follows:

DEST=SAPTEST
PROGRAM_ID=nlink_test1
GWHOST=saptest123
GWSERV=sapgw01

If PROG_ID is used you may see an error while connecting to SAP (for IDOC error will be as below, similar error will be there for RFC listener):

CoNNector:: SAP IDOC CoNNector: Could not connect to SAP system. Will retry.
ERROR  illegal parameter value ( function=SAP_CMREGTP2 / parameter=tpname / value= )
TIME Mon Mar 29 14:21:22 201
RELEASE 711
COMPONENT CPIC (TCP/IP) with Unicode
VERSION 3
RC 769
MODULE  r3cpic.c
LINE 12816
COUNTER 1
: [missing argument 2]