Setting up an RFC server - 7.3

Version
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance > Third-party systems > Business applications > SAP components
Data Quality and Preparation > Third-party systems > Business applications > SAP components
Design and Development > Third-party systems > Business applications > SAP components
Last publication date
2021-08-06

Setting up an RFC server

Perform several procedures to configure your SAP RFC server.

This section walks you through creating a user and an RFC destination, as well as configuring the RFC server and the services files.

Creating an SAP user

You can either create a dialog user or a technical user. However, it is recommended that you create a technical user as their password does not expire.

Procedure

Create a user profile that has rights to the following:
  • rights to make RFC calls, at least the Authorization check for RFC Access role
  • rights to access the authorization objects of any IDoc

Creating an RFC Destination

You can create an RFC destination that points to Talend SAP RFC Server using the SAP transaction SALE or SM59 that leads directly to the configuration.

Before you begin

Before proceeding with the following steps, make sure that an SAP user has been created to connect with Talend Jobs and Talend SAP RFC Server.

Procedure

  1. Log on to SAP as SAP Admin using SAP GUI.
  2. Go to the SAP transaction SALE or SM59 that leads directly to the configuration.
  3. Click Create RFC Connections and then choose to create a new TCP/IP based RFC destination, TALEND_TL_RFC_DESTINATION in this example.
  4. In the Technical Settings tab, select Registered Server Program for Activation Type, and then configure Program ID and Gateway Options accordingly.
    Remember: The SAP Program ID has to be identical to the entry in Talend SAP RFC Server.
  5. In the Unicode tab, set the Unicode/Non-Unicode configuration.
    Tip: Unicode is highly recommended.
  6. Configure Talend SAP RFC Server by editing its configuration file if needed.
  7. Start Talend SAP RFC Server.

    For more information about configuring and starting Talend SAP RFC Server, see the article Installing and configuring Talend SAP RFC Server.

  8. Click Connection Test to check the connection status to Talend SAP RFC Server.

Results

If all parameters are configured correctly, you should get a similar screen as shown below. This shows that a Talend Job using the tSAPIDocReceiver component is now ready to receive IDocs.

Configuring the RFC server

Set up the sapjco3.jar file and add it to your Talend installation folder.

Procedure

  1. Download the sapjco3.jar file from the SAP marketplace.
  2. Add the file to the <Talend_installation> /sap-rfc-server/user/lib folder:
    • Windows: Copy the sapjco3.dll file to C:\\Windows\System32.
    • Linux: Copy the libsapjco3.so to the lib directory of the Java installation, for example, /usr/java/jre1.8.0_171/lib. If you have installed Java in a 64-bit system, copy the libsapjco3.so file to the /usr/java/jre1.8.0_171-amd64/lib/amd64 subdirectory folder.

Configuring the tsap-rfc-server.properties file

The configuration file tsap-rfc-server.properties for Talend SAP RFC Server is located under the $TSAPS_HOME/conf directory (where $TSAPS_HOME corresponds to the directory where the Talend SAP RFC Server has been installed). This file consists of seven sections. Before starting Talend SAP RFC Server, you can configure the file to enable some additional features of the server according to your needs.

Note:
  • Talend SAP RFC Server doesn't support the SAP cluster configuration.
  • Any change of the configuration file requires a restart of the Talend SAP RFC Server.

Before the sections

#destination_name=RFC destination : Sets the RFC destination. You need to set this parameter when the RFC destination differs from its program ID. With this parameter enabled, the value of this parameter is used as the import parameter IV_RFC_DESTINATION of BAPI /CMT/TLND_TABLE_JOIN_STREAM. Otherwise, the program ID (jco.server.progid) is used as the import parameter.

Note: This parameter is effective only if you have installed the R2020-10 RFC server update or a later one delivered by Talend. The update is available here.

Feature section

The Feature section details the connection information to enable functionalities involving the Talend SAP RFC Server.

#feature.idoc.enabled: Enables the IDoc feature.

#feature.idoc.transactional: Enables the transactional management feature.

  • Reports the entire transaction as a failure to SAP when a message does not get delivered to the JMS broker.
  • Automatically reconnects to the remote JMS broker.

#feature.idoc.transactionAbortTimeOut: Refers to the timeout value in milliseconds.

#feature.bw_source_system.enabled: Enables the BW source system feature.

#feature.streaming.enabled: Enables the streaming mode features (requires a remote connection to a Kafka cluster)
Note: Install a Kafka server version 2.1 onwards prior to using the streaming mode feature. For more information, refer to http://kafka.apache.org/quickstart.

#feature.streaming.timeout: Refers to the timeout value for the streaming to start.

#feature.idoc.mock.enabled: Replaces the IDoc receiver with a mock producing an IDoc package every five seconds.

#feature.streaming.threadCount: The number of threads for data extraction. The default is 2.

#feature.streaming.topic.partitionCount: Kafka topic partition count. The default is 2.

#feature.streaming.topic.replicationFactor: Kafka topic replication factor. The default is 1.

Note: The #feature.streaming.threadCount, #feature.streaming.topic.partitionCount, and #feature.streaming.topic.replicationFactor parameters are effective only if you have installed the R2020-08 Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

SAP JCO server section

The SAP JCO Server section details the SAP information the RFC server needs to connect through RFC calls to SAP.
  • jco.server.gwhost and jco.server.gwserv are required
  • jco.server.progid serves as the identifier for IDOC on the gateway and as the destination in the SAP system
  • jco.server.connection_count refers to the number of connections that is registered at the gateway
  • jco.server.worker_thread_count refers to the number of threads that can be used by the JCOServer instance
  • jco.server.worker_thread_min_count refers to the number of threads that are kept running by the JCOServer instance
  • jco.server.trace is not needed, but can be useful for debugging

# jco.server.gwhost: SAP gateway host on which the RFC server should be registered (mandatory).

# jco.server.gwserv: SAP gateway service, i.e. the port used for the registration (mandatory).

# jco.server.progid: Identifier for IDoc on the gateway and as the destination in the SAP system.

# jco.server.connection_count: Number of connections registered at the gateway.

# jco.server.worker_thread_count: Number of threads that can be used by the JCOServer instance.

# jco.server.worker_thread_min_count: Number of threads that are kept running by the JCOServer instance.

# jco.server.trace: Enables or disables the RFC trace, this is useful for debugging.

SAP JCO client section

The SAP JCO client section includes the connection information to the SAP ABAP server. You need all the options provided and you can use the credentials of the user with RFC call rights.

Set the password in clear text, which is then overwritten with the # number sign value when the Talend SAP RFC Server starts.

JMS broker section

The JMS Broker section sets up the interaction with the embedded or remote JMS broker.

To enable user authentication, you need to uncomment the following three parameters and set their values. If you don't enable user authentication, the tSAPIDocReceiver component or the tSAPDataSourceReceiver component can also connect to Talend SAP RFC Server without setting the value for their user and password fields.

#jms.login.config=conf/user-authentication/login.config: File system directory containing JAAS authentication configuration.

#jms.login.username: JAAS username used to authenticate a publisher or sender.

#jms.login.password: JAAS password used to authenticate a publisher or sender.

Note: The username and password values are used by the tSAPIDocReceiver or the tSAPDataSourceReceiver component to connect to the Talend SAP RFC Server. They must also exist in the $TSAPS_HOME/conf/user-authentication/users.properties file. In this file, each row represents a username and a password pair, where the username value is on the left side of the equals sign and the password value is on the right side of the equals sign.

To enable the SSL transport mechanism, copy the key store file for SSL to the $TSAPS_HOME/conf folder. Then uncomment the following two parameters (the path to the key store file and the password for the key store file) in the configuration file and set their values

#jms.login.configDomain=tsaps-domain: Domain of JAAS authentication configuration to use.

#jms.ssl.keystore.path: The path to a key store for SSL.

#jms.ssl.keystore.password: A password for a key store for SSL.

#jms.durable.queue.replicate: Whether JMS messages should be replicated in durable queues.

#jms.durable.queue.retentionPeriod: Retention period for JMS messages in durable queues in milliseconds (by default: 7 days).

Embedded broker section

The Embedded Broker section details the connection information of the used embedded JMS broker. If you use an external JMS broker, these values are commented out. The following lists the settings:

#jms.bindAddress: The host address and port (ex: tcp://localhost:61616) for the JMS broker to listen for incoming connections.

#jms.persistent: Whether JMS messages are persisted or not. This way, the Talend SAP RFC Server keeps a copy of all IDocs received in queues named after the IDoc. This is meant to serve the tSAPIDocsReceiver component in batch mode. When the receiver runs, it collects all IDocs stored in the durable queues since the last time it ran.

By default, messages are kept in the queues for up to seven days. You can change the retention period by uncommenting this parameter in the configuration file and updating its value to meet your own requirement.

#jms.dataDirectory: File system location used by the JMS broker to persist data.

#jms.useJmx: Sets whether or not the Broker's services should be exposed into JMX or not.

Remote broker section

The Remote Broker section details the connection information to a remote or external broker. If you use an embedded broker, this section is commented out. The following lists the settings:

#jms.broker.url: When active, connects to a remote broker instead of an embedded one.

#jms.reconnect.interval: Interval between reconnections attempts.

#rfc.server.remote.broker.url: URLs of the brokers for failover. Broker URLs need to be provided in this form: rfc.server.remote.broker.url=failover:(tcp://ip_address1:port_number1,tcp://ip_address2:port_number2, ...).

Note: The rfc.server.remote.broker.url parameter is effective only if you have installed the R2021-01 RFC server update or a later one delivered by Talend. For more information, check with your administrator.

Kafka section

The Kafka section details the Kafka connection information needed to use the streaming mode feature. It also contains settings for configuring an Azure eventhub as a Kafka cluster.

  • kafka.bootstrap.servers={YOUR.EVENTHUBS.FQDN}:9093
  • kafka.security.protocol=SASL_SSL
  • kafka.sasl.mechanism=PLAIN
  • kafka.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="$ConnectionString" password="{YOUR.EVENTHUBS.CONNECTION.STRING}";

For information about configuring an Azure eventhub as a Kafaka cluster, go to Quickstart: Data streaming with Event Hubs using the Kafka protocol.

kafka.bootstrap.servers=<kafka_setting>: List of host and port pairs that are the addresses of the Kafka brokers.

Configuring the services file

In the SAP configuration, you can see that the host name is specified. However, it is not true for the port because the port is in a standard range and must be specified in the services file on the client machine.

You can find the services file in:

  • Windows: C:\\Windows\System32\\drivers\etc\services
  • Linux or Unix-based systems: /etc/services

Procedure

Specify the port in the services file.
  1. Determine the port number by checking the SAP JCO server section.
    The following image shows you the configuration of the SAP Gateway Server, sapgw31:

    The last two numbers of the sapgw determines the last two numbers of the port. From the previous example, you get 31. The range for the last two port numbers is from 00 to 99.

    The default ranges for SAP include 3200 to 3299 for sapdp and 3300 to 3399 for sapgw.

Configuring your machine

To run SAP RFC Jobs in the Talend Studio, copy the sapjco3.dll file to the executable path in your machine.

Procedure

  1. Go to the %PATH% environment on your machine.
  2. For Windows users, paste the sapjco3.dll file to the C:\\Windows\System32 directory.

Starting or stopping the RFC server

You can manually start or stop the RFC server by running the scripts or batch files in the bin directory.

Procedure

  1. Check if the process is running.
    • Linux: run the ps command
    • Windows: check the Task Manager
  2. Optional: Linux users: set up the RFC server as a Linux service.
    On RedHat and Ubuntu, the systemd service is used to start and stop services. You can find the files that control the systemd service in /etc/systemd/system.

    From the example, the sap-rfc file is added and not installed by default. If you wish to add your RFC server, use the following sample service file and ensure to change the paths that suit your installation:

    
    # SystemD descriptor file for Talend SAP RFC Server
    
    [Unit]
    
    Description=Talend SAP RFC Server service
    
    Before=runlevel3.target runlevel5.target
    
    After=local-fs.target remote-fs.target network-online.target time-sync.target systemd-journald-dev-log.socket
    
    Wants=network-online.target
    
    Conflicts=shutdown.target
    
    
    [Service]
    
    Type=simple
    
    Environment=JAVA_HOME=/usr/java/jre1.8.0_171-amd64
    
    ExecStart=/opt/talend/7.0.1/sap-rfc-server/bin/start-tsaps.sh
    
    ExecStop=/opt/talend/7.0.1/sap-rfc-server/bin/stop-tsaps.sh
    
    User=talenduser
    
    Group=talendgroup
    
    WorkingDirectory=/opt/talend/7.0.1/sap-rfc-server
     
    
    [Install]
    
    WantedBy=multi-user.target
  3. Start or stop your RFC server.

Verifying the connection to the SAP RFC system

Check if Talend Studio has successfully connected to the SAP RFC system.

Procedure

  1. Logon to the SAP GUI.
  2. Go to the transaction SM59.
  3. Select the RFC destination from the list of TCP/IP connections. This displays a window with information about the RFC destination.
  4. Click Connection Test.

Debugging

The SAP RFC server receives the IDocs and places these into the JMS topic. One IDoc type results to one topic.

If the embedded JMS broker is used, the topics are not visible. To check what data is stored and to see if messages are received from SAP or consumed by the Job, you need to configure an SAP RFC server that uses an external JMS broker.

Tip: You can use the Apache ActiveMQ as a broker, since it offers a browser-based user interface to see the topics.

The topics are named TALEND.IDOCS.<IDoc Type>. These are set by the consuming Job and the <IDoc Type> that matches the type configured in the tSAPIDocReceiver component.

You can also possibly write SAP trace files. This feature is initially switched off by default, but you can switch it on by setting the configuration file:
#Enable/disable RFC trace (1=on or 0=off)
jco.server.trace=1

The following shows you that a .trc file is written to the top-level directory: