How to use IBM App Connect with SAP (via RFC)

The SAP connector in IBM® App Connect provides an RFC interface to directly connect to your on-premises SAP system.
Availability:
  • A connector in IBM App Connect on IBM CloudCloud-managed connector

To use the SAP RFC connector in App Connect, you must configure an on-premises IBM App Connect Enterprise integration server as an App Connect Agent. This agent will run part of your App Connect flow when you use the SAP RFC connector. This guide shows you how to set up connectivity to your on-premises SAP system via RFC.

Note: Instead of using the SAP RFC connector, you can connect to SAP via OData; see SAP (via OData).
The following information describes how to use IBM App Connect to connect SAP (via RFC) to your other applications.

What should I consider first?

Before you use App Connect Designer with SAP (via RFC), take note of the following considerations:

  • The App Connect Agent can run on Linux® only.
  • You can have just one App Connect Agent for each App Connect instance.
  • You must use an independent integration server for your agent (for more information, see Integration servers and integration nodes).
  • Don't use the integration server that you configure as an App Connect Agent for any other purpose. Don't deploy your own flows to that integration server.
  • (General consideration) You can see lists of the trigger events and actions that are available on the Catalog page of the App Connect Designer.

    For some applications, the events and actions in the catalog depend on the environment (IBM Cloud Pak for Integration or App Connect on IBM Cloud) and whether the connector supports configurable events and dynamic discovery of actions. If the application supports configurable events, you see a Show more configurable events link under the events list. If the application supports dynamic discovery of actions, you see a Show more link under the actions list.

  • (General consideration) If you are using multiple accounts for an application, the set of fields that is displayed when you select an action for that application can vary for different accounts. In the flow editor, some applications always provide a curated set of static fields for an action. Other applications use dynamic discovery to retrieve the set of fields that are configured on the instance that you are connected to. For example, if you have two accounts for two instances of an application, the first account might use settings that are ready for immediate use. However, the second account might be configured with extra custom fields.

Connecting to SAP (via RFC)

  1. Install IBM App Connect Enterprise version 11.0.0.4 or later.
  2. Set up an App Connect Enterprise command environment (for more information, see Setting up a command environment).
  3. In App Connect Enterprise, create an integration server by using the mqsicreateworkdir command (for more information, see Creating an integration server).
  4. In App Connect, download the agent configuration file:
    1. On the Catalog tab, click SAP, then click Connect.
    2. In the Private network connections (App Connect Agent) field, click Connect a new agent, then click Download the configuration.
  5. Copy the downloaded agenta.json configuration file to the directory work_directory/config/iibswitch/agenta, where work_directory is the work directory that you specified when you created the integration server.
  6. Go to the SAP Support Portal and download SAP Java™ Connector and the SAP Java IDoc Class Library, which together contain the following files:
    • sapjco3.jar
    • libsapjco3.so
    • sapidoc3.jar
  7. Open the integration server configuration file (work_directory/server.config.yaml) and modify the following section to specify the directory where you downloaded the SAP .jar and .so files:

    ConnectorProviders:
    SAPConnectorProvider:
    jarsURL: '/tmp/SAPJCo' # Set to the absolute path containing the .jar files.
    nativeLibs: '/tmp/SAPJCo' # Set to the absolute path containing the .so file.
  8. In App Connect Enterprise, start your integration server (for more information, see Starting an integration server). From this point your integration server is an App Connect Agent.
  9. In the messages that are shown when you start the App Connect Agent integration server, check for a message that says the agent is registered with the same App Connect Agent identifier as is shown in App Connect, in the Create an agent dialog box.
  10. In App Connect, close the Create an agent dialog box, complete the remaining connection settings for the SAP RFC application, then click Connect.
    • SAP application server host name: The host name or IP address of the SAP system
    • System number: The system number of the instance that you want to access in the SAP system, typically defined as a two-digit number ranging from 00 to 97
    • Client: The three-digit number of the client that you want to access within the SAP instance; for example, 110
    • Language: The ISO two-letter code (case-insensitive) that identifies the logon language of the SAP system; for example, en or EN
    • Code page: The four-digit number that identifies the code page to use in the SAP system; for example, 1100
    • User name: The user name to use for connecting to the SAP system
    • Password: The password for the specified user name
    • Private network connections (App Connect Agent): The name of the private network connection (App Connect Agent) that you configured earlier
    Tip:

    Before you use the account that is created in App Connect in a flow, rename the account to something meaningful that helps you to identify it. To rename the account on the Catalog page, select the account, open its options menu (⋮), then click Rename Account.

You have configured a connection to your on-premises SAP system, and you can now create a flow in App Connect that uses the SAP RFC application. You can view your App Connect Agent connections in the Private network connections page (click the Private network connections icon Networks icon). From the Private network connections page you can rename your agent and reopen the agent setup instructions.

If you later stop your App Connect Agent, before you restart it you need to ensure that it doesn't have any flows deployed to it, as described below. These flows might interfere with the flows that will be deployed automatically when the SAP RFC application is used.

  1. Ensure that your App Connect Agent is stopped.
  2. Navigate to the work directory of your App Connect Agent and delete the contents of the 'run' directory. The work directory is the directory that you specified when you created the App Connect Agent.
  3. Restart the App Connect Agent.

Events and actions

SAP (via RFC) events

These events are for changes in this application that trigger a flow to start performing the actions in the flow.

Note: Events are not available for changes in this application. You can trigger a flow in other ways, such as at a scheduled interval or at specific dates and times.

SAP (via RFC) actions

These are actions on this application that you want a flow to complete.

Available items are listed when you have connected App Connect to SAP (via RFC).

Troubleshooting

When you use the SAP RFC application in App Connect, it runs partly in the cloud and partly on premises, so there are two places where you might need to look for log information to help diagnose any problems:

  • For problems with the flow that is running in App Connect (which runs on IBM Cloud®), view additional log information in the Logs view (click the Logs icon Logs icon).
  • For problems with the App Connect Agent (which runs on premises), view the App Connect Enterprise user trace for the App Connect Agent to see log information. For more information about user trace, including how to start it, see: Using trace. Start user trace for the integration server that you configured as an App Connect Agent, then repeat the action that caused the problem and check the user trace for errors.

Troubleshooting problems when starting your agent

When you start the App Connect Agent, you can see relevant logs in two places. These logs are about the on-premises part of the application. Check these for any messages that might indicate a problem:

  • A subset of the logs is shown in the command console window for the App Connect Agent. This window is the one in which you entered the command to start your App Connect Agent.
  • The full set of logs are visible in the App Connect Enterprise user trace for the App Connect Agent.

Troubleshooting problems when running the agent

When you are running the App Connect Agent, you can check the App Connect logs for error messages. If you see a message that says it's not possible to connect to the App Connect Agent, try to reconnect by opening the Private network connections page (click the Logs icon Logs icon) and then refreshing the list. On the Lite plan, agents become idle after a period of inactivity, and refreshing the private network connections list restarts them.

Troubleshooting problems when running the SAP RFC application

If you encounter problems when you run your SAP RFC application, errors can be seen in App Connect logs, or in the App Connect Enterprise user trace for your App Connect Agent.