Setting up the SAP Connectivity sample

The SAP Connectivity sample was developed for a level of SAP that has a given definition of various SAP objects. If you encounter any problems when you run the sample, ensure that the definitions are correct by regenerating these objects for the local SAP system against which you want to run the sample. You can perform this action by running the Adapter Connection wizard from the Integration Development perspective: Click File > New > Adapter Connection, and select Sample_SAPAdapter_Tx.

The following sections describe the configuration setup that is required to run the samples that demonstrate the SAPInput and SAPRequest nodes.

Enable the Adapter Connection Project to locate the SAP JCo Libraries and JAR file and SAP IDoc JAR file

  1. For the SAP samples to be successfully built after you have imported them, you must make the SAP Java Connector (SAP JCo) interface libraries and JAR file and SAP IDoc JAR file available to the Adapter Connection Project:
  2. Optional: Update the SAP JCo and IDoc JAR location:
    1. Import the sample.
    2. Right-click the Adapter Connection project, CWYAP_SAPAdapter_Tx, select Properties > Java Build Path > Library Tab and specify the correct location of sapjco3.jar and sapidoc3.jar for the appropriate platform.

Configure the SAP system for the SAP Inbound sample

When you are using integration node inbound messaging, you must configure the SAP system so that it can uniquely identify the integration node as a target destination. SAP creates several components (RFC Destinations, Ports, Logical Systems, Distribution Models, and Partner Profiles) to configure this connection.

  1. Create the RFC connection from the SAP system to the integration node:
    1. Log in to your SAP system.
    2. Go to the SM59 transaction: Configuration of RFC connections.
    3. Click TCP/IP connections, click Create.
    4. Check that the connection type is set to T.
    5. Set RFC Destination name to an appropriate value; for example, SAMPRFC. Ensure that the name of the RFC Destination is eight characters or fewer, and use the same name to replace SAMPRFC wherever it is used in this sample. To use different names for the following steps, consult the documentaton for your SAP system to understand how you can use different names. However, for this sample, use the same name for all created objects.
    6. On the Technical Settings tab, select Registered Server Program.
    7. Set Program ID to match the Program ID that is specified in the integration node adapter; for example, SAMPRFC.
    8. Click Save to save the settings.
    9. Enter a description in the Description 1 field; for example, RFC for Sample.
    10. Enter a description in the Description 2 field; for example, your name.
    11. Click MDMP & Unicode.
    12. Select Unicode.
    13. In the window that is displayed, click the green tick.
    14. Click Save.
  2. Create a Logical System:
    1. Go to the BD54 transaction: Change/View Logical Systems.
    2. In the window that is displayed, click the green tick, which warns that the table is cross-client.
    3. Click New Entries.
    4. Enter a name for the logical system in the first field; for example, SAMPRFC.
    5. Enter a description for the logical system in the second field; for example, Logical System for sample.
    6. Click Save.
    7. A window is displayed:
      • If a workbench request number is displayed, click the green tick.
      • If no number is displayed:
        1. Click New Request, enter a description in the Create Request window.
        2. To generate a request number, click Save.
        3. Click the green tick to continue.
    8. Go to transaction SCC4: Display/view Clients Overview.
    9. Double-click the client that you are using; for example, 001.
    10. On the next page, make a note of the entry in the Logical System field; for example, CLNT001.
  3. Create a Distribution Model:
    1. Go to transaction BD64: Maintenance of Distribution Model.
    2. Switch to Edit mode by pressing the F9 key.
    3. Click Create model view.
    4. Enter a Short Text description; for example, Model for sample.
    5. Enter a Technical Name; for example, SAMPRFC.
    6. Click the green tick.
    7. Select the entry that you created, click Add message type.
    8. In the window, select the Sender field, click the icon next to the Sender field.
    9. A window is displayed with a selection of Logical Systems, select the client name that you noted from the SCC4 transaction in the step 2j; for example, CLNT001.
    10. Click the green tick.
    11. Select the Receiver field, click the icon that is next to the Receiver field.
    12. Select the Logical System that you have created; for example, SAMPRFC. Click the green tick.
    13. In Message Type, enter MATMAS (the type of IDoc that you use in the sample), click the green tick.
    14. In the Distribution Model window, click Save.
    15. Expand the Model you have created to view the model, sender, receiver, and message type.
    16. Select the message type MATMAS.
    17. Click Environment > Generate Partner Profiles.
    18. In Generate Partner Profile, click Execute to generate a result screen.
    19. Review the generated items.
    20. Go to transaction WE21: Ports in IDoc processing.
    21. Expand Ports/Transactional RFC. The new port is displayed at the bottom of the list. The port has a name format similar to A0000000xx.
    22. Click the port and enter a description.
    23. Click Save.
  4. Review the Partner Profile:
    1. Go to transaction WE20: Partner profiles.
    2. Expand Partner Profiles/Partner Type LS, click the partner that you created; for example, SAMPRFC.
    3. In the Outbound parameters table, double-click the message type MATMAS. A window is displayed that contains the generated port name, for example, A0000000xx; and a basic type of MATMAS05.

Configure the integration node runtime with SAP JCo Libraries

To deploy message flows with SAP nodes, you must configure the integration node runtime with the prerequisite SAP JCo Libraries. These libraries are used by the underlying SAP adapter component to establish connections with the SAP system.

You must run the following mqsichangeproperties commands from a command environment to set the location of the directories that contain the SAP JCo Libraries.

  1. Run the following commands, changing the SAP client directory to match your platform and your choice of location:
    mqsichangeproperties  IB9NODE -c EISProviders -o SAP -n jarsURL -v C:\SAP_JARS
    mqsichangeproperties IB9NODE -c EISProviders -o SAP -n nativeLibs -v C:\SAP_JARS
  2. To verify that the properties are set up correctly, run the following command:
    mqsireportproperties IB9NODE -c EISProviders -o SAP -r
  3. Stop and restart the integration node by using the following commands:
    mqsistop IB9NODE
    mqsistart IB9NODE

Configure the connection details for the SAP inbound adapter

  1. Import the SAP sample into your workspace.
  2. Expand the SapInboundMatMasSampleMSet message set project.
  3. Click Adapters > Inbound > SAP.
  4. To open an editor in which you can specify the connection parameters that are required to access your SAP system, double-click SapMatMasInbound.inadapter.
  5. Enter the following settings in the editor:
    1. Gateway host name or IP address.
    2. Gateway service; for example, sapgw00. To find the Gateway Service use the transaction code SMGW (Gateway monitor) in the Remote TP Name column.
    3. RFC Program ID; for example, SAMPRFC.
    4. SAP Client ID (from SAP txn SCC4 ).
    5. Username. The user name for the SAP system.
    6. Password. The password that corresponds to the user name.
    7. Language Code. The language code, if the language is not English.
    8. Hostname or IP address. The host name or IP address of the SAP application server.
    9. SAP System Number.
  6. Save the updated adapter.
  7. Expand the SapInboundMatMasSampleMFlow Integration project.
  8. To open the Broker Archive editor, double-click SapInboundMatMasSample.bar.
  9. Click the Prepare tab.
  10. Click Build broker archive.
  11. Save the broker archive.
  12. Deploy the SapInboundMatMasSample.bar BAR file to the SapSample integration server: Right-click the BAR file and select deploy, or drag the BAR file to the integration server.

Configure the SAP outbound adapter

  1. Import the SAP sample into your workspace.
  2. Expand the SapOutboundCustomerMSet message set project.
  3. Click Adapters > Outbound > SAP.
  4. To open an editor in which you can specify the connection parameters that are required to access your SAP system, double-click SapCustomerOutbound.outadapter.
  5. Enter the following settings in the editor:
    1. Username for SAP system.
    2. Password. The password that corresponds to the user name.
    3. SAP Client ID.
    4. Language Code. The language code, if the language is not English.
    5. Hostname or IP address. The host name or IP address of the SAP application server.
    6. SAP System Number.
  6. Save the updated adapter.
  7. Expand the SapOutboundCustomerSampleMFlow Integration project.
  8. To open the Broker Archive editor, double-click SapOutboundCustomerSample.bar.
  9. Click the Prepare tab.
  10. Click Build broker archive.
  11. Save the broker archive.
  12. Deploy the SapOutboundCustomerSample.bar BAR file to the SapSample integration server: Right-click the BAR file and select deploy, or drag the BAR file to the integration server.

Back to sample home