SAP Suite Adapter

The SAP Suite adapter for SAP R/3 integrates SAP R/3 versions 3.1i and later with non-SAP applications from vendors, such as PeopleSoft and Oracle, to conduct e-business with trading partners.

The SAP-certified (CA-ALE) SAP Suite adapter enables Sterling B2B Integrator to support platform, data, process, and B2B integration for SAP R/3 by offering the following features:
  • SAP inbound and outbound communications processing (ALE (Application Linking and Enabling) and IDOC (Intermediate Documents))
  • Synchronous Remote Function Calls (RFCs) and responses
  • Synchronous Business Application Programming Interface (BAPI) calls, including transaction handling
  • Load balancing for SAP R/3 clusters
  • Connection pooling and authentication

The following table provides an overview of the SAP Suite adapter:

Category Description
System name SAPSuite
Graphical Process Modeler (GPM) categories All Services, Applications > ERP
Description Provides a set of SAP R/3 integration methods.
Business usage Usage includes:
  • Near real-time and message-based integration of business processes between non-SAP back-end applications and SAP R/3 systems
  • Support of SAP interfaces: BAPI, synchronous RFC, file-based IDoc RFC (CA-EDI), and ALE/tRfc message-based IDoc (CA-ALE)
Usage example BAPI example:
  1. To determine availability of a certain material in a vendor's stock, you can use a synchronous BAPI call in SAP R/3 and receive the response immediately.
  2. You can then send a purchase order to buy the material.
Preconfigured? Partially. You must create a configuration of the SAP Suite adapter and perform minimal configuration to the SAP business processes. The business processes enable SAP inbound and outbound IDoc processing.
Requires third-party files? Yes, SAP Java Connector (JCo) Libraries (most recent version within 2.1.x)
Platform availability All supported Sterling B2B Integrator platforms
Related services None
Application requirements SAP connection details (see Before You Begin ) are required for the SAP Suite adapter to communicate with SAP.
Initiates business processes? The SAP Suite adapter initiates a business process in Sterling B2B Integrator for the following instances:
  • RFC outbound call
  • Receipt of an IDoc from SAP R/3 in file-based IDoc RFC mode
  • Receipt of an IDoc from SAP R/3 in ALE-based IDoc RFC mode
Invocation The SAP Suite adapter can trigger an outbound business process by configuring the name of the business process. In addition, a business process can start the SAP Suite adapter to perform SAP inbound processing. Data received starts a predetermined business process on an SAP outbound RFC call. For inbound business processes to Sterling B2B Integrator, it is event-driven.
Business process context considerations For BAPI and synchronous RFC, the SAP Suite adapter creates a primary document in XML format and returns Session or Transaction IDs in the process data. For SAP IDoc outbound, the RFC server creates XML parameters in process data that describes relevant parameters for further processing.
Returned status values Returned status values:
  • Success
  • Error – Review advanced status and process data content.
Also see Advanced Status Returned by the SAP Suite Adapter.
Restrictions The only supported versions are:
  • SAP R/3 versions 3.1i and later
  • IDoc versions 3 and 4
Persistence level None. The persistence is determined by the persistence level of the business processes used for processing inbound and outbound requests.
Testing considerations Parameter in the Debug Log level and the RFC/JCo trace to get additional debug information on the SAP Suite adapter from library and RFC levels.

How the SAP Suite Adapter Works

To enable a connection to SAP from Sterling B2B Integrator, SAP provides SAP Java™ Connector® (SAP JCo), a free software product for SAP customers which supports connections for the following platforms:
  • IBM® AIX®
  • HP-UX11
  • Linux®
  • Sun™ Solaris™
  • Microsoft® Windows®
  • IBM iSeries
    Note: For many platforms, SAP offers 32-bit and 64-bit versions of the JCo libraries, depending on the operating system and the JVM (Java Virtual Machine). Make sure that you install the correct version.

Communicating and Processing IDocs

After installing SAP JCo and the SAP Suite adapter, you configure the adapter and use it in business processes. To communicate with SAP R/3 and your trading partners, and to process IDocs, Sterling B2B Integrator provides several business processes that work together. These business processes use BPML activities, services, and adapters to retrieve documents, perform EDI and IDoc translation, and send documents. These business processes must be used together. To implement the business processes, you must perform minimal configuration.

There are two types of IDoc processing: file-based and ALE-based.

For file-based IDoc processing, Sterling B2B Integrator provides the following business processes:
  • SAP Inbound IDoc
  • SAP Outbound IDoc
  • SAP Inbound Delivery
For ALE/IDoc processing, Sterling B2B Integrator provides the following business processes:
  • SAP Outbound ALE
  • SAP Delivery ALE

SAP Inbound IDoc (SAPInboundIDoc.bp)

SAPInboundIDoc runs after the translation of inbound EDI data to IDoc. Sterling B2B Integrator envelope definitions are associated with SAP routes using the SAP cross-reference configuration. SAP Inbound IDoc inserts the proper routing information into the IDoc control record and transfers the completed IDoc to SAP using the SAP Inbound Delivery business process.

SAP Outbound IDoc (SAPOutboundIDoc.bp)

The SAP Suite adapter retrieves IDocs from SAP R/3. After retrieving IDocs, the SAP Outbound IDoc business process provides end-to-end processing of IDocs. The SAP Outbound IDoc business process enables IDocs to be grouped based on the user-provided EDI envelope definitions. While processing IDocs and preparing them for translation, the SAP Outbound IDoc business process generates status messages that describe processing results. After translation, the SAP Outbound IDocs business process calls the SAP Inbound Delivery business process, which uses FTP to send the status messages back to SAP R/3.

SAP Inbound Delivery (SAPinbDelivery.bp)

Both the SAP Inbound IDoc and SAP Outbound IDoc business processes use the SAP Inbound Delivery business process to send documents. That is:
  • After the SAP Inbound IDoc business process performs the final translation on the IDoc (such as adding the routing information to the IDoc control record), the SAP Inbound Delivery business process uses FTP to send the IDocs to SAP R/3.
  • After the SAP Outbound IDoc business process translates an IDoc received from SAP R/3 to EDI, the SAP Inbound Delivery business process uses FTP to send status messages to SAP R/3.

SAP Outbound ALE (SAPOutboundALE.bp)

The SAP Suite adapter receives IDocs from SAP R/3 using ALE technology. After receiving IDocs, the SAP Outbound ALE business process provides end-to-end processing of IDocs. The SAP Outbound ALE business process enables IDocs to be grouped based on the user-provided EDI envelope definitions. While processing IDocs and preparing them for translation, the SAP Outbound ALE business process generates status messages that describe processing results. After translation, the SAP Outbound ALE business process calls the SAP Delivery ALE business process to send the status messages back to SAP R/3.

SAP Delivery ALE (SAPALEDelivery.bp)

The SAP Outbound ALE business process uses the SAP Delivery ALE business process to send status messages back to SAP R/3 after IDoc to EDI translation is complete.

For more information, see Implementing the SAP R/3 Business Processes.

Business Scenario

Your company receives a purchase order from a trading partner in EDI format. You need to translate the EDI file to IDoc format and send it using file-based RFC to your back-end SAP system for further processing.

Business Solution Example

The approaches used to solve this business scenario includes the following tasks:
  • Configure EDI inbound envelopes for the purchase order. You need to define the following information in the appropriate envelopes:
    • The map used to translate the EDI file to IDoc format
    • The predefined SAPInboundIDoc business process as the business process to run after the EDI to IDoc translation is complete
  • Configure the SAP inbound route that contains the SAP ports and SAP client number of the SAP system that will receive the IDoc. See Configuring an Inbound Route.
  • Configure the SAP inbound route cross-reference entry to link the SAP inbound route and EDI inbound envelope for routing the IDoc to the appropriate SAP system. See Configuring an Inbound Cross-Reference.
  • Create a business process that includes the EDI Deenvelope service for deenveloping the EDI document.
  • Configure an instance of the SAP Suite adapter that uses file-based IDoc RFC (see Example SAP Suite Adapter Configuration).
  • Update the predefined SAPinbDelivery business process with the appropriate values for sending the IDoc to the SAP system. See SAP Inbound Delivery (SAPinbDelivery.bp) for the required updates.
  • Create an FTP login authentication file required by the FTP server and place the file in the directory where Sterling B2B Integrator is installed. See Before You Begin.

This business solution example focuses only on the SAP Suite adapter configuration and the SAP Inbound IDoc business process.

Example SAP Suite Adapter Configuration

A sample configuration might look like the following:

Example SAP Suite Adapter Configuration

(Screen 1 of 2)

Example SAP Suite Adapter Configuration

(Screen 2 of 2)

Business Solution Example Business Processes

The following example shows the predefined SAPInboundIDoc business process in the GPM. This business process is specified on the EDI inbound envelope and runs after EDI Deenveloping and after the EDI to IDoc translation is complete. The translated IDoc is input to the business process and becomes the primary document.

Business Solution Example Business Processes

The following example shows the corresponding business process solution using BPML.

Business Solution Example Business Processes
Business Solution Example Business Processes

The following example shows the predefined SAPinbDelivery business process used to send the IDoc to the SAP system.

Business Solution Example Business Processes

The following example shows sample output returned to the business process when the IDoc has been successfully received by the SAP system.

<EDI_DATA_INCOMING>
<PATHNAME>/sapmnt/I02/directory/orders.dat</PATHNAME>
<PORT>EDIPORT</PORT>
</EDI_DATA_INCOMING>

The EDI_DATA_INCOMING element represents the SAP Remote Function Call (RFC) that started. The PATHNAME and PORT elements are the input parameters that were passed into the SAP RFC.

A Basic Status of “Success” and Advanced Status of “None” in the Business Process Modeler indicate that the SAP Suite adapter successfully executed the RFC and that the SAP system has verified the EDI_DC header segment of the IDoc.

Running the Business Solution Example

Assuming that you have completed all the prerequisite requirements for EDI to IDoc document exchanges, you need to perform the following steps to run the business solution example:
  1. Run a business process that includes the EDI Envelope service and pass in the EDI file.
  2. Verify the results in the Business Process Monitor.

See Usage Examples for additional examples of using the SAP Suite adapter.

Implementing the SAP Suite Adapter

To implement the SAP Suite adapter, complete the following tasks:
  1. Activate your license for the SAP Suite adapter. For information, see An Overview of Implementing Services.
  2. Install the SAP Java Connector. For information, see Installing the SAP Java Connector.
  3. Create all of the maps that will be used to translate the IDocs that you are enveloping, and check them into Sterling B2B Integrator.
  4. Set up your trading partner information, including EDI interchange, group, and transaction envelopes.
  5. Create an SAP Suite adapter configuration. For information, see Creating an SAP Suite Adapter Configuration.
  6. Create business processes or configure/use the following predefined business processes to communicate and implement document processing:

    For file-based IDoc processing:

    • SAPInboundIDoc.bp
    • SAPOutboundIDoc.bp
    • SAPinbDelivery.bp

      For ALE IDoc processing:

    • SAPOutboundALE.bp
    • SAPALEDelivery.bp
      Note: Before you can use your business process, you must check the predefined business processes out of Sterling B2B Integrator. After implementing the predefined business processes, you must check in your business process back to Sterling B2B Integrator.

      For more information about implementing SAP business processes, see Implementing the SAP R/3 Business Processes.

  7. Create inbound and outbound routes that describe the key fields in the IDoc that enable Sterling B2B Integrator to route the IDoc to the appropriate trading partner. For information, see Configuring an SAP R/3 Cross-Reference.
  8. Create inbound and outbound cross-references to the routes that enable Sterling B2B Integrator to tie EDI envelopes to their corresponding SAP routes (and vice versa) for routing documents to and from the external trading partners. For information, see Configuring an SAP R/3 Cross-Reference.

Installing the SAP Java Connector

You must download and install the most recent version within 2.1.x of the SAP Java Connector (SAP JCo) before installing the SAP Suite adapter. The SAP JCo contains libraries and packages that support various platforms and enable the SAP Suite adapter to communicate with an SAP system and with Sterling B2B Integrator. After obtaining the SAP JCo, you must make the files available to the host system where Sterling B2B Integrator is installed.

Downloading the SAP Java Connector

To download the SAP Java Connector:
  1. Create a user account to access the SAP Service Marketplace offerings.
  2. On the same computer where you have installed Sterling B2B Integrator and activated a license for the SAP Suite adapter, download the free SAP JCo from the SAP Service Marketplace Web site at https://websmp101.sap-ag.de/.
    1. Log in to SAP Service Marketplace and access the SAP JCo download software from http://service.sap.com/connectors. If necessary, select the Tools & Services page to display the download page.
    2. Download the most recent version within 2.1.x of the SAP JCo for your specific platform. The following table lists the specific files for each platform (included in the .tgz file on UNIX or the .zip file on Windows) that the SAP Suite adapter uses in Sterling B2B Integrator:
      Note: When transferring files from Windows to UNIX, make sure that you transfer the files in binary mode.
      Platform SAP JAVA Connector Files
      IBM AIX Includes:
      • librfccm.o
      • libsapjcorfc.so
      • sapjco.jar
      HP-UX11 Includes:
      • librfccm.sl
      • libsapjcorfc.sl
      • sapjco.jar
      Important: For JCo most recent 2.x.x version on HP-UX11: Any messages to stderr in the following format can be ignored:/usr/lib/dld.sl: Can't find path for shared library: dsrlib.sl/usr/lib/dld.sl: No such file or directory. These messages have no impact on JCo functionality. This library is used for debugging the sapjco libs (SAPCCMSR). However, if you want to use this library, you can download it from SAP.
      Linux Includes:
      • librfccm.so
      • libsapjcorfc.so
      • sapjco.jar
      Sun Solaris Includes:
      • librfccm.so
      • libsapjcorfc.so
      • sapjco.jar
      Microsoft Windows Includes:
      • librfc32.dll
      • sapjco.jar
      • sapjcorfc.dll
      Important: For JComost recent 2.x.x version on Windows: If you are using the SAP JCo version 2.x.x, you must follow the instructions in SAP Note 684106, which explains that the following Microsoft runtime DLLs on your Windows system need to be updated:
      • msvcr71.dll
      • msvcp71.dll
      • mfc71.dll
      • mfc71u.dll
      The files are attached to the SAP note in an installable archive. Unpack the archive, and then install using R3DLLINS.exe.
      IBM iSeries Includes:
      • sapjco.jar
      • Librfc.savf
      • Sapjcorfc.savf

Installing on UNIX

To install the SAP Java Connector on UNIX:
  1. Complete the procedure Downloading the SAP Java Connector.
  2. Shut down Sterling B2B Integrator if it is running.
  3. To set the CLASSPATH and LIBPATH/LD_LIBRARY_PATH, complete the following steps:
    1. For the operating system-specific libraries, type:

      install3rdParty.sh sapjco 2_x_x (the most recent 2.x.x version) -j directory/*.jar

    2. For the native libraries, type:

      install3rdParty.sh sapjco 2_x_x (the most recent 2.x.x version) -l directory/*.so

      Notes:
      • Two different switches are used in the previous commands (-j and -l). Make sure you use the correct switch, as shown in the command.
      • lib-extension depends on the operating system you are using. For Sun Solaris, it would be .so, for example. See the table that lists SAP JAVA Connector Files.
      • If you are using the MySQL database, ensure that the database is stopped after running install3rdParty.sh.
  4. Restart Sterling B2B Integrator.

Installing on Windows

To install the SAP Java Connector on Windows:
  1. Complete the procedure described in Downloading the SAP Java Connector.
  2. Shut down Sterling B2B Integrator if it is running.
  3. To add the sapjco.jar and the native libraries to the Windows registry, complete the following steps:
    Notes:
    • Two different switches are used in these commands (-j and -l). Make sure that you use the correct switch.
    • If you are using the MySQL database, ensure that the database is stopped after running install3rdParty.cmd.
    1. For the operating system-specific libraries, type:

      install3rdParty.cmd sapjco 2_x_x ( the most recent 2.x.x version) -j directory\*.jar

    2. For the native libraries, type:

      install3rdParty.cmd sapjco 2_x_x ( the most recent 2.x.x version) -l directory\*.dll

      After typing this command, complete the following steps:

      1) Run stopWindowsService.cmd.

      2) Run uninstallWindowsService.cmd.

      3) Close the Command window and re-open it.

      4) Run InstallWindowsService.cmd.

    3. If you receive a database connection test failure error, in the \bin directory, start MySQL™ using the following command:

      control_mysql.cmd start

  4. Restart Sterling B2B Integrator.

Installing on iSeries

To install the SAP Java Connector on iSeries, complete the following steps:
  1. Complete the procedure descibed in Downloading the SAP Java Connector.
  2. From the jar directory for your Sterling B2B Integrator installation, copy sapjco.jar into a working directory on your iSeries.
    Note: If you use FTP to copy the files, make sure that you transfer the files in binary mode.
  3. From the lib directory for your Sterling B2B Integrator installation, copy LIBRFC.SAVF and SAPJCORFC.SAVF into a working directory on your iSeries.
  4. Create a library to store the SAP service programs. From an iSeries command line, type CRTLIB SAPJCOLIB. If this library already exists, you can choose another name.
  5. Prepare the service programs for the restore by copying them from the IFS to the QSYS side of your iSeries:

    CPYFRMSTMF FROMSTMF('/copytodirectory/SAPJCORFC.SAVF') TOMBR('/QSYS.LIB/SAPJCOLIB.LIB/SAPJCORFC.FILE') MBROPT(*REPLACE)

    and

    CPYFRMSTMF FROMSTMF('/copytodirectory/LIBRFC.SAVF') TOMBR('/QSYS.LIB/SAPJCOLIB.LIB/LIBRFC.FILE') MBROPT(*REPLACE)

  6. Restore the service programs to library SAPJCOLIB by typing:

    RSTOBJ OBJ(*ALL) SAVLIB(M630SPREL) DEV(*SAVF) SAVF(SAPJCOLIB/SAPJCORFC) RSTLIB(SAPJCOLIB)

    and

    RSTOBJ OBJ(*ALL) SAVLIB(M630SPREL) DEV(*SAVF) SAVF(SAPJCOLIB/SAPJCORFC) RSTLIB(SAPJCOLIB)

    These two commands place the service programs LIBRFC and SAPJCORFC in the library SAPJCOLIB.

  7. Edit the job description that you use to start your Sterling B2B Integrator instance. Add the library SAPJCOLIB to the initial library list of that job description.
  8. Add SAPJCOLIB (or a new name, as described in step 4) to the LIBPATH environment variable. Type the following command:

    ADDENVVAR ENVVAR(LIBPATH) VALUE('/QSYS.LIB/SAPJCOLIB.LIB') LEVEL(*SYS)

  9. Ensure that your Sterling B2B Integrator instance is not running.
  10. From an iSeries command line, type QSH and press Return to get into Qshell.
  11. Change to the bin directory of your Sterling B2B Integrator instance.
  12. Type the following command:

    install3rdParty.sh sapjco lz –j /locationofthesapjco.jarfile/sapjco.jar

    -nodeploy > i3p.log 2> i3p.log

  13. Upon completion, type:

    deployer.sh > deployer.log 2> deployer.log

  14. Once that has completed, verify that the passphrase=password has not been removed from the Sterling B2B Integrator install_dir/properties/security.properties file. If it has, add it back.
  15. Restart Sterling B2B Integrator.

Creating an SAP Suite Adapter Configuration

Before You Begin

Before you begin to configure the SAP Suite adapter, collect the following information:
  • SAP Application Server IP address (non-load balanced SAP R/3 system)
  • SAP Message Server (load balanced SAP R/3 system only)
  • R/3 Name (load balanced SAP R/3 system only)
  • SAP Group (load balanced SAP R/3 system only)
  • SAP Gateway Host IP address (if applicable, required for SAP outbound processing)
  • SAP Gateway Service (if applicable, required for SAP outbound processing)
  • SAP System Number
  • SAP Port (Mode File based IDoc RFC only)
  • SAP Client Number
  • SAP Program ID (SAP outbound processing only)
  • Username for logging into the SAP Application Server
  • Password for logging into the SAP Application Server
  • Name of the business process to start (SAP outbound processing only)
  • Name of the Remote Function Call(s) to register (SAP RFC synchronous requests and BAPI only. Required for SAP outbound processing only.)

See Configuring the SAP Suite Adapter for a description of the parameters used to define this information.

In addition, for file-based IDoc processing, you need to create an FTP login authentication file (required by the FTP server) and place the file in the directory where Sterling B2B Integrator is installed. The file must contain the following values:
  • username=sapusername
  • password=sappassword

Configuring the SAP Suite Adapter

Whether you plan to create a business process that includes the SAP Suite adapter or use the predefined business processes, you must create a service configuration of the SAP Suite adapter. For more information, see Managing Services and Adapters.

To create and enable a configuration of the SAP Suite adapter, use the following table to configure the parameters:

Note: The field names in parentheses represent the corresponding field names in the GPM. This information is provided for your reference.
Field Description
Name Unique, meaningful name for the adapter configuration. Required.
Description Meaningful description for the adapter configuration, for reference purposes. Required.
Select a Group Select a Service Group to associate with this adapter. Valid values:
  • None – You do not want to include this configuration in a group at this time.
  • Create New Group – You can enter a name for a new group in this field, which will then be created along with this configuration.
  • Select Group – If you have already created one or more groups for this adapter type, they are displayed in the list. Select a group from the list.
For more information on Service Groups, see Managing Services and Adapters.
SAP Integration Mode (Mode) Integration mode that enables Sterling B2B Integrator to communicate with an SAP R/3 system and with transfer documents. Required. Valid values:
  • Synchronous BAPI – Enable integrated activities using SAP R/3 business objects and their BAPIs, which are processed in synchronous mode.
  • Synchronous RFC – Trigger direct and synchronous RFCs that start SAP R/3 function modules or receive synchronous RFC calls from SAP R/3.
  • File-based IDoc RFC – Transfer documents using SAP R/3 IDoc technology when communicating with SAP R/3 using RFC.
  • ALE-based IDoc – Transfer documents using SAP R/3 IDoc technology when communicating with SAP R/3 using ALE.
SAP system is load balanced (LoadBalanced) Whether Sterling B2B Integrator is connecting to a single SAP R/3 system or cluster of SAP R/3 systems. Required. Valid values:
  • Yes – Connect to a cluster of SAP R/3 systems.
  • No – Connect to a single SAP R/3 system.
The integration mode and load-balancing determine which of the following parameters display for configuration. Refer to the following sections to determine the information that you must provide to continue creating the SAP Suite adapter service configuration:
  • Synchronous BAPI
  • Synchronous RFC
  • File-based IDoc RFC
  • ALE-based IDoc RFC
  • User Properties
  • RFC Server Configuration (Outbound)
  • Connection Pool Settings
  • Application User Settings

Synchronous BAPI

The following table describes the fields to configure for synchronous BAPI:

Field Description
Load Balanced
SAP Message Server Name that identifies the message server for the cluster of SAP R/3 systems. Required.
R/3 Name (R3name) Name of the SAP R/3 system. Required.
SAP Group (Group) Group name that is configured for the cluster of SAP R/3 systems. Required.
Not Load Balanced
SAP Application Server Name of the server for the SAP R/3 application. Required.
Gateway Host (GWhost) Host running the SAP R/3 gateway server. You can use an IP address. Optional.
Gateway Service (GWserv) Gateway service of the SAP R/3 system. Optional.
SAP System Number Number of the SAP R/3 system. Required.

Synchronous RFC

The following table describes the fields to configure for synchronous RFC:

Field Description
Load Balanced
SAP Message Server Name that identifies the message server for the cluster of SAP R/3 systems. Required.
R/3 Name (R3name) Name of the SAP R/3 system. Required.
SAP Group (Group) Group name that is configured for the cluster of SAP R/3 systems. Required.
Gateway Host (GWhost) Host running the SAP R/3 gateway server. You can use an IP address. Optional.
Gateway Service (GWserv) Gateway service of the SAP R/3 system. Optional.
Not Load Balanced
SAP Application Server Name of the server for the SAP R/3 application. Required.
Gateway Host (Gwhost) Name of the host running the SAP R/3 gateway server. You can use your IP address. Optional.
Gateway Service (Gwserv) Gateway service of the SAP R/3 system. Optional.
SAP System Number Number of the SAP R/3 system. Required.

File-based IDoc RFC

The following table describes the fields to configure for file-based IDoc RFC:

Field Description
Not Load Balanced
SAP Application Server Name that identifies the message server for the cluster of SAP R/3 systems. Required.
Gateway Host (Gwhost) Name of the host running the SAP R/3 gateway server. You can use an IP address. Optional.
Gateway Service (Gwserv) Gateway service of the SAP R/3 system. Optional.
SAP System Number Number of the SAP R/3 system. Required.
SAP Port (Port) Port or communication type that enables the SAP R/3 system to communicate with external systems during electronic data interchange. For example, for EDI subsystems that read IDocs in the form of sequential files, the SAP R/3 port is File. Required.
Map SAP IDoc path to local path Enable Sterling B2B Integrator to map the local directory path to the IDoc on the SAP R/3 system.
Local Path (MapPath) Local directory path to the IDoc on the SAP R/3 system. Required if you selected the Map SAP IDoc path to local path check box.
Load Balanced
SAP Message Server Name that identifies the message server for the cluster of SAP R/3 systems. Required.
R/3 Name (R3name) Name of the R/3 system. Required.
SAP Group (Group) Group name that is configured for the cluster of SAP R/3 systems. Required.
Gateway Host (Gwhost) Name of the host running the SAP R/3 gateway server. You can use an IP address. Optional.
SAP Port (Port) Port or communication type that enables the SAP R/3 system to communicate with external systems during electronic data interchange. For example, for EDI subsystems that read IDocs in the form of sequential files, the SAP R/3 port is File. Required.
Map SAP IDoc path to local path Enable Sterling B2B Integrator to map the local directory path to the IDoc on the SAP R/3 system.
Local Path (MapPath) Local directory path to the IDoc on the SAP R/3 system. Required if you selected the Map SAP IDoc path to local path check box.

ALE-based IDoc RFC

The following table describes the fields to configure for ALE-based IDoc RFC:

Field Description
Not Load Balanced
SAP Application Server Name that identifies the application server for the cluster of SAP R/3 systems. Required.
Gateway Host (Gwhost) Name of the host running the SAP R/3 gateway server. You can use an IP address. Required.
Gateway Service (Gwserv) Gateway service of the SAP R/3 system. Optional.
SAP Version (SAPVersion) Version of the SAP R/3 system to control IDoc version. Required. Valid values are:
  • 3 – IDoc version used in SAP releases 3.x (EDI_DC)
  • 4 – IDoc version used in SAP releases 4.x (EDI_DC40)
Check boxRetry Sending IDocs Check if SAP Suite adapter should automatically retry to deliver the IDoc to the SAP system.
Max Retries Sets how often the retry should take place. Setting the value to 0 causes the SAP Suite adapter to retry infinitely.
Retry Sending Interval Delay in seconds between two retries.
Load Balanced
SAP Message Server Name that identifies the message server for the cluster of SAP R/3 systems. Required.
R/3 Name (R3name) Name of the SAP R/3 system. Required.
SAP Group (Group) Group name that is configured for the cluster of SAP R/3 systems. Required.
Gateway Host (Gwhost) Name of the host running the SAP R/3 gateway server. You can use an IP address. Optional.
Gateway Service (Gwserv) Gateway service of the SAP R/3 system. Optional.
SAP Version (SAPVersion) Version of the SAP R/3 system. Required.
Check box Check if SAP Suite adapter should automatically retry to deliver the IDoc to the SAP R/3 system.
Max Retries Sets how often the retry should take place. Setting the value to 0 causes the SAP Suite adapter to retry infinitely.
Retry Sending Interval Delay in seconds between two retries.

User Properties

The following table describes the fields to configure user properties:

Field Description
Client (Client) Name of the client in the SAP R/3 system. Required.
User (User) Name of the authorized user of the SAP R/3 account. Required.
Password (Passwd) Password of the authorized user of the SAP R/3 account. Required.
Language (Lang) Language used by the SAP R/3 account. Required. Valid value is EN (English).
Code Page (Codepage) Code page of this SAP R/3 system—for example, 1100 for English and most European languages. Optional.

RFC Server Configuration (Outbound)

The following table describes the fields to configure RFC properties:

Field Description
Start RFC Server automatically Start the local RFC server automatically. The RFC server is required for SAP R/3 outbound.
RFC Server Instances Number of RFC server instances listening for connections from the SAP R/3 system.
Program ID (Program ID)
The Program ID contains a value that corresponds to an entry in SM59 on the SAP side. For example, if the Program ID is set to SIB2BPROD, a corresponding RFC connection in SM59 on the SAP side is created with a Program ID of SIB2BPROD. If a test connection is executed on the SAP side using the RFC destination SIB2BPROD the connection will return success.
Restriction:
Multiple outbound SAP Suite adapter configurations cannot share identical Program ID values.
Outbound Process to Start Select the name of the business process that Sterling B2B Integrator should run after receiving an IDoc from SAP R/3.
Outbound Encoding Set the character encoding for the outbound document.
Wait for synchronous RFC Outbound response Enables support for synchronous responses in case of outbound SAP RFC calls.
Response Timeout After this timeout (in seconds), the RFC server closes the connection to the SAP system. After this timeout, if Sterling B2B Integrator wants to send a response back to SAP, an error is returned.
Delete TIDs Automatically Indicates whether transaction IDs (TIDs) that have been already used should be deleted after the time configured in the Delete TIDs after (days) field.
Note: TIDs are used for ALE processing only.
Delete TIDs after (days) TIDs older than n days are deleted.
Register Remote Function This applies to BAPI or RFC Outbound mode only. To be able to handle outbound BAPI or RFC calls, the call structures have to be registered in Sterling B2B Integrator. Options are:
  • Select RFCs online from RFC list

    Sterling B2B Integrator establishes a connection to SAP and retrieves the list of available RFC or BAPI functions.

  • Enter RFCs offline

    A comma-separated list of RFCs can be entered offline; no connection to the SAP system is established.

  • None (for IDoc modes or BAPI/RFC Inbound):

    No functions need to be registered.

CheckboxSAP R/3 is a UNICODE system To be able to interface with Unicode SAP systems, you must enable the check box.
Note: This option makes it unnecessary to add the line “sap. (instancename).Unicode = 1” to the sap.properties file, which was necessary in earlier versions of the SAP Suite adapter.
Note: For Unicode SAP systems: To be able to interface with Unicode SAP systems, you must set the Unicode option for your RFC destination in transaction SM59 on the SAP system (please contact the SAP system administrator for more information). You can find this option on the Special Options tab, in the Character Width in Target System section.

Connection Pool Settings

There are two types of connections to an SAP system: connections (physical) and sessions (logical).
  • Connections: Physical connections to an SAP system. Connections can be in either closed or open status.
  • Sessions: Logical connections to an SAP system. Each session object contains a connection object. A session can be in either used, unused, or called status.

The following table contains the settings used to configure a connection pool:

Field Description
Use hard max connections limit Check this box if the number of open parallel connections should never exceed the number of configured maximum connections as configured in Max Connections (Off = soft limit).
Max Connections Maximum number of open parallel sessions.
Soft Limit Delay Time (seconds) After this time, if all max sessions are still used and a call is waiting to be executed, an additional session is created.
Connection Check Interval (seconds) Interval in which the session and connection state is checked by the adapter.
Connection Idle Time (seconds) If a session is unused for this period of time, the connection is closed.
Close session after maximum session time Whether the adapter should close the connections after the Max Session Time (see next field). Select this option to prevent connections from staying opened indefinitely.
Max Session Time (minutes) Maximum time after a session is not processed (if enabled).
Note: If invalid data (like ABC or 13.45) is entered in a pool setting, the setting uses its default value.

Application User Settings

The following table contains the user setting for the service configuration:

Field Description
User ID Name of the user to associate with the business process that includes this service configuration.
You are now ready to complete either of the following tasks:
  • Create a business process that includes the SAP Suite adapter.
  • Configure SAP R/3 business processes for implementation (see the next section).

Editing the SAP Suite Adapter Configuration Parameters

Upon installation, the connection pool, RFC server, and trace parameters that enable connection to an SAP system are preconfigured.

To edit these parameters:
  1. From the Administration menu, select Deployment > Services > Installation/Setup.
  2. Under List, select S next to Alphabetically and click Go!
    Note: Under List for Service Status, Installed (default value) should display.
  3. From the list of services, select edit next to SAP Suite adapter.
  4. Using the following table, edit the fields as appropriate:
    Field Description
    Max. Startup Delay (MaxStartupDelay) Maximum number of startup connections to the SAP R/3 system. Required. The default value is 60 seconds.
    RFC Trace (RFCTrace) RFC trace processing information about connections in the pool. Valid values:
    • On – Trace the connection.
    • Off – Do not trace the connection.
    JCO Trace Level (JCOTraceLevel) JCo trace processing information level. Valid values are 0 to 6 (6 is the maximum level).
    JCO Trace Path (JCOTracePath) Directory for the JCo trace output files. If “.” is used, the trace files will be located in the application server installation directory.
  5. Click Next and review the parameters that you edited.
  6. Click Finish to update Sterling B2B Integrator.

Implementing the SAP R/3 Business Processes

To implement the business processes for SAP R/3, you need to perform the minimal configurations for the SAP Outbound IDoc, SAP Inbound Delivery, and SAP Delivery ALE business processes. The SAP Inbound IDoc and SAP Outbound ALE business processes require no additional setup.

To implement the business processes:
  1. Check out the following predefined business processes (.bp files) from Sterling B2B Integrator:
    • SAPinbDelivery.bp (for file-based IDoc)
    • SAPOutboundIDoc.bp (for file-based IDoc)
    • SAP Delivery ALE (for ALE IDoc)
  2. After checking out the business processes, use the element editors in the GPM to display the configuration parameters within each business process.

Refer to the following sections to determine the information that you must provide to implement the business processes.

SAP Outbound IDoc (SAPOutboundIDoc.bp)

The following table provides the parameters to define for the preconfigured services, as appropriate:

Note: Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the FTP Send adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the FTP Client Adapter with related services. For more information about the retirement process, see Retiring and Removed Services and Adapters.
Service/Adapter Configuration Instance Name Parameter Description
FTPSend (FTP Send Adapter) xport-ftp-document Name of IDoc that Sterling B2B Integrator retrieves from SAP R/3. Required.
xport-ftp-host IP address or host name of the external trading partner host system. Valid values are valid IP addresses and host names. Required.
xport-tp-authfile Authentication file containing the user name, password, and passphrase. Valid value is the file name. Required if passphrase is used.
DocumentExtractionService (Document Extraction Service) BatchLikeDocuments Whether to split the IDocs that are extracted into batches. Optional. Valid values:
  • Yes – Group IDocs into files based on Sender ID, Receiver ID, and Accepter Lookup Alias.
  • No – Split out each IDoc individually, regardless of Sender ID, Receiver ID, and Accepter Lookup Alias values.
DocExtractMapList Name of the map to extract documents from a single batch file. Required if splitting IDocs into batches.
FS_WriteEDI (File System Adapter) assignedFilename Unique file name used to overwrite the file name created by the business process. If the file name is not unique, the previous file with the same name is overwritten the next time it runs. Valid value is any valid file name. Required.
extractionFolder Any folder or subfolder on the same computer where Sterling B2B Integrator is installed and where it extracts (writes) data as part of a business process. Required.

SAP Inbound Delivery (SAPinbDelivery.bp)

The following table provides the parameters to define for the preconfigured services, as appropriate:

Note: Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the FTP Send adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the FTP Client Adapter with related services. For more information about the retirement process, see Retiring and Removed Services and Adapters.
Adapter Configuration Instance Name Parameter Description
FTPSend (FTP Send Adapter) xport-ftp-dir Folder name or mailbox ID of an external trading partner. Required.
xport-ftp-document Document that the trading partner within Sterling B2B Integrator retrieves from the remote trading partner. Optional.
xport-ftp-host IP address or host name of the external trading partner host system. Valid values are valid IP addresses and host names. Required.
xport-tp-authfile Authentication file containing the user name, password, and passphrase. Valid value is the file name. Required if passphrase is used.
SapSuite (SAP Suite Adapter)   Configure the parameters for this preconfigured instance of the SAP Suite adapter or specify your custom SAP Suite adapter configuration instance. See Creating an SAP Suite Adapter Configuration.

SAP Delivery ALE (SAPALEDelivery.bp)

The following table provides the parameters to define for the preconfigured services, as appropriate:

Adapter Configuration Instance Name Parameter Description
SapSuite (SAP Suite Adapter)   Configure the parameters for this preconfigured instance of the SAP Suite adapter or specify your custom SAP Suite adapter configuration instance. See Creating an SAP Suite Adapter Configuration.

You are now ready to check in the business processes to Sterling B2B Integrator.

Configuring an SAP R/3 Route

Sterling B2B Integrator uses SAP routes to determine how to route IDocs to and from external trading partners. When creating the inbound routes, indicate which key fields in the IDoc EDI_DC control record are used to identify the IDoc.

Configuring an Inbound Route

To configure an inbound route:
  1. From the Administration menu, select Deployment > Adapter Utilities > SAP Routes > SAP Routes.
  2. Under Create, next to New Inbound Route, click Go!
  3. Complete the fields in the following table, as appropriate:
    Field Description
    Route Name Unique, meaningful name for the inbound route. Required.
    SAP Direction Direction of this route. This value is read-only and is set to inbound. No configuration necessary.
    SAP IDOC Version Version of the IDoc that you are exchanging with SAP R/3. Required.
    EDI Port Name Name of the port that enables communication between Sterling B2B Integrator and an SAP EDI subsystem. The EDI subsystem triggers the SAP Suite adapter when sending IDocs to Sterling B2B Integrator. Sterling B2B Integrator triggers the EDI subsystem when sending IDocs to SAP. Required.
    Note: Both the SAP port name and EDI port name are used to route the IDoc to the correct trading partner. These values, along with the SAP client number, are added to the IDoc control record during the final translation of the IDoc in the SAPInboundIDoc business process.
    SAP Port Name Name of the SAP internal port that enables communication between the EDI subsystem and the SAP system when sending and receiving IDocs. Required.
    Note: Both the SAP port name and EDI port name are used to route the IDoc to the correct trading partner. These values, along with the SAP client number, are added to the IDoc control record during the final translation of the IDoc in the SAPInboundIDoc business process.
    SAP Client Number SAP R/3 client number. Required.
  4. Click Next and review your configuration settings.
  5. Click Finish to add the inbound SAP R/3 route to Sterling B2B Integrator.

Configuring an Outbound Route

To configure an outbound route:
  1. From the Administration menu, select Deployment > Adapter Utilities > SAP Routes > SAP Routes.
  2. Under Create, next to New Outbound Route, click Go!
  3. Complete the fields in the following table, as appropriate:
    Field Description
    Route Name Unique, meaningful name for the outbound route. Required.
    SAP Direction Direction of this route. This value is read-only and is set to outbound. No configuration is necessary.
    SAP IDOC Version Version of the IDoc that you are exchanging with SAP R/3. Required.
    EDI Port Name Name of the port that enables communication between Sterling B2B Integrator and an SAP EDI subsystem. The EDI subsystem triggers the SAP Suite adapter when sending IDocs to Sterling B2B Integrator. Sterling B2B Integrator triggers the EDI subsystem when sending IDocs to SAP. Required. In addition, the EDI port name is included in the IDoc header and used along with the SAP port name and Accepter Lookup Alias defined for the EDI envelope to identify the inner-most EDI envelope (which contains the translation map) to apply to the document. You must specify the EDI port name as the Receiver ID for the inner-most EDI envelope (for example, ST SE envelope).
    SAP Port Name Name of the SAP internal port that enables communication between the EDI subsystem and the SAP system when sending and receiving IDocs. Required. In addition, the SAP port name is included in the IDoc header and used along with the EDI port name and Accepter Lookup Alias defined for the EDI envelope to identify the inner-most EDI envelope (which contains the translation map) to apply to the document. You must specify the SAP port name as the Sender ID for the inner-most EDI envelope (for example, ST SE envelope).
    SAP Partner Keys The key fields from the IDoc that Sterling B2B Integrator uses to identify the IDoc. Required. Select all the key fields that apply. Valid values:
    • MESCOD – Logical message variant
    • MESFCT – Logical message function
    • MESTYP – Logical message type
    • RCVPFC – Partner function of receiver
    • RCVPRN – Partner number of receiver
    • RCVPRT – Partner type of receiver
    • SNDPRN – Partner number of the sender
    • SNDPRT – Partner type of the sender
    • STDMES – EDI message type
    • TEST – Test option
  4. Click Next and review your configuration settings.
  5. Click Finish to add the outbound cross-reference to Sterling B2B Integrator.

Configuring an SAP R/3 Cross-Reference

To enable Sterling B2B Integrator to process inbound and outbound IDocs and translate them to and from EDI, you must specify SAP cross-references to look up the EDI envelope associated with the SAP route defined for the IDoc.

Note: The Sterling B2B Integrator supports only one-to-one ratio of SAP cross-references to EDI envelopes.

Configuring an Inbound Cross-Reference

To configure an inbound cross-reference:
  1. From the Administration menu, select Deployment > Adapter Utilities > SAP Routes > SAP Route X-REF.
  2. Under Create, next to New Inbound X-REF, click Go!
  3. Complete the fields in the following table, as appropriate:
    Field Description
    Route Selection Name of the inbound route to which you are creating this cross-reference. Required.
    Envelope Selection EDI envelope that you have previously created to translate the key field or fields that you specified when creating an inbound route. Required.
    Note: Specify the inner-most EDI envelope in this field.
  4. Click Next and review your configuration settings.
  5. Click Finish to add the inbound cross-reference to Sterling B2B Integrator.

Configuring an Outbound Cross-reference

To configure an outbound cross-reference:
  1. From the Administration menu, select Deployment > Adapter Utilities > SAP Routes > SAP Route X-REF.
  2. Under Create, next to New Outbound X-REF, click Go!
  3. Complete the fields in the following table, as appropriate:
    Field Description
    Selection Route Name of the outbound route to which you are creating this cross-reference. Required.
    Select Envelope EDI envelope that you have previously created to translate the key field or fields that you specified when creating an outbound route. Required.
    Note: Specify the inner-most EDI envelope in this field.
  4. Click Next and review your configuration settings, and then click Finish to add the outbound cross-reference to Sterling B2B Integrator.

Configuring for Load Balancing

If the SAP system is load-balanced (“SAP system is loadbalanced” = Yes in the SAP Suite adapter configuration), you must configure the /etc/services file as shown in the following table. The /etc/services file is used to map port numbers to service names.

The location of this file depends on your host system (UNIX/Linux, Windows, or iSeries). In UNIX, the file is at /etc/services. In Windows, the file is at c:\WINDOWS\system32\drivers\etc\services. In iSeries, use the iSeries Transaction WRKSRVTBLE to edit this information.
Service Type Port Service Name
sapmsS01 3600/tcp SAP System Message Port
sapdp00 3200/tcp SAP System Dispatcher Port
sapdp00s 4700/tcp SAP System Dispatcher Security Port
sapgw00 3300/tcp SAP System Gateway Central Instance Port
sapgw00s 4800/tcp SAP System Gateway Security Port

For the sapmsXXX service type, XXX is the SAP System ID. For example, if the SAP System ID is E01, the entry should read as follows:

sapmsE01 35YY/tcp #SAP System Message Port

YY is the SAP System Number.

Retrieving IDoc and Schema Format Descriptions

IDoc and schema format descriptions can be obtained either by using the new SapSuiteBuilder interface or with the command line-based tool, CmdlineSAPSuiteBuilder.

Retrieving Descriptions Using the SAP Suite Builder Interface

To retrieve IDoc and schema format descriptions using the SAP Suite Builder interface:
  1. From the Administration menu, select Deployment > Adapter Utilities > SAP Suite Builder.
  2. Enter the parameters required to access and log in to the SAP system.

    Sterling B2B Integrator connects to the SAP system and retrieves a list of available IDocs, BAPIs (objects and methods), or RFCs.

  3. Select the required format descriptions.
  4. Click Finish on the summary screen.
  5. Download the formats as .ddf or .xsd files.
  6. Import these format descriptions into the Sterling B2B Integrator Map Editor.
    Note: The IDoc Meta Data Builder > Generation Parameters page now includes the parameter Generate IDoc version in records. If enabled, the generated IDoc Record tag includes the segment definition name (SEGMENTDEF, <segment_type><segment_version>). If not enabled, the generated IDoc Record tag includes the segment type name only (SEGMENTTYP, <segment_type>). This was the default in earlier versions of the SAP Suite Builder.

Retrieving Descriptions Using the SAP Command Line Interface

This section contains information about retrieving IDoc and schema format descriptions using the SAP Command Line interface. The CmdlineSAPSuiteBuilder is a command line-based tool that is installed when the SAP Suite adapter is installed. The CmdlineSAPSuiteBuilder enables a connection to an SAP R/3 system and delivers a particular IDoctype or schema (or its extension) in the form of a data definition format (.ddf) or schema (.xsd) file (see DDF in create mode or XSD in create mode). In List mode, the CMDLineSAPSuiteBuilder delivers a list of either IDocs or schemas from the SAP R/3 system to which it is connected. You can then use the .ddf and the .xsd in the Sterling B2B Integrator Map Editor to define your mapping requirements.

To use the utility, you should have a basic knowledge of:
  • Types of IDocs (and their extensions) and RFCs (RFMs) in an SAP R/3 system
  • Data formats (.ddf and .xsd)
  • Data mapping concepts
  • Sterling B2B Integrator Map Editor

Requirements

Based on SAP R/3 requirements for retrieving IDocs, the CMDlineSAPSuiteBuilder utility needs particular RFC function calls, including IDOCTYPE_READ_COMPLETE and IDOC_RECORD_READ. Before running the utility, confirm that the necessary RFC function calls are available.

Note: The IDOCTYPE_READ_COMPLETE and IDOC_RECORD_READ RFC function calls are available in SAP release 4.5A (as standard) or 4.0B (with the additional support packages SAPKH40B42 and SAPKH40B48).

Running the CmdlineSAPSuiteBuilder Utility

To run the CmdlineSAPSuiteBuilder utility, type one of the following commands:
  • UNIX:

    bin/runSAPClass.sh schemaGenerator.CmdlineSAPSuiteBuilder <arguments>

  • Windows:

    bin\runSAPClass.cmd schemaGenerator.CmdlineSAPSuiteBuilder <arguments>

    The bin/runSAPClass.sh or bin\runSAPClass.cmd script is a generic script that enables you to call any class (that has a main method) inside the SAP-related Sterling B2B Integrator environment (that is, the path begins with com.sterlingcommerce.Woodstock.services.sapsuite). Therefore, the script expects, as a first parameter, the name of the Javaclass call (in this case, schemaGenerator.CmdlineSAPSuiteBuilder). The script may also call another external class file inside the sapsuite environment.

    To see the syntax and usage information, type the command without <arguments>, with the following result:

    CmdlineSAPSuiteBuilder (Version 1.3)
    Usage:
    CmdlineSAPSuiteBuilder DDF <mode> <DDFBuilder-options>  or
    CmdlineSAPSuiteBuilder XSD <mode> <SchemaBuilder-options>
    <mode> ::= -c  create a DDF or XSD file (default)
    || -l  list IDOCs or RFCs.
    <DDFBuilder-options> - M)andatory or O)ptional - in create mode are:
    -e <Extension> O (CIMtype,  e.g. ZORDERS01)
    -i <IDOCType> M (Basictype e.g. ORDERS01)
    -n O (no IDoc version in records will be generated
    -o <outputfilename> O (name of DDF-file to be generated
    -p <propertyfilename> M (file with SAP specific properties)
    -s <Segment_Release>  O (SAP Release (3 alphanum. chars, e.g. 40B) )
    -v <Record Type Vers> O (allowed values: 2 or 3 (default) )
    <DDFBuilder-options> - M)andatory or O)ptional - in list mode are:
    -f <Filterargument>   M (search for a list of IDCOS e.g. ORDERS*)
    -o <outputfilename>   O (name of listfile that keeps the found elements
    -p <propertyfilename> M (file with SAP specific properties)
    -s <Segment_Release>  O (SAP Release (3 alphanum. chars, e.g. 40B) )
    <SchemaBuilder-options> - M)andatory or O)ptional - in create mode are:
    -o <outputfilename>   O (name of xsd-file to be generated
    -p <propertyfilename> M (file with SAP specific properties)
    -r <RFCname> M (RFCname whose Schema will be extracted)
    <SchemaBuilder-options> - M)andatory or O)ptional - in list mode are:
    -p <propertyfilename> M (file with SAP specific properties)
    -f <Filterargument> M (search for a list of BO's, BAPI's or RFC's 
                           depending on searchtype)
    -o <outputfilename> O (name of listfile that keeps the found elements)
    -t <searchtype> M (allowed values: BO or BAPI or RFC) 
    -a <additional arg> O (used in case of BAPI (M) or RFC (O) )

There is always a create mode or a list mode for DDF and for XSD. The following examples illustrate how to use the different modes of the CmdlineSAPSuiteBuilder utility:

DDF in create mode

<arguments> =

DDF -c -i ORDERS01 -s 45A -v 3 -p SAPreadIdoc.properties -o orders01.ddf

Create the ddf file orders01.ddf that contains the IDoc structure of the IDOCtype ORDERS01 of segment release 45A and record type version 3. The corresponding SAP-related host and user information are read from the file SAPreadIdoc.properties.

The CmdlineSAPSuiteBuilder utility requests the password for the SAP username (field User) as configured in the property file (this is the case in every mode).

In addition, the CmdlineSAPSuiteBuilder program writes to a log file whose name is specified with the token saplogger.logfilename in the property file log.properties. Its amount of output ranges from only fatal messages to all messages (NONE, FATAL, ERROR, WARN, TIMING, INFO, DEBUG, ALL). Its value depends on the token saplogger.loglevel in the same property file log.properties that is common to the SAP Suite adapter package. This logging mechanism is in every mode.

DDF in list mode

<arguments> =

DDF -l -f ORDERS -s 45A -p SAPreadIdoc.properties

Deliver to stdout a list of all IDoctypes (and/or extensions) beginning with the string ORDERS.

XSD in create mode

<arguments> =

XSD -c -r BAPI_MATERIAL_AVAILABILITY-p SAPreadIdoc.properties -o BAPI_Material_Availibility.xsd

Create an XML schema from the RFC BAPI_MATERIAL_AVAILABILITY that, in this case, stands for a particular BAPI of the BusinessObject MATERIAL in the file BAPI_Material_Availibility.xsd. SAP-related properties are read from the file SAPreadIdoc.properties.

XSD in list mode

Using this, it is possible to filter for RFCs, BAPIs, or BOs, depending on the search type used:
  • Listing of RFCs

    <arguments> =

    XSD -l -t RFC -f BAPI_SALESORDER_CREATEFROMDAT -p SAPreadIdoc.properties

    List all RFCs beginning with BAPI_SALESORDER_CREATEFROMDAT.

  • Listing of BOs

    <arguments> =

    XSD -l -t BO -f Mat -p SAPreadIdoc.properties

    List all BusinessObjects beginning with the string “Mat.”

  • Listing of BAPIs

    <arguments> =

    XSD -l -t BAPI -a MATERIAL -f Get -p SAPreadIdoc.properties

    List all BAPIs beginning with the string “Get” of the particular BusinessObject Material. Note that BAPIs can only be listed for one particular BusinessObject.

Property File Used by CmdlineSAPSuiteBuilder

The property file must be customized before using the utility. Each line in this file should have the following format:

<fieldname> = <value>

The following table describes the possible field names and their default values in the property file:

Note: All mandatory fields have no default value and therefore have to be set with the correct value. The range for the JCoTraceLevel is undocumented but the lowest level is 0 (no tracing).
Field Name Default Value Non LB, M or O/LB, M or O Notes/Used Datatype
Gwhost O IP address or hostname
Gwserv O  
Client M Three-digit number
User M Maximum of 12 characters
Lang EN O Exactly two characters
OutboundEncoding UTF-8 O Encoding used during generation of the DDF/schema definitions
Codepage 1100 O Four-digit number
LoadBalanced LB_OFF O If LB_OFF, the fields Ashost and Sysnr are mandatory. If LB_ON, the fields Mshost and R3name are mandatory.
Ashost M / - If not LoadBalanced: IP address or hostname
Sysnr M / - If not LoadBalanced: Number
Mshost - / M IP address of message server; if you used field name Ashost, this field is not used.
R3name - / M SAPSysID
RFCTrace RFCTRACE_OFF O switch on: RFCTRACE_ON
JCoTraceLevel 0 O Range: 0 - 9
JCoTracePath . O  

Error Messages

When the CmdlineSAPSuiteBuilder utility detects errors, the utility writes the errors to either stdout or to the logfile associated with saplogger.logfilename. Typically, errors are written to stdout only if during command-line parsing something was wrong. At this stage, the name of the logfile is still not known.

Business Process Definition Parameters – Transactions

The following table describes the business process parameters for transactions:

Parameter DataType/ HTML Type/ Validator/ Size/MaxSize Value/ Default Description
KeepSessionOpen String/text/ Number 0,1 BAPI only: Causes the SAP Suite adapter to leave the connection open after executing the BAPI.
SessionID String/text/ <sid> BAPI only: Causes the SAP Suite adapter to connect to the SAP system using the session <sid> that was opened in a previous call. For information, see KeepSessionOpen (above).
BapiCommitWait String/text 0, 1 BAPI only: BapiCommitWait is an optional parameter for a BapiCommit call. Causes the SAP Suite adapter to commit all pending calls and wait until the commit returns. (1=Wait, 0=Do not wait)
BapiCommit   0, 1 BAPI only: Causes the SAP Suite adapter to commit all pending calls without waiting. The result is returned in a primary document.
BapiRollback   0, 1 BAPI only: Causes the SAP Suite adapter to roll back all pending calls. The result is returned in a primary document.
RFCModuleName String/text   RFC/BAPI only: The name of the remote function module or BAPI RFC to be run.
Encoding String/text UTF-8 Specifies the character set.
CreateTID String/text <tid> RFC only: Open an SAP transaction and return a <tid> from SAP.
ConfirmTID String/text <tid> RFC only: Confirms all RFC calls run in the current transaction <tid>.
IDocPathName String/text   File-based IDoc RFC only: Specifies the name and path of the IDoc or status message from SAP system perspective.
IsStatusMessage String/text/ Number 0,1 File-based IDoc RFC only: Indicates whether the transferred file is a status message. (0=IDoc, 1=status Message)
AutoCommit String/text/ Number 0,1 BAPI only: Causes the SAP system to commit the BAPI call automatically after execution.
ServerResponse String/text/ Number 0,1 The Server Response flag (ServerResponse = 1) indicates that a response document for a waiting RFC outbound should be returned to SAP. If the Server Response flag is set to 1, then the ServerSessionID and ServerSessionSequenceNumber must be passed to the SAP Suite instance to uniquely identify the waiting session with an RFC server instance.
ServerSessionID String/text   The ServerSessionID uniquely identifies the destination RFC server instance of an SAP Suite instance for a server response. The ServerSessionID is generated by the RFC server and written into the process data of the started outbound business process.
ServerSessionSequenceNumber String/text   The ServerSessionSequenceNumber uniquely identifies the session within the RFC server instance (identified by ServerSessionID) waiting for the response. The ServerSessionSequenceNumber is generated by the RFC server and written to the process data of the started outbound business process.

Business Process Definition Parameters

The following tables describe the usage options of the business process parameters (IP = Instance Parameter, WP = Workflow Parameter):

Parameter (Type) Data Type / Html Type / Validator / Size / MaxSize Value / Default sRFC BAPI RFC IDoc ALE IDoc Client or Server
CloseSession (WP) String/text/ Number 0,1 O O - - C
KeepSessionOpen (WP) String/text/ Number 0,1 O O - - C
SessionID (WP) String/text/ <sid> O O - - C
BapiCommitWait (WP) String/text 0, 1 - 4.5:O 4.0: - - - C
BapiCommit   0, 1   O      
BapiRollback   0, 1   O      
RFCModuleName (WP) String/text   M M - - C
Encoding (IP/WP) String/text UTF-8 O O - - C
CreateTID (WP) String/text <sid> O O O O S
ConfirmTID (WP) String/text <sid> O O O O S
IDocPathName (IP/WP) String/text   - - M - S
IsStatusMessage (WP) String/text/ Number 0,1 - - O - C
AutoCommit (WP) String/text/ Number 0,1 - O ? O C
Serverresponse (WP) String/text/ Number 0,1 O O     S
ServerSessionID (WP) String/text   O O     S
ServerSessionSequenceNumber (WP) String/text   O O     S

Export Parameters

The following table describes the business process parameters when exporting parameters:

Parameter DataType/ HTMLType/Validator sRFC BAPI RFC IDoc ALE IDoc
SessionID String O O - -
TransactionID String O O - -

TID Management for SAP Outbound

The SAP Suite adapter manages transactional integrity for SAP outbound to confirm that an IDoc packet has been successfully processed once. The SAP R/3 system assigns a transaction ID (TID) for every IDoc packet. The SAP Suite adapter stores the TID in the Sterling B2B Integrator database in the SAP_TID table. Each row in the following table represents a separate IDoc packet and contains the following rows:

Row Description
DATE_TIME Date and time at which the TID table was updated.
TID (PK) SAP transaction ID.
STATE
  • CREATED – Received the TID from SAP R/3
  • EXECUTED – Received the IDoc message with the TID and committed the transaction
  • ROLLEDBACK – Rolled back the IDoc packet from further processing
  • CONFIRMED – IDoc message has been queued for processing and the transaction has been committed
WFID ID of the business process that has been started for processing the IDoc packet.
INSTANCE_NAME (PK) Name of the service configuration of the SAP Suite adapter that received the IDoc packet.
It is important that entries in the TID table can only be modified by the service configuration of the SAP Suite adapter that created the entry. This includes the following guidelines:
  • Multiple RFC servers connected to the same Program ID can share the same TID management .
  • RFC servers from different configurations of the SAP Suite adapter (and different Program IDs) cannot share the same TID management.

The Outbound Flow Process

The outbound flow proceeds as follows:
  1. SAP R/3 sends a TID to the service configuration of the SAP Suite adapter to which the RFC server is registered on the matching program ID.
  2. The RFC server receives the TID and checks the TID table to determine whether it has previously received this TID from SAP R/3 or not. If the TID is not found in the TID table, then the SAP Suite adapter appends an entry to the TID file, specifying the date-time stamp, TID, and the state (CREATED). The SAP Suite adapter returns a code to SAP R/3 indicating whether the TID was found, and the TID state determines whether SAP R/3 continues processing.
  3. If SAP R/3 continues processing, the SAP Suite adapter starts a new transaction.
  4. SAP R/3 sends the IDoc packet associated with the TID to the same service configuration of the SAP Suite adapter for this RFC server.
  5. The SAP Suite adapter receives the IDoc packet and processes the data according to the way that is defined in the outbound business process, such as splitting IDoc packets or making routing decisions based on a map file.
  6. After processing the data, the SAP Suite adapter returns success or an SAP exception (for example, if the target queue is full) to SAP R/3.
  7. Based on the status returned from the SAP Suite adapter, SAP R/3 instructs the same service configuration to commit or roll back the transaction and performs one of the following actions:
    • The SAP Suite adapter commits the transaction and updates the date-time stamp and state (EXECUTED) in the TID file.
    • The SAP Suite adapter call rolls back the transaction and updates the date-time stamp and state (ROLLBACK) in the TID file.
    • If the transaction is successfully committed, the SAP Suite adapter updates the date-time stamp and state (CONFIRMED) in the TID file.

Advanced Status Returned by the SAP Suite Adapter

The following table includes the advanced status that may be returned by the SAP Suite adapter:

Status Description
No Primary Document No primary document was available when the SAP Suite adapter started running. The primary document is needed for BAPI, ALE, and RFC and contains the data to send to SAP R/3.
Cannot Commit and Rollback at the same time, please check your settings! BAPI only. In the business process, both the BapiCommit and BapiRollback parameters are set to 1 at the same time, which is an invalid configuration.
Instance Parameter is missing A service configuration of the SAP Suite adapter that is needed for this mode is missing.
Found no Session to close BAPI only. While trying to actively close a session by using explicit business process parameters, the specified session in the Session ID parameter was not found. Check assignment of Session ID parameter.
No SessionID in Processdata found The SAP Suite adapter started with a command that awaits the Session ID to be set in the business process.
Can not Create and Confirm a TID at the same time RFC only. The SAP Suite adapter received instructions to create and confirm a TID (Transaction ID) at the same time. These instructions need to be separated into two different calls.
The TID value was empty when trying to confirm a TID! FC only. The SAP Suite adapter received instructions to confirm a TID, but the Transaction ID Parameter was empty.
WrongSessionID Connection session not found. Session ID may be expired.
OpenConnectionError Error while establishing connection. The reason is explained in the report.
DisconnectError Exception caught during disconnection.
NotConnectionPool The RFC server is not initialized. The Connection pool will not be available.
OpenConnectionError Error while establishing connection.
LoadNativeError Cannot load native middleware library. Check library path and availability of native libraries.
JCOError The library reported a fatal internal error. The native library may not be installed correctly.
NotMoreSession Could not create another session (Session Limit reached).
ExitBecauseShutDown No more sessions available; therefore, the SAP Suite adapter stops running.
RepositoryNotInit The repository is not initialized.
GetTemplateError Error when trying to retrieve a FunctionTemplate.
MetaDataNotAvailable The metadata is not available in the repository.
CleanupError Error during cleaning up JDBC connection.
RfcCallError Error invoking the SAP RFC call.
ListenerError Error in logging file listener.
SAPTableError Error in analysis of SAP table.
RfcServerError Error or Exception occurred in RFC server.
DisconnectError Exception detected during disconnection.
PoolThreadError Error in the connection pool test thread.
CreateTIDLogError JDBC did not create any rows in Transaction Management table.
DeleteTIDLogError JDBC did not delete a row in Transaction Management table.
LoadPropertyError Error while loading properties from properties file.
ToDomConvertError Error during the conversion to Document.
UpdateTIDLogError JDBC did not update a row in Transaction Management table.
TidMaintenaceError Error during maintenance of SAP_TID table.
OpenConnectionError Error while establishing connection.
BapiDiscpatcherTransformer Exception A problem occurred while mapping the Return Structure into process data.
BytesToDOMIOException An IO Problem occurred while transferring Bytes into a DOM.
BytesToDOMParserException The parser was not configured correctly while transferring bytes into a DOM.
BytesToDOMSaxException A Sax problem occurred while transferring bytes into a DOM.
DomToBytesIOException An IO problem occurred while transferring a DOM to bytes.
DomToBytesSaxException A Sax problem occurred while transferring a DOM to bytes.
DomToStringIOException An IO problem occurred while transferring a DOM to a string.
DomToStringSaxException A Sax problem occurred while transferring a DOM to a string.
ParserConfigurationException Parser configuration not property defined.
SENDALEAbapException (SendALE) An Abap exception occurred.
SENDALEJcoException (SendALE) A JCO exception occurred.

Running SAP Suite Adapter in an External JVM

The SAP Suite Adapter allows you to decide for each instance whether it should run within the Sterling B2B Integrator JVM (standard behavior for all adapters) or in an external Java Virtual Machine (JVM) managed by an SAP Controller Server.

When you run SAP Suite Adapter instances external to Sterling B2B Integrator, it provides stability to instance server and increases the critical IDoc size limit. For example, it does not affect the stability of Sterling B2B Integrator, when large IDoc files are received. We recommend you to configure SAP Suite Adapter instances to run in an external JVM if you receive IDocs more than 2 MB (or 4000 IDoc segments) frequently in Sterling B2B Integrator.

Configuring an SAP Suite Adapter in an External JVM

Adding SAP Controller Property

To setup SAP Suite Adapter instances to run in an external JVM, perform the following steps:
  1. Add SAPController property to SAP Suite property file for each instance run externally. For example, SAP.<sapsuite_instance_name>.SAPController=External
    Note: Make sure that there are no spaces before and after “=” as shown in the example.
    Property Description
    SAP.<sapsuite_instance_name>.SAPController (Optional) Indicates if the SAP Suite Adapter instance runs internally or externally.
    • Internal (default) – The SAP Suite Adapter instance runs in the Sterling B2B Integrator JVM.
    • External – The SAP Suite Adapter instance runs in an external JVM managed by a SAPController.
  2. Install SAP Controller Windows Service for Windows.
  3. Restart Sterling B2B Integrator.

Installing SAP Controller Windows Service (Windows only)

You have to install SAP Controller once as a Windows service if you want to run SAP Suite Adapter instances in an external JVM. The SAP Controller is not installed automatically with installWindowsService.cmd, as it is an optional service.

Note: Install SAP JCo libraries before you install SAP Controller Service.
To install SAP Controller Windows service, perform the following steps:
  1. Open command prompt.
  2. Navigate to <siroot>\bin directory.
  3. Type <siroot>\bin\InstallSAPControllerWindowsService.cmd and press Enter. The SAP Controller starts automatically after the installation is complete.

Starting the SAP Controller Server

The SAP Controller server should be started and registered to the Sterling B2B Integrator JNDI context to start external SAP Suite instances in an external JVM.

Before starting the SAP Controller server, make sure that:
  • The SAP JCo libraries are installed on the SAP Controller server.
  • The SAP Controller server is started on the same machine where Sterling B2B Integrator is installed.
  • If Sterling B2B Integrator uses a 64-bit JVM, follow the steps described in Modifying SAP Controller JVM Settings for 64-Bit Platforms before starting SAP Controller (add -d64 JVM option).
  • Modify the security.properties file as described in Modifying Security Properties to make sure that Sterling B2B Integrator passphrase is recognized when the SAP Controller starts.

If you have configured SAP Suite instances as external in sap.properties property file and required for Windows only, the SAP Controller Windows service is installed and then the server starts automatically by the standard Sterling B2B Integrator scripts run.sh (UNIX) or startWindowsService.cmd (Windows). However, if you remove the external properties from sap.properties file and uninstall the SAP Controller Windows service on Windows, the SAP Controller will no longer start automatically with the Sterling B2B Integrator scripts run.sh (UNIX) and startWindowsService.cmd (Windows).

When the SAP Controller is starting, it automatically starts all external SAP Suite instances configured as external with status as active. After the SAP Controller is started, the external SAP Suite instances are ready for inbound and outbound communication.

A file sapcontroller.pid is created in <siroot> directory indicating that SAP Controller is running. This file contains the process ID of the SAP Controller.

When the Sterling B2B Integrator is started and SAP Suite instances are enabled, you can see the registered SAP Controller and one or more external SAP Suite instances with JNDI name suffix SapSuite_<node>.ext in the Sterling B2B Integrator JNDI tree.

To view SAP Suite instances:
  1. Login to Sterling B2B Integrator.
  2. Select Operations > System > Troubleshooter. The System Troubleshooting screen appears.
  3. Select JNDI Tree. The SAP Suite instances appear along with other instances running in the system.
    Name ClassName
    SAPController.node1 com.sterlingcommerce.woodstock.services.sapsuite.controller.SAPController
    <instance>_SapSuite_node1.ext<instance>_SapSuite_node1 com.sterlingcommerce.woodstock.services.sapsuite.SapSuiteServerImplcom.sterlingcommerce.woodstock.services.sapsuite.SapSuiteServerImpl
    Note: SAP Suite internal instances are also registered along with external instances.

Starting the SAP Controller Server Manually

To start the SAP Controller Server manually, perform the following steps:
  1. Open command prompt.
  2. Navigate to <siroot>\bin directory.
  3. Type the following command and press Enter.
    • For UNIX: <siroot>/bin/startSAPController.sh
    • For Windows: <siroot>\bin\startSAPControllerWindowsService.cmd

      The SAP Controller Server starts and displays the following output:

      SAP Controller started [PID=1958290], Log=<siroot>/logs/sapcontroller.log]

You can view the SAP Controller Service in the Windows Services dialog with the status Started as shown in the following figure. The port number may be different on your system.

Window Services Dialog

Stopping the SAP Controller Server

The SAP Controller Server can be stopped by executing the following scripts:
  • UNIX: <siroot>/bin/stopSAPController.sh

    The file, sapcontroller.pid is deleted from the <siroot> directory indicating that SAP Controller Server is stopped.

  • Windows: <siroot>\bin\stopSAPControllerWindowsService.cmd

    You can also stop the SAP Controller service from the Windows Services dialog.Sterling B2B Integrator

Enabling, Disabling, or Reconfiguring External SAP Suite Adapter Instances

The SAP Suite adapter instances running externally on an SAP Controller Server can be created, enabled, disabled, or reconfigured in the Sterling B2B Integrator administration interface similar to the instances that run internally.

Enabling or disabling External SAP Suite Adapter Instances

The System Troubleshooting > Adapters screen displays both internal and external SAP Suite Adapter instances. If you disable an external SAP Suite adapter instance, the SAP Controller shuts down the instance and you will not be able to send or receive transmissions from the connected SAP system.

However, if you enable a previously disabled external SAP Suite adapter instance, the SAP Controller starts the instance again and reestablishes the connection to the SAP system.

Reconfiguring External SAP Suite Adapter Instances

If you change one or more global or instance properties of an external SAP Suite Adapter instance in the SAP Suite Adapter configuration menu and save the changes, the external adapter instance restarts with the new configuration properties automatically.

SAP Controller Logs

The SAP Controller creates a log file sapcontroller.log in the startup phase under <siroot>/logs directory. After you register the SAP Controller in Sterling B2B Integrator, it uses the standard SAP Suite log file sap.log. The SAP Controller log level is similar to the log level configured for SAP Suite Adapter.

Uninstalling the SAP Controller Windows Service (Windows only)

To uninstall SAP Controller Windows service, perform the following steps:
  1. Open command prompt.
  2. Navigate to <siroot>\bin directory.
  3. Type uninstallSAPControllerWindowsService.cmd and press Enter. The SAP Controller is uninstalled.

The SAP Controller is not uninstalled automatically with uninstallWindowsService.cmd as it an optional service.

Restarting SAP Controller Service

You can restart the SAP Controller Service by following the stop script steps as mentioned in Stopping the SAP Controller Server and start as mentioned in Starting the SAP Controller Server section.

When the SAP Controller is starting, it automatically starts all external SAP Suite instances configured as external with status as active. After the SAP Controller is started, the external SAP Suite instances are ready for inbound and outbound communication.

Checking SAP Controller Service Failover

The script startSAPIsAliveChecker[.cmd|.sh] is a diagnosis tool to check for the SAP Controller Server state and the SAP Suite instances running in the controller.

You can call this script from the command line for the following purposes:
  • Check if the SAP Controller server has started successfully and registered in the Sterling B2B Integrator JNDI context (default). The exit code of the script is 0 if the SAP Controller server is running and registered in the Sterling B2B Integrator JNDI server or it is positive number if the SAP Controller has not started successfully.
  • List all SAP Suite Adapter instances started on SAP Controller Server (-1 option).
  • Build a script to check the SAP Controller status and restart the SAP Controller automatically in situations when the SAP Controller JVM is terminated in an exception situation. For example, see the following script:

    Unix:

<siroot>/bin/startSAPIsAliveChecker.sh [-l [<count>]] 
         [-w <loop_wait_period>] 
         startSAPIsAliveChecker.sh -s  

Windows:

siroot>\bin\startSAPIsAliveChecker.cmd [-l [<count>]] 
[-w <loop_wait_period>] 
startSAPIsAliveChecker.sh –s
Parameter Description
-l <count> (Optional) Executes <count> is-alive checks.
  • If <count> is omitted, perform checks permanently.
  • If -l <count> is omitted then a single check is performed (same as –l 1)
Default: 1 or permanently
-w <wait_period> (Optional) Sets wait period between checks. Default: 10.000 ms
-s (Optional) Prints list of SAP Suite instances started in SAP Controller Server

Restarting SAP Controller Server Example

The following scripts check the status of the SAP Controller and restart it if it is not active.

UNIX Example

The following script starts the SAP Controller server automatically if it is not active. It executes periodically by the standard UNIX scheduling mechanism crontab. The following crontab file checks the SAP Controller in an interval of 15 minutes each:

(15 * * * * <si_root>/install/bin/checkSAPController.sh)
#!/bin/sh 
# Restart SAP Controller Service if it is not active
cd <si_root>/install/bin 
startSAPIsAliveChecker.sh 
rc=$? 
if [ $rc -ne 0 ]; then
  echo "The SAP Controller Server needs to be restarted [rc=$rc]"
  stopSAPController.sh
 startSAPController.sh
  exit 1 
fi

Windows Example

The following script starts the SAP Controller server automatically if it is not active:

Windows, CheckSAPController.cmd 
@echo off  
setlocal 
cd <si_root>\install\bin
call startSAPIsAliveChecker.cmd 
set rc=%errorlevel% 
if %rc% NEQ 0 (
  echo The SAP Controller Server needs to be restarted (rc=%rc%)"
  stopSAPControllerWindowsService.cmd
 startSAPControllerWindowsService.cmd
  exit /B %rc% 
)	

Modifying SAP Controller JVM Settings

You should never change the SAP Controller parameter default values unless you experience unusual situations like out-of-memory exceptions during operation. You can change values if you are asked to by IBM® support.

Modifying SAP Controller JVM Settings for 32-Bit Platforms

To change the JVM heap memory settings:

UNIX script - startSAPController.sh.in
  1. Open startSAPController.sh.in in an Editor. For example, vi.
  2. Search for the lines -

    # Java heap memory settings

    SAPCONTROLLER_JVMARGS="-Xms256m -Xmx1024m"

  3. Change the heap size at startup (option –Xms<min_size>) or the maximum heap size (option –Xmx<max_size>) as instructed by IBM Support.
  4. Save the file and run setupfiles.sh.
Windows script - InstallSAPControllerWindowsService.cmd
  1. Open command prompt.
  2. Type uninstallSAPControllerWindowsService.cmd and press Enter.
  3. Open InstallSAPControllerWindowsService.cmd.in in an Editor. For example, notepad.
  4. Search for the lines -

    REM Java heap memory settings

    echo -Xms256m >> %PARAM_FILE%

    echo -Xmx1024m >> %PARAM_FILE%

  5. Change the heap size at startup (option –Xms<min_size>) or the maximum heap size (option –Xmx<max_size>) as instructed by IBM Support.
  6. Save the file and run setupfiles.cmd
  7. Run installSAPControllerWindowsService.cmd to install the service with the modified JVM settings.

Modifying SAP Controller JVM Settings for 64-Bit Platforms

To change the JVM heap memory settings:

UNIX script - startSAPController.sh.in
  1. Open startSAPController.sh.in in an Editor. For example, vi.
  2. Search for the lines -

    # Java heap memory settings

    SAPCONTROLLER_JVMARGS="-Xms256m -Xmx1024m"

  3. Add Java 64-Bit-Option “-d64” as follows -

    SAPCONTROLLER_JVMARGS="-d64 -Xms256m -Xmx1024m"

  4. Save the file and run setupfiles.sh.
Windows script - InstallSAPControllerWindowsService.cmd
  1. Open command prompt.
  2. Type uninstallSAPControllerWindowsService.cmd and press Enter.
  3. Open InstallSAPControllerWindowsService.cmd.in in an Editor. For example, notepad.
  4. Search for the lines -
    REM Java heap memory settings 
    echo -Xms256m >> %PARAM_FILE% 
    echo -Xmx1024m >> %PARAM_FILE%
  5. Add the following line before these lines -

    echo -d64 >> %PARAM_FILE%

  6. Save the file and run setupfiles.cmd.
  7. Run installSAPControllerWindowsService.cmd to install the service with the modified JVM settings.

Heap Memory Consumption Example

The RFC call parameters are transferred over the network and collected in the RFC server component of the SAP Suite Adapter in heap memory. The RFC server component is part of the SAP JCo libraries, which consist of a Java layer and an underlying native code layer. The RFC Server allocates Heap Memory to store the actual RFC parameters transferred in the RFC call. This data size may be considerably higher than the sum of the used data in all RFC parameters (“raw” data size). The SAP Suite adapter always transfers the complete data structure with fixed maximum length records including the unused fields independent of whether the parameter is filled with data or not.

The following section analyses an example with an IDoc of 20 MB “raw” data size:

A MATMAS IDoc with 71300 lines (100 IDocs with 713 lines per Idoc) is transferred with the standard SAP outbound RFC call. Each line represents one IDOC_DATA_REC40 structure in SAP, which is 1063 bytes. You can compute the IDoc size in Java heap memory as follows:

71,300 lines x 1,063 byte/line x 2 bytes/char = 151,583,800 bytes

In the RFC native layer, 75,791,900 bytes will be temporary allocated by “libRFC“ outside of the Java heap additionally. Therefore, a total of 227,375,700 bytes are allocated by the SAP JCo libraries. Additionally, the heap space allocated by the SAP Suite Adapter has to be added: The SAP JCo libraries pass the IDoc data to the SAP Suite Adapter in a data structure that does not contain unused data any more. While processing the IDoc data, the SAP Suite Adapter allocates about 3x raw data size heap memory, which is 3 x 20MB = 60MB. In the example a total of 227 MB + 60 MB = 287 MB is allocated on the heap for a “raw” 20 MB IDoc.

Layer Memory Consumption of a 20MB Idoc [bytes]
Outside Java Heap - native layer 75,791,900
Java Heap - SAP JCo library 151,583,800 bytes
Java Heap - SAP Suite layer 60,000,000
Total 287,000,000

The following general formula computes the allocated heap space in bytes for an IDoc with “#idoc_lines” and a raw data size of “idoc_raw_size” bytes:

Layer Computation Formula for Memory Consumption
Outside Java Heap - native layer #idoc_lines * 1063 bytes
Java Heap - SAP JCo library #idoc_lines * 1063 bytes * 2 bytes/Unicode-char
Java Heap - SAP Suite layer 3 * idoc_raw_size
Total

idoc_lines * 3189 bytes + 3 * idoc_raw_size

Modifying Security Properties

You can modify the security.properties file to make sure that Sterling B2B Integrator pass phrase is recognized when the SAP Controller starts.

To modify the security.properties file:
  1. Open the properties/security.properties file.
  2. At the end of the file, add the following line -

    enc_pass=<encrypted_gis_passphrase>

    where <encrypted_gis_passphrase> is the encrypted pass phrase of Sterling B2B Integrator.

  3. Save and close the file.
    Note: Use the encrypt_string.sh tool to get the encrypted version of your Sterling B2B Integrator pass phrase.

Usage Examples

The following sections contain examples using the SAP Suite adapter for inbound and outbound processing.

Inbound and Outbound IDoc Processing Preconditions

The inbound and outbound IDoc examples in the following sections focus only on the SAP Suite adapter configuration and the SAP inbound and outbound business processes for sending and receiving IDocs.

To use the SAP inbound and outbound business processes to process EDI files, you need to perform the following additional steps:
  1. Create maps that translate EDI to IDoc format (inbound processing) and IDoc format to EDI (outbound processing).
  2. Create a business process for sending the translated IDoc to EDI file to the trading partner (outbound processing).
  3. Define inbound and outbound EDI envelopes based on the EDI type (such as EDIFACT and X12) and:
    • Specify the translation maps for inbound and outbound processing .
    • Specify the SAP inbound business process for sending IDocs to SAP, and the business process for sending translated IDoc to EDI files to the trading partner.
  4. Configure SAP inbound and outbound routes for the inbound and outbound IDocs. See Configuring an Inbound Route and Configuring an Outbound Route.
  5. Configure SAP inbound and outbound cross-references to tie the SAP inbound route and SAP outbound route to the appropriate trading partner EDI envelopes. See Configuring an Inbound Cross-Reference and Configuring an Outbound Cross-reference.

Inbound Processing Examples

This section contains examples for the following inbound processing scenarios:
  • Sending an IDoc using Application Linking and Enabling (ALE) to an SAP system
  • Starting an SAP Business Application Programming Interface (BAPI) module to retrieve and return company information to Sterling B2B Integrator

Sending an IDoc Using ALE

The following example illustrates an SAP Suite adapter configuration used for sending an IDoc document using ALE technology:

Sending an IDoc Using ALE

(Screen 1 of 2)

Sending an IDoc Using ALE

(Screen 2 of 2)

The following example using the GPM illustrates a business process that uses the SAP Suite adapter to send an IDoc using ALE technology to an SAP system. The dimmed values were specified on the SAP Suite adapter configuration instance.

Sending an IDoc Using ALE

(Screen 1 of 4)

Sending an IDoc Using ALE

(Screen 2 of 4)

Sending an IDoc Using ALE

(Screen 3 of 4)

Sending an IDoc Using ALE

(Screen 4 of 4)

The following example illustrates the same business process using BPML. The IDoc file orders.dat is the input passed to the business process and becomes the primary document. The primary document is input to the SAP Suite adapter.

Sending an IDoc Using ALE

The following example illustrates information returned from SAP to the business process, indicating that the SAP system transaction manager allowed Sterling B2B Integrator to open a transaction:

Sending an IDoc Using ALE

Starting an SAP BAPI Module

The following example illustrates an SAP Suite adapter configuration used for starting a BAPI in an SAP system to retrieve company information.

Starting an SAP BAPI Module

(Screen 1 of 2)

Starting an SAP BAPI Module

(Screen 2 of 2)

The following example illustrates the input passed to the business process.

Starting an SAP BAPI Module

The following example using the GPM illustrates a business process that uses the SAP Suite adapter to start the BAPI_COMPANY_GETDETAIL BAPI. The dimmed values were specified in the SAP Suite adapter configuration instance.

Starting an SAP BAPI Module

(Screen 1 of 5)

Starting an SAP BAPI Module

(Screen 2 of 5)

Starting an SAP BAPI Module

(Screen 3 of 5)

Starting an SAP BAPI Module

(Screen 4 of 5)

Starting an SAP BAPI Module

(Screen 5 of 5)

The following example illustrates the same business process using BPML.

Starting an SAP BAPI Module

The following example illustrates the company information returned from SAP to the business process as a primary document. The information is returned in XML format.

 <BAPI_COMPANY_GETDETAIL> 
	<COMPANYID>999999</COMPANYID> 
	<COMPANY_DETAIL> 
 	<COMPANY>999999</COMPANY> 
 	<NAME1>HANDSOME, INC</NAME1> 
 	<NAME2/> 
 	<COUNTRY>USA</COUNTRY> 
 	<LANGU>E</LANGU> 
 	<STREET>5555 EAST MARTIN AVE</STREET> 
 	<PO_BOX/> 
 	<POSTL_COD1>80220</POSTL_COD1> 
 	<CITY>DENVER</CITY> 
 	<CURRENCY>DOLLAR</CURRENCY> 
 	<COUNTRY_ISO>USA</COUNTRY_ISO> 
 	<CURRENCY_ISO>DOLLAR</CURRENCY_ISO> 
 	<LANGU_ISO>USA</LANGU_ISO> 
	</COMPANY_DETAIL> 
	<RETURN> 
 	<TYPE/> 
 	<CODE/> 
 	<MESSAGE/> 
 	<LOG_NO/> 
 	<LOG_MSG_NO>000000</LOG_MSG_NO> 
 	<MESSAGE_V1/> 
 	<MESSAGE_V2/> 
 	<MESSAGE_V3/> 
 	<MESSAGE_V4/> 
	</RETURN> 
</BAPI_COMPANY_GETDETAIL> 

In addition, the SAP Suite returns session information from the SAP system and puts it in the process data of the initiating business process. For example:

 <?xml version="1.0" encoding="UTF-8"?> 
<ProcessData> 
 <PrimaryDocument SCIObjectID="server1:252e596c:fb4e22589c:-76b0"/> 
 <BapiCallReturnStructure> 
    <RETURN> 
     <TYPE/> 
      <CODE/> 
     <MESSAGE/> 
      <LOG_NO/> 
     <LOG_MSG_NO>000000</LOG_MSG_NO> 
     <MESSAGE_V1/> 
      <MESSAGE_V2/> 
     <MESSAGE_V3/> 
      <MESSAGE_V4/> 
   </RETURN> 
  </BapiCallReturnStructure> 
</ProcessData> 

Outbound Processing Examples

This section contains examples for the following outbound processing scenarios:
  • Receiving a file-based IDoc from an SAP system using RFC
  • Receiving an ALE/IDoc from an SAP system using RFC
  • Receiving a request from SAP and returning a synchronous response using RFC

Receiving a File-based IDoc from SAP Using RFC

This section includes an example SAP Suite adapter configuration and the predefined SAPOutboundIDoc business process that runs when a file-based IDoc is received from an SAP system.

The following example illustrates an SAP Suite adapter configuration used for receiving a file-based IDoc from an SAP system.

Receiving a File-based IDoc from SAP Using RFC

The following example using the GPM illustrates the SAPOutboundIDoc business process that runs by the SAP Suite adapter for an outbound file-based IDoc. This business process retrieves the filed-based IDoc from a directory on the SAP system and processes the file (translates the IDoc to EDI format and sends it to a trading partner). In addition, the business process starts a subprocess that uses an instance of the SAP Suite adapter to send a status message back to the SAP system.

Receiving a File-based IDoc from SAP Using RFC

(Screen 1 of 2)

Receiving a File-based IDoc from SAP Using RFC

(Screen 2 of 2)

The following example illustrates the same business process using BPML.

Receiving a File-based IDoc from SAP Using RFC

Receiving a File-based IDoc from SAP Using RFC

Receiving a File-based IDoc from SAP Using RFC

Receiving a File-based IDoc from SAP Using RFC

Receiving a File-based IDoc from SAP Using RFC

Receiving a File-based IDoc from SAP Using RFC

The following example illustrates the status message sent to the SAP system upon successful completion of the outbound business process that ran.

Receiving a File-based IDoc from SAP Using RFC

An SAP administrator can then view the status messages in the SAP system.

Receiving an ALE IDoc from SAP Using RFC

This section includes an example SAP Suite adapter configuration and the predefined SAPOutboundALE business process that runs when an IDoc is received from an SAP system using ALE technology.

The following example illustrates an SAP Suite adapter configuration used for receiving an IDoc from an SAP system using ALE Technology.

Receiving an ALE IDoc from SAP Using RFC

The following example using the GPM illustrates the SAPOutboundALE business process that runs by the SAP Suite adapter for an outbound ALE IDoc. With ALE technology, the IDoc is included in the outbound request and becomes the primary document for the outbound business process that ran. The business process processes the IDoc (translates the IDoc to EDI format and sends it to a trading partner). In addition, the business process starts a subprocess that uses an instance of the SAP Suite adapter to send a status message back to the SAP system.

Receiving an ALE IDoc from SAP Using RFC

(Screen 1 of 2)

Receiving an ALE IDoc from SAP Using RFC

(Screen 2 of 2)

The following example illustrates the same business process using BPML.

Receiving an ALE IDoc from SAP Using RFC

Receiving an ALE IDoc from SAP Using RFC

Receiving an ALE IDoc from SAP Using RFC

alt="Receiving an ALE IDoc from SAP Using RFC"

alt="Receiving an ALE IDoc from SAP Using RFC"

The following example illustrates the status message sent to the SAP system upon successful completion of the outbound business process that ran.

EDI_DC40 900    46C   2   SYSTAT01
    STATUS      ALETSTPORTLI  0000001111                       
                                                               
   SAPI02    LS  SITEST        20040408041857                  
                                                               
                                                 
E2STATS001
     900       000001000000  EDI_DS40  90000000000006922012004040804185724
           Sterling SAPSuite         Control information of EDI
subsystem OK                                                   
                                                               
                                                               
                                                               
                                                               
                                        S 
E2STATS001
     900       000002000000  EDI_DS40  90000000000006922012004040804185706
           Sterling SAPSuite           Translation OK          
                                                               
                                                               
                                                               
                                                               
                                                               
                                                               
         S 
E2STATS001     
900       000003000000  EDI_DS40  90000000000006922012004040804185708
           Sterling SAPSuite          Syntax check OK          
                                                               
                                                               
                                                               
                                                               
                                                               
                                                               
        S 
E2STATS001      900
      000004000000  EDI_DS40  90000000000006922012004040804185710
           Sterling SAPSuite          Interchange handling OK  
                                                      
                                                               
                                                               
                                                               
                                                               
                                                               
   S 

An SAP administrator can then view the status messages in the SAP system.

Receiving a Request from SAP and Returning a Synchronous Response Using RFC

This section includes an example SAP Suite adapter configuration and an example business process that runs when a request is received from an SAP system that requires a synchronous response. For example, a trading partner might need a price list for a particular order item before fulfilling the order.

Preconditions :
  • The RFC must exist in the SAP system so the SAP Suite adapter can retrieve the RFC metadata description for it.
  • The RFC must be registered in the RFC server of the SAP Suite adapter so the RFC server can listen for the selected RFC call.

You register an RFC in the SAP Suite adapter configuration instance that receives outbound RFC requests.

Examples:

The following example illustrates a simple custom RFC module Z_TRIGGERSI that starts by the SAP system. This RFC module has two import parameters – PARAM and VALUE – and one export parameter – RES.

FUNCTION Z_TRIGGERSI. 
*"---------------------------------------------------------------------- 
*"*"Locale Interface: 
*"  IMPORTING 
*"  VALUE(PARAM) TYPE  STRING OPTIONAL 
*"  VALUE(VALUE) TYPE  STRING OPTIONAL 
*"  EXPORTING 
*"  VALUE(RES) TYPE  STRING 
*"---------------------------------------------------------------------- 
write 'test'. 
 
ENDFUNCTION. 

The following example illustrates an SAP Suite adapter configuration used for receiving the RFC request.

Receiving a Request from SAP and Returning a Synchronous Response Using RFC

(Screen 1 of 2)

Receiving a Request from SAP and Returning a Synchronous Response Using RFC

(Screen 2 of 2)

When an outbound RFC is detected by the SAP Suite adapter, the RFC server runs the business process specified on the SAP Suite adapter configuration. The RFC parameters are input to the business process and become the primary document. For example:

<?xml version="1.0" encoding="UTF-8"?> 
<Z_TRIGGERSI> 
<PARAM>AAA</PARAM> 
<VALUE>BBB</VALUE> 
<RES></RES> 
</Z_TRIGGERSI>

The following example using the GPM illustrates an example business process that starts by the SAP Suite adapter for an outbound RFC request. This business process creates and returns a response to the RFC back to SAP.

Receiving a Request from SAP and Returning a Synchronous Response Using RFC

The following example illustrates the same business process using BPML.

Receiving a Request from SAP and Returning a Synchronous Response Using RFC

Note: You must set the ServerResponse parameter to 1 and pass it to the SAP Suite adapter used for sending a response back to SAP. Additionally, you must pass the ServerSessionID and ServerSessionSequenceNumber parameters to the SAP Suite adapter. Both ServerSessionID and ServerSessionSequenceNumber parameters are passed using process data in the previous example. See Business Process Definition Parameters for a description of these parameters.

The following example illustrates the response sent back to the SAP system:

<Z_TRIGGERSI>
<RES>My Response</RES> 
</Z_TRIGGERSI> 

Connection Retry

When the SAP Suite adapter is started during the application startup, the RFC Server tries to establish a connection to the SAP System configured in the adapter instance. The default behavior of the RFC Server component is to keep trying to establish a connection until it successfully opens a connection.

However, for some permanent login error types, no retry is performed. For example, if the configuration has a wrong SAP user password, then no retry is performed because the error has to be resolved manually (by entering the correct password). Also, no retry is performed if a login fails because of a locked SAP user, which requires the SAP Administrator to manually unlock the user.

Sometimes, the SAP user that is used to login by the SAP Suite adapter is locked during SAP maintenance, and then unlocked after the maintenance. In this case, the User locked error must be treated as a temporary error condition and a connection retry is required so that the RFC Server can reconnect automatically after the SAP user is unlocked.

Perform the following steps to enable the connection retry in case of a locked SAP user for a SAP Suite adapter instance:
  1. In the install_dir/properties directory, add the following line at the end of the sap.properties file:

    SAP.instance_name.UnconditionalConnectionRetry = Yes

    instance_name must be replaced by the name of the SAP Suite adapter instance.

  2. Save the file.
  3. Restart the application.

Troubleshooting Tips

This section contains troubleshooting tips for using the SAP Suite adapter.

Java Error in the SAP Outbound Business Process

For the SAPOutboundIDoc.bp, if the FS_WriteEDI service (which is a instance of the File System adapter) is not configured properly to extract data, the Advanced Status column in the Business Process Monitor page displays the following Java error message:

java.io.FileNotFoundException

In addition, the Status Report column does not provide a report. In this circumstance, the FS_WriteEDI service is working as designed. However, the Advance Status Details will show that a file was not found occurs if the FS_WriteEDI service is not configured correctly.