SAP uses the communications protocol, Remote Function Call (RFC), to interact with external systems.
You need the sapnwrfc.ini file to write data to SAP tables.
Create the sapnwrfc.ini file and include the required connection information and RFC-specific parameters for the SAP connection type. You can use a DOS editor or WordPad to create the sapnwrfc.ini file, so that you can avoid errors commonly introduced by Notepad. Check out Sample sapnwrfc.ini files for connection types to know more about the sapnwrfc.ini file samples that you can use for different connection types.
After you create the sapnwrfc.ini file, place the sapnwrfc.ini file in the agent directory. The agent verifies the sapnwrfc.ini file, and then uses it for the configured connection.
Placing the sapnwrfc.ini file in the agent directory
You can use the Secure Agent or serverless runtime environment to connect to the SAP system as an RFC client, as follows:
- To use a Secure Agent, place the sapnwrfc.ini file in the following location:
Note: Ensure the deploy_to_main\bin\rdtm directory exists. If it does not exist, create it and then place the files.
Restart the agent after placing the file in the required directory.
Upgrading from an earlier version
If you are upgrading from an earlier version, you do not need to create an sapnwrfc.ini file. The Secure Agent copies the sapnwrfc.ini file to the deploy_to_main\bin\rdtm directory.
Verifying the sapnwrfc.ini file
If you have specified both the path and file name for the sapnwrfc.ini file in the SAP Table connection, the Secure Agent uses the sapnwrfc.ini file. However, if you define only the path of the sapnwrfc.ini file in the connection, the Secure Agent first verifies if an sapnwrfc.ini file exists in the specified path. If the sapnwrfc.ini file exists, the Secure Agent uses the sapnwrfc.ini file. Else, an exception occurs.
Sample sapnwrfc.ini files for connection types
You can use the sapnwrfc.ini file to configure the following types of connections:
Connection to an SAP application server
Create this connection to enable communication between an RFC client and an SAP system. Each connection entry specifies one application server and one SAP system.
The following sample shows a connection entry for a specific SAP application server in the sapnwrfc.ini file:
DEST=sapr3 ASHOST=sapr3 SYSNR=00
Connection for SAP load balancing
Create this connection to enable SAP to create an RFC connection to the application server with the least load at run time. Use this connection when you want to use SAP load balancing.
The following sample shows a connection entry for SAP load balancing in the sapnwrfc.ini file:
You can configure the following parameters in the sapnwrfc.ini file for various connection types:
sapnwrfc.ini Parameter
Description
Applicable Connection Types
DEST
Logical name of the SAP system for the connection.
All DEST entries must be unique. You need to have only one DEST entry for each SAP system.
For SAP versions 4.6C and later, use up to 32 characters. For earlier versions, use up to eight characters.
Use this parameter for the following types of connections:
- Connection to a specific SAP application server
- Connection to use load balancing
- Connection to an RFC server program registered at an SAP gateway
ASHOST
Host name or IP address of the SAP application. The Secure Agent uses this entry to attach to the application server.
Use this parameter to create a connection to a specific SAP application server.
SYSNR
SAP system number.
Use this parameter to create a connection to a specific SAP application server.
R3NAME
Name of the SAP system.
Use this parameter to create a connection to use SAP load balancing.
MSHOST
Host name of the SAP message server.
Use this parameter to create a connection to use SAP load balancing.
GROUP
Group name of the SAP application server.
Use this parameter to create a connection to use SAP load balancing.
PROGRAM_ID
Program ID. The Program ID must be the same as the Program ID for the logical system that you define in the SAP system to send or receive IDocs.
Use this parameter to create a connection to an RFC server program registered at an SAP gateway.
GWHOST
Host name of the SAP gateway.
Use this parameter to create a connection to an RFC server program registered at an SAP gateway.
GWSERV
Server name of the SAP gateway.
Use this parameter to create a connection to an RFC server program registered at an SAP gateway.
TRACE
Debugs RFC connection-related problems.
Set one of the following values based on the level of detail that you want in the trace:
- 0. Off
- 1. Brief
- 2. Verbose
- 3. Full
Use this parameter for the following types of connections:
- Connection to a specific SAP application server
- Connection to use load balancing
- Connection to an RFC server program registered at an SAP gateway
The following snippet shows a sample sapnwrfc.ini file:
/*===================================================================*/ /* Connection to an RFC server program registered at an SAP gateway */ /*===================================================================*/ DEST=<destination in RfcRegisterServer> PROGRAM_ID=<program-ID, optional; default: destination> GWHOST=<host name of the SAP gateway> GWSERV=<service name of the SAP gateway> *===================================================================*/ /* Connection to a specific SAP application server */ /*===================================================================*/ DEST=<destination in RfcOpenConnection> ASHOST=<Host name of the application server.> SYSNR=<The back-end system number.> /*===================================================================*/ /* Connection to use SAP load balancing */ /* The application server will be determined at run time. */ /*===================================================================*/ DEST=<destination in RfcOpenConnection> R3NAME=<name of SAP system, optional; default: destination> MSHOST=<host name of the message server> GROUP=<group name of the application servers, optional; default: PUBLIC>