SAP Connector > Part II: SAP Connector Administration > SAP Connector administration > SAP IDocs and RFCs/BAPI Connector administration
  

SAP IDocs and RFCs/BAPI Connector administration

Before you can use an SAP connection to process data through IDocs or RFCs/BAPIs, an SAP administrator must perform the following tasks:
  1. 1. Verify if the required licences are enabled.
  2. 2. Download and install the Microsoft Visual C++ Redistributable.
  3. 3. Download and configure the SAP libraries.
  4. 4. Configure the sapnwrfc.ini file.
  5. 5. Define SAP Connector as an external logical system in SAP.
  6. 6. Configure SAP user authorization.
  7. 7. To process data through IDocs, install and configure the SAP Metadata utility.
After the administrator has performed the configuration, you can create and use SAP RFC/BAPI, IDoc Reader, and IDoc Writer connections in mappings.

Step 1. Verifying if the required licences are available for SAP IDocs and RFCs/BAPI Connector

You must verify if the required licences for SAP IDocs and RFCs/BAPI Connector are available before you create an SAP connection and process data through IDocs or RFCs/BAPIs.
    1. In the Data Integration home page, click the Administrator tab.
    2. Under Licences, verify if the SAP Table Connector licence is enabled.

Step 2. Downloading and installing the Microsoft Visual C++ Redistributable

If you do not have Microsoft Visual C++ (VC++) installed, download and install the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package on the Windows machine that hosts the Secure Agent. You can then run applications developed with VC++.
Perform the following steps to install the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package:
    1. Click the following URL:
    http://www.microsoft.com/technet/security/bulletin/MS09-035.mspx
    2. Scroll down and find the Affected Software section.
    3. Download and install the package titled Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package (KB973544). Use the following URL to download the package:
    https://www.microsoft.com/en-us/download/details.aspx?id=14431
    For more information, see the following SAP Notes: 1375494 and 1025361

Step 3. Downloading and configuring SAP libraries for IDoc and BAPI/RFC

Download and configure the SAP NetWeaver RFC SDK libraries. Contact SAP Customer Support if you encounter any issues when you download the libraries.
Note: If you performed this step for an SAP table connection, you do not need to do it again.
    1. Go to the SAP Service Marketplace: http://service.sap.com
    Note: You must have SAP credentials to access the Service Marketplace.
    2. Download the SAP NetWeaver RFC SDK 7.50 libraries that are specific to the operating system that hosts the Secure Agent process.
    The following table lists the libraries corresponding to the different operating systems:
    Operating System
    SAP NetWeaver RFC SDK Libraries
    Linux 64
    • - libicudata.so.50
    • - libicudecnumber.so
    • - libicui18n.so.50
    • - libicuuc.so.50
    • - libsapnwrfc.so
    • - libsapucum.so
    Windows 64
    • - icudt50.dll
    • - icuin50.dll
    • - icuuc50.dll
    • - libicudecnumber.dll
    • - libsapucum.dll
    • - sapnwrfc.dll
    3. Copy the SAP NetWeaver RFC SDK 7.50 libraries to the following directory:
    <Informatica Secure Agent installation directory>\apps\Data_Integration_Server\ext\deploy_to_main\bin\rdtm\
    Create the deploy_to_main\bin\rdtm directory if it does not already exist.
    Note: If you upgrade from a 32-bit operating system, the Secure Agent copies the 32-bit SAP NetWeaver RFC SDK 7.50 libraries to the directory. You must replace the 32-bit libraries with 64-bit libraries. If you upgrade from a 64-bit operating system, you do not need to perform this step. The Secure Agent copies the 64-bit SAP NetWeaver RFC SDK 7.50 libraries to the directory.
    4. Set the following permissions for each NetWeaver RFC SDK library:
    5. Download the 64-bit SAP JCo libraries based on the operating system on which the Secure Agent runs:
    Secure Agent System
    SAP File Name
    Windows
    sapjco3.jar
    sapjco3.dll
    Linux
    sapjco3.jar
    libsapjco3.so
    Verify that you download the most recent version of the libraries.
    6. Copy the JCo libraries to the following directory:
    <Informatica Secure Agent installation directory>\apps\Data_Integration_Server\ext\deploy_to_main\bin\rdtm-extra\tpl\sap
    Create the deploy_to_main\bin\rdtm-extra\tpl\sap directory if it does not already exist.
    Note: If you upgrade from a 32-bit operating system, the Secure Agent copies the 32-bit SAP JCo libraries to the directory. You must replace the 32-bit JCo libraries with 64-bit JCo libraries. If you upgrade from a 64-bit operating system, you do not need to perform this step. The Secure Agent copies the 64-bit SAP JCo libraries to the directory.
    7. Configure the JAVA_LIBS property in Data Integration.
    1. a. Log in to Data Integration.
    2. b. Click Runtime Environments to access the Runtime Environments page.
    3. c. To the left of the agent name, click Edit Secure Agent.
    4. d. From the Service list, select Data Integration Server.
    5. e. From the Type list, select Tomcat JRE.
    6. f. Enter the JAVA_LIBS value based on the operating system on which the Secure Agent runs.
    7. Operating System
      Value
      Windows
      ../bin/rdtm-extra/tpl/sap/sapjco3.jar;../bin/rdtm/javalib/sap/sap-adapter-common.jar
      Linux
      ../bin/rdtm-extra/tpl/sap/sapjco3.jar:../bin/rdtm/javalib/sap/sap-adapter-common.jar
      Note: Copy the value to a text editor and make sure that the value you copied is not corrupted. If you copy the value directly from the table, the hyphens (-) in the value are incorrectly copied.
    8. g. Click OK to save the changes.
    9. h. Repeat steps 2 through 7 on every machine where you installed the Secure Agent.
    8. Restart the Secure Agent.

