Before you use an SAP connection, the SAP administrator needs to perform certain prerequisite tasks to configure the Secure Agent machine and SAP system.
To process IDocs and SAP BAPI/RFC functions, you also need to verify if the required licenses are enabled for the SAP system.
Download and configure the SAP libraries
To access SAP data through the Intermediate Documents (IDocs) or BAPI/RFC interface, you need to download and configure the SAP NetWeaver RFC SDK libraries and SAP JCo libraries on the Secure Agent machine. If you encounter any issues while you download libraries, contact SAP Customer Support.
Create the deploy_to_main\bin\rdtm directory if it does not already exist.
4Set the following permissions for each SAP NetWeaver RFC SDK library:
- Read, write, and execute permissions for the current user.
- Read and execute permissions for all other users.
5From the SAP Support Portal, download the latest version of the 64-bit SAP JCo libraries based on the operating system of the machine on which the Secure Agent runs:
Secure Agent System
SAP JCo Libraries
Windows
sapjco3.jar
sapjco3.dll
Linux
sapjco3.jar
libsapjco3.so
6Copy the JCo libraries to the following directory:
Warning: If you copy the value directly from the table, the hyphens (-) in the value might be incorrectly copied. Copy the value to a text editor and make sure that the value you copied is not corrupted.
gClick Save.
hRepeat steps 2 through 7 on every machine where you installed the Secure Agent.
8Restart the Secure Agent.
Configure SAP user authorization
Configure the SAP user account in the SAP system to enable data exchange through Intermediate Documents (IDocs) and BAPI/RFC interfaces.
You need to add the authorization object in SAP to process IDocs and SAP BAPI/RFC functions that helps you interact with SAP at run time. You also need access to specific IDoc and SAP BAPI/RFC functions for the transactions that you want to process.
The following table describes the required authorization to process IDocs and SAP BAPI/RFC functions:
For more information about how to configure SAP user authorization in the SAP system, see SAP user authorizations.
Configure the sapnwrfc.ini file
SAP uses the communications protocol, Remote Function Call (RFC), to interact with external systems.
You need the sapnwrfc.ini file to process SAP IDocs or SAP BAPI/RFC functions that facilitate transfer of data when you read from or write to SAP through the SAP IDoc or SAP BAPI/RFC interface.
Create the sapnwrfc.ini file and include the necessary connection information and RFC-specific parameters required by 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, you need to place the sapnwrfc.ini file in the agent directory. The agent verifies the sapnwrfc.ini file, and then use 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, 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
When you create a connection, the Secure Agent first verifies if an sapnwrfc.ini file exists in the directory. 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>
Define SAP Connector as a logical system in SAP
To receive IDocs from and send IDocs to SAP, you need to define SAP Connector as an external logical system in SAP.
To define SAP Connector as an external logical system, create a single logical system in SAP for IDoc ALE integration with SAP Connector, and then create an RFC destination configured with a tRFC port in the SAP system to communicate with SAP Connector.
To identify the external logical system, you also need to create a partner profile for the logical system that you created.
When you define SAP Connector as a logical system, SAP acknowledges SAP Connector as an external system that can receive outbound IDocs from SAP and send inbound IDocs to SAP.
Note: These instructions apply on the SAP version 4.6C. If you use a different version, the instructions may differ. For more information about how to create a logical system in SAP, see the SAP documentation.
Create a logical system for SAP Connector
You need to define SAP Connector as an external logical system in SAP to uniquely identify SAP Connector as a client within a network.
1Log in to SAP and go to the SALE transaction.
2On the Display IMG window, expand the tree to navigate to the Application Link Enabling > Sending and Receiving Systems > Logical Systems > Define Logical System operation.
3Click the IMG - Activity icon to run the Define Logical System operation.
An informational dialog box appears.
4Click Enter.
The Change View Logical Systems window appears.
5Click New Entries.
6On the New Entries window, enter a name and description for the logical system entry for SAP Connector.
Create an RFC destination
After you create a logical system, you need to create an RFC destination and program ID for SAP Connector in the SAP system.
1Go to the SM59 transaction.
2On the Display and Maintain RFC Destinations window, click Create.
The RFC Destination window appears.
3Enter the name of the logical system you created as the RFC destination.
4To create a TCP/IP connection, enter T as the connection type.
5Enter a description for the RFC destination.
6Click Save.
7For Activation Type, click Registration.
8For Program ID, enter the same name as the RFC destination name.
Use the Program ID as the value for the PROGRAM_ID parameter in the sapnwrfc.ini file.
Create a tRFC port for the RFC destination
After you create an RFC destination and program ID for SAP Connector, you need to create a tRFC port for the RFC destination you defined in SAP. SAP uses the tRFC port to communicate with SAP Connector.
1Go to the WE21 transaction.
2Click Ports > Transactional RFC.
3Click Create.
The Ports in IDoc Processing dialog box appears.
4Click Generate Port Name or Own Port Name and enter a name.
5Click Enter.
6Enter a description for the port.
7Select the IDoc record version type.
8Enter the name of the RFC destination you created.
Create a partner profile for SAP Connector
Create a partner profile for the logical system you defined for SAP Connector. When SAP communicates with an external system, it uses the partner profile to identify the external system.
1Go to the WE20 transaction.
2Click Create.
3Enter the following properties:
Partner Profile Property
Description
Partner number
Name of the logical system you created for SAP Connector.
Partner type
Partner profile type. Enter LS for logical system for ALE distribution systems.
4In the Post-processing tab, enter the following properties:
Partner Profile Property
Description
Type
User type. Enter US for user.
Agent
The SAP user login name.
Lang
Language code that corresponds to the SAP language. Enter EN for English.
5In the Classification tab, enter the following properties:
Partner Profile Property
Description
Partner class
Enter ALE.
Partner status
Indicates the status of communication with the partner. To communicate with the partner, enter A for active.
Create outbound and inbound parameters for the partner profile
After you define a partner profile for SAP Connector, you need to create outbound and inbound parameters for the partner profile.
Outbound parameters define the IDoc message type, IDoc basic type, and port number for outbound IDocs. Inbound parameters define the IDoc message type for inbound IDocs.
SAP uses outbound parameters when it sends IDocs to SAP Connector. Create an outbound parameter for each IDoc message type that SAP sends to SAP Connector. SAP uses inbound parameters when it receives IDocs from SAP Connector. Create an inbound parameter for each IDoc message type that SAP receives from SAP Connector.
1From the Partner Profiles window in SAP, click Create Outbound Parameter.
2On the Partner Profiles: Outbound Parameters window, enter the following properties:
Outbound Parameter Property
Description
Message Type
The IDoc message type the SAP system sends to SAP Connector.
Receiver Port
The tRFC port number you defined.
IDoc Type
The IDoc basic type of the IDocs the SAP system sends to SAP Connector.
3Click Save.
The Packet Size property appears.
4Enter a value between 10 and 200 IDocs as the packet size.
The packet size determines the number of IDocs that SAP sends in one packet to SAP Connector.
5Click Enter.
6Repeat steps from 1 to 5 to create an outbound parameter for each IDoc message type that SAP sends to SAP Connector.
7Click Create Inbound Parameter.
8On the Partner Profiles: Inbound Parameters window, enter the following properties:
Inbound Parameter Property
Description
Message Type
The IDoc message type the SAP system receives from SAP Connector.
Process Code
The process code. The SAP system uses the process code to call the appropriate function module to process the IDocs it receives.
9Click Enter.
10Repeat steps 7 through 9 to create an inbound parameter for each IDoc message type that SAP receives from SAP Connector.