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.
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:
On Windows:
Copy the sapjco3.dll dependency library
to the local subdirectory
C:\SAP_JARS.
Copy the sapjco3.jar JAR file into the same local
subdirectory C:\SAP_JARS
(the sample references this subdirectory).
Copy the sapidoc3.jar JAR file into the same local
subdirectory C:\SAP_JARS
(the sample references this subdirectory).
On Linux:
Copy the libsapjco3.so dependency library
to the local subdirectory
/opt/SAP_JARS.
Copy sapjco3.jar into the same local subdirectory
/opt/SAP_JARS.
Copy sapidoc3.jar into the same local subdirectory
/opt/SAP_JARS.
Modify the attributes of the files so that you have read
and execute access to all of the the files.
Optional: Update the SAP JCo and IDoc JAR location:
Import the sample.
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.
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.
Create the RFC connection from the SAP system to the integration node:
Log in to your SAP system.
Go to the SM59 transaction: Configuration of RFC connections.
Click TCP/IP connections,
click Create.
Check that the connection type is set to T.
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.
On the Technical Settings tab, select
Registered Server Program.
Set Program ID to match the Program ID that is specified in
the integration node adapter; for example, SAMPRFC.
Click Save to save the settings.
Enter a description in the Description 1 field; for example,
RFC for Sample.
Enter a description in the Description 2 field; for example,
your name.
Click MDMP & Unicode.
Select Unicode.
In the window that is displayed, click the green tick.
Click Save.
Create a Logical System:
Go to the BD54 transaction: Change/View
Logical Systems.
In the window that is displayed, click the green tick, which warns that the table is
cross-client.
Click New Entries.
Enter a name for the logical system in the first field; for
example, SAMPRFC.
Enter a description for the logical system in the second field;
for example, Logical System for sample.
Click Save.
A window is displayed:
If a workbench request number is
displayed, click the green tick.
If no number is displayed:
Click New Request,
enter a description in the Create Request window.
To generate a request number,
click Save.
Click the green tick to continue.
Go to transaction SCC4: Display/view
Clients Overview.
Double-click the client that you are using; for example,
001.
On the next page, make a note of the entry in the
Logical System field;
for example, CLNT001.
Create a Distribution Model:
Go to transaction BD64: Maintenance of
Distribution Model.
Switch to Edit mode by pressing the F9 key.
Click Create model view.
Enter a Short Text description;
for example, Model for sample.
Enter a Technical Name;
for example, SAMPRFC.
Click the green tick.
Select the entry that you created, click
Add message type.
In the window, select the Sender field, click the icon
next to the Sender field.
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.
Click the green tick.
Select the Receiver field,
click the icon that is next to the Receiver field.
Select the Logical System that you have created; for example,
SAMPRFC. Click the green tick.
In Message Type, enter MATMAS (the
type of IDoc that you use in the sample), click the green tick.
In the Distribution Model window, click Save.
Expand the Model you have created to view the model, sender, receiver,
and message type.
Select the message type MATMAS.
Click Environment > Generate Partner
Profiles.
In Generate Partner Profile,
click Execute to generate a result screen.
Review the generated items.
Go to transaction WE21: Ports in IDoc
processing.
Expand Ports/Transactional RFC.
The new port is displayed at the bottom of the list.
The port has a name format similar to A0000000xx.
Click the port and enter a description.
Click Save.
Review the Partner Profile:
Go to transaction WE20: Partner profiles.
Expand Partner Profiles/Partner Type LS,
click the partner that you created; for example, SAMPRFC.
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.
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.
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
To verify that the properties are set up correctly, run the
following command:
mqsireportproperties IB9NODE -c EISProviders -o SAP -r
Stop and restart the integration node by using the following commands:
Expand the SapInboundMatMasSampleMSet message set project.
Click Adapters > Inbound > SAP.
To open an editor in which you can specify the connection parameters
that are required to access your SAP system, double-click
SapMatMasInbound.inadapter.
Enter the following settings in the editor:
Gateway host name or IP address.
Gateway service; for example, sapgw00.
To find the Gateway Service use the transaction code SMGW (Gateway
monitor) in the Remote TP Name column.
RFC Program ID; for example,
SAMPRFC.
SAP Client ID (from SAP txn SCC4 ).
Username. The user name for the SAP system.
Password. The password that corresponds to the user name.
Language Code. The language code, if the language is not English.
Hostname or
IP address. The host name or IP address of the SAP application server.
SAP System Number.
Save the updated adapter.
Expand the SapInboundMatMasSampleMFlow Integration project.
To open the Broker Archive editor, double-click
SapInboundMatMasSample.bar.
Click the Prepare tab.
Click Build broker archive.
Save the broker archive.
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.
Expand the SapOutboundCustomerMSet message set project.
Click Adapters > Outbound > SAP.
To open an editor in which you can specify the connection parameters that are
required to access your SAP system, double-click
SapCustomerOutbound.outadapter.
Enter the following settings in the editor:
Username for SAP system.
Password. The password that corresponds to the user name.
SAP Client ID.
Language Code. The language code, if the language is not English.
Hostname or
IP address. The host name or IP address of the SAP application server.
SAP System Number.
Save the updated adapter.
Expand the SapOutboundCustomerSampleMFlow Integration project.
To open the Broker Archive editor, double-click
SapOutboundCustomerSample.bar.
Click the Prepare tab.
Click Build broker archive.
Save the broker archive.
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.