Step 4. Configuring sapnwrfc.ini

SAP uses the communications protocol, Remote Function Call (RFC), to communicate with other systems. SAP stores RFC-specific parameters and connection information in a file named sapnwrfc.ini. To enable the Secure Agent to connect to the SAP system as an RFC client, create and configure the sapnwrfc.ini file on the machines that host the Secure Agent.
When you read data from SAP tables, if you define the path and file name of the sapnwrfc.ini file in the SAP 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.
To process data through RFC/BAPIs, read IDocs, write IDocs, and write data to SAP tables, you cannot use the sapnwrfc.ini file.
Use a DOS editor or WordPad to configure the sapnwrfc.ini file. Notepad can introduce errors to the sapnwrfc.ini file.
After you create the sapnwrfc.ini file, copy the file to the following directory and restart the Secure Agent:
<Informatica Secure Agent installation directory>\apps\Data_Integration_Server\ext\deploy_to_main\bin\rdtm\
Create the deploy_to_main\bin\rdtm directory if it does not already exist.
Note: If you are upgrading from an earlier version, you do not need to perform this step. The Secure Agent copies the sapnwrfc.ini file to the directory.
For the serverless runtime environment, the sapnwrfc.ini file is copied from the AWS location to the following serverless agent directory:
/data2/home/cldagnt/SystemAgent/apps/Data_Integration_Server/ext/deploy_to_main/bin/rdtm

Configure the connection entries in the sapnwrfc.ini file

Use the sapnwrfc.ini file to configure the connections that you want to use.
You can configure the following types of connections in the sapnwrfc.ini file:
Connection to a specific 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 to use 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:
DEST=sapr3
R3NAME=ABV
MSHOST=infamessageserver.informatica.com
GROUP=INFADEV
Connection to an RFC server program registered at an SAP gateway
Create this connection to connect to an SAP system from which you want to receive outbound IDocs.
The following sample shows a connection entry for an RFC server program registered at an SAP gateway in the sapnwrfc.ini file:
DEST=sapr346CLSQA
PROGRAM_ID=PID_LSRECEIVE
GWHOST=sapr346c
GWSERV=sapgw00

sapnwrfc.ini parameters

The following table describes the parameters that you can define for various connection types in the sapnwrfc.ini file.
sapnwrfc.ini Parameter
Description
Applicable Connection Types
DEST
Logical name of the SAP system for the connection.
All DEST entries must be unique. You must 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

Sample sapnwrfc.ini file

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>

Step 5. Defining SAP Connector as a logical system in SAP

To use SAP Connector to send and receive IDocs from SAP, you must define SAP Connector as an external logical system in SAP.
Create a single logical system in SAP for IDoc ALE integration with SAP Connector. 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.
Perform the following steps to define SAP Connector as a logical system:
  1. 1. Create a logical system in SAP for SAP Connector.
  2. 2. Create an RFC destination for SAP Connector.
  3. 3. Create a tRFC port for the RFC destination.
  4. 4. Create a partner profile for SAP Connector.
  5. 5. Create outbound and inbound parameters for the partner profile.
Note: These steps are based on SAP version 4.6C. The steps may differ if you use a different version. For complete instructions on creating a logical system in SAP, see the SAP documentation.

Step 1. Create a logical system for SAP Connector

To uniquely identify SAP Connector as a client within a network, define SAP Connector as an external logical system in SAP.
    1. Go to transaction SALE.
    The Display IMG window appears.
    2. Expand the tree to navigate to the Application Link Enabling > Sending and Receiving Systems > Logical Systems > Define Logical System operation.
    3. Click the IMG - Activity icon to run the Define Logical System operation.
    An informational dialog box appears.
    4. Click Enter.
    The Change View Logical Systems window appears.
    5. Click New Entries.
    The New Entries window appears.
    6. Enter a name and description for the logical system entry for SAP Connector.

Step 2. Create an RFC destination

Create an RFC destination and program ID for SAP Connector.
    1. Go to transaction SM59.
    The Display and Maintain RFC Destinations window appears.
    2. Click Create.
    The RFC Destination window appears.
    3. Enter the name of the logical system you created as the RFC destination.
    4. To create a TCP/IP connection, enter T as the connection type.
    5. Enter a description for the RFC destination.
    6. Click Save.
    7. For Activation Type, click Registration.
    8. For 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.

Step 3. Create a tRFC port for the RFC destination

Create a tRFC port for the RFC destination you defined in SAP. SAP uses the tRFC port to communicate with SAP Connector.
    1. Go to transaction WE21.
    2. Click Ports > Transactional RFC.
    3. Click Create.
    The Ports in IDoc Processing dialog box appears.
    4. Click Generate Port Name or Own Port Name and enter a name.
    5. Click Enter.
    6. Enter a description for the port.
    7. Select the IDoc record version type.
    8. Enter the name of the RFC destination you created.

Step 4. 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.
    1. Go to transaction WE20.
    2. Click Create.
    3. Enter 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.
    4. In 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.
    5. In 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.

Step 5. 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.
    1. From the partner profiles window, click Create Outbound Parameter.
    The Partner Profiles: Outbound Parameters window appears.
    2. 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.
    3. Click Save.
    The Packet Size property appears.
    4. Enter 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.
    5. Click Enter.
    6. Repeat steps from 1 to 5 to create an outbound parameter for each IDoc message type that SAP sends to SAP Connector.
    7. Click Create Inbound Parameter.
    The Partner Profiles: Inbound Parameters window appears.
    8. For each inbound parameter, 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.
    9. Click Enter.
    10. Repeat steps 7 through 9 to create an inbound parameter for each IDoc message type that SAP receives from SAP Connector.

Step 6. Configuring SAP user authorizations

An SAP administrator needs to create a profile in the development, test, and production SAP system so that you can use the integration features. This profile name must include authorization for the objects and related activities. The profile on the test system should be the same as the profile on the production system.
The setup of the user and profiles is done within SAP using the SAP GUI. This activity is external to Data Integration.
BAPI/RFC
The following table describes the authorization an SAP user requires to execute tasks using the BAPI/RFC functions:
Authorization Object
Authorization Value
S_RFC
SYST, SDTX, SDIFRUNTIME, RFC1, RFC2
Note: In addition to the above authorization, the user needs access to any BAPI/RFC function that needs to be executed.
IDoc
The following table describes the authorization an SAP user requires to execute tasks with IDoc messages:
Authorization Object
Authorization Value
S_RFC
SYST, SDTX, SDIFRUNTIME, RFC1, RFC2, EDIMEXT
Note: In addition to the above authorization, the user needs access to specific IDoc and underlying transactions that needs to be executed.

Step 7. Installing and configuring the SAP IDocs Metadata utility

To import IDoc metadata from SAP systems and generate mapplets, you need to install and configure the SAP Metadata utility.

Prerequisites

Before you use the SAP Metadata utility to process data through IDocs, verify the following prerequisites:

Installation and configuration

Install and configure the SAP Metadata utility to process data through IDocs on the machine that hosts the Secure Agent.
    1. Download the SAP Metadata utility zip file, SapUtility.zip from the Informatica Cloud Community.
    2. Unzip the file to a local directory.
    Avoid using spaces in the directory name because spaces can cause imports to fail.
    3. Edit the <SAP Metadata utility download directory>/SAPUtil.bat file to define the CLASSPATH and JAVA_HOME variables.
    1. a. Enter the SAP JCo libraries directory and the sapjco3.jar file name in the CLASSPATH variable and remove “REM” from the following line:
    2. REM SET CLASSPATH=%CLASSPATH%;<Location of sapjco3.jar>\sapjco3.jar
      For example: SET CLASSPATH=%CLASSPATH%;C:\SAP\JCo\sapjco3.jar
    3. b. Enter the JAVA JRE directory in the JAVA_HOME variable and remove “REM” from the following line:
    4. REM SET JAVA_HOME=<JRE_LOCATION>
      For example: SET JAVA_HOME=C:\Program Files (x86)\Informatica Cloud Secure Agent\jre
      Use the JAVA JRE included with the Informatica Cloud Secure Agent.
    4. Save and close the batch file.