Adapter Connections
Overview
This chapter describes how to configure and manage Adapter for SAP connections. For more information about how adapter connections work, see Adapter Connections.
Before Configuring or Managing Adapter Connections
About this task
To prepare to configure or manage adapter connections
Procedure
- Install IBM webMethods Integration Server and Adapter for SAP on the same machine. See Installing, Upgrading, and Uninstalling the adapter for details.
- Make sure you have webMethods administrator privileges so that you can access Adapter for SAP's administrative screens. For information about setting user privileges, see IBM webMethods Integration Server Administrator’s Guide for your release.
- Start your Integration Server and Integration Server Administrator, if they are not already running.
- Using Integration Server Administrator, make sure the WmSAP package is enabled. See Enabling Packages for instructions.
- Using Designer, create a user-defined package to contain the connection, if you have not already done so. For more information about managing packages for the adapter, see Managing the Adapter Package.
Configuring Adapter Connections
About this task
Use the following procedure to define the parameters that Adapter for SAP will use to establish a connection to an SAP system. Adapter for SAP requires a connection to the SAP system whenever functionality from the SAP system is to be invoked; that is whenever Adapter for SAP acts as a client for an SAP system. But also when Adapter for SAP receives a call from an SAP system, it needs to make a call back to the calling system to look up the function interface or IDoc definition from the SAP Data Dictionary (DDIC).
To configure an adapter connection
Procedure
Setting Up the SAP System for SNC Connections
If you want to use SNC connections with the SAP system, you must configure the SAP system to accept both SNC and non-SNC connections from Adapter for SAP.
When connecting to the SAP system, Adapter for SAP creates two types of connection pools for each connection alias: an SAP repository connection pool and an SAP runtime connection pool. The following table describes each adapter connection pool.
| Connection Pool Type | Description |
|---|---|
| Repository |
|
| Runtime |
|
To use SNC connections, you must configure the following settings in the SAP system.
| SAP system settings for SNC | Table/Parameter |
|---|---|
| General SAP system settings for SNC: | Table
SNCSYSACL
(SM30, view VSNCSYSACL, TYP=E)
SNC name entry of Adapter for SAP. |
| Certificate log in: General Settings: |
|
| Certificate log in: User specific settings: | Table
USREXTID (view
VUSREXTID), Category DN
Entry with DN (Distinguished Name) from user certificate The Seq.No. 000 is the default entry. Set entry active. |
For detailed information about the SAP application server settings for SNC, see your SAP documentation.
Dynamically Changing a Service's Connection at Run Time
For Adapter for SAP, you can change the service's connection in one of two ways.
The adapter services that ship with Adapter for SAP in the WmSAP package in the pub.sap namespace include a field called serverName. By using this field, you can specify at run time the SAP system to be updated.
Additionally, Integration Server enables you to override the default connection associated with the service at design time. To override the default, you must code your flow to pass a value through the pipeline into a service's $connectionName field.
For example, you have a flow whose primary purpose is to create an entry on the production SAP system. However, you want the flow to have the capability to create the entry on the test server, with the decision of which SAP system to update to be made programmatically at run time. The output signature of the flow's first service contains a field called Target. The flow could branch based on the value in Target.
- If Target contains the value "production," the second service in the flow would ignore $connectionName-thus using its default connection to connect to (and then update) the production SAP system.
- However, if Target contains the value "test," the second service in the flow would use the value in the $connectionName from the pipeline and connect to (and then update) the test SAP system.
Keep in mind that both connections-the default and override-must have the same SAP classes and methods metadata, RFCs, and BAPIs.
For more information, see Changing the Connection Associated with an Adapter Service at Run Time.
Enabling Adapter Connections
About this task
A connection must be enabled before you can configure any adapter service using the connection, or before an adapter service can use the connection at run time. You enable adapter connections using Integration Server Administrator.
To enable a connection
Procedure
Viewing Adapter Connections
You can view adapter connections and each connection's parameters from the Integration Server Administrator or from Designer.
Viewing Adapter Connections Using Integration Server Administrator
About this task
To view the adapter connections using Integration Server Administrator
Procedure
Viewing Adapter Connections Using Designer
About this task
To view the adapter connections using Designer
Procedure
Editing Adapter Connections
About this task
If a connection parameter changes, or if you want to redefine parameters that a connection uses when connecting to an SAP system, you can update a connection's parameters using Integration Server Administrator.
After you edit a connection, you must reload the WmSAP package for the change to take effect.
To edit a connection
Procedure
Copying Adapter Connections
About this task
You can copy an existing Adapter for SAP connection to configure a new connection with the same or similar connection properties without having to re-type all of the properties for the connection. You copy adapter connections using Integration Server Administrator.
To copy a connection
Procedure
Deleting Adapter Connections
About this task
If you no longer want to use a particular Adapter for SAP connection, you can delete it by following the instructions in this section. You delete adapter connections using Integration Server Administrator.
If you delete a connection, the adapter services or notifications that are defined to use the connection will no longer work. However, you can change which connection an adapter service uses. Therefore, if you delete a connection, you can assign a different connection to an adapter service and re-use the service. To do this, you use the built-in webMethods function setAdapterServiceNodeConnection. For more information, see Changing the Connection Associated with an Adapter Service at Design Time.
To delete a connection
Procedure
Disabling Adapter Connections
About this task
Adapter for SAP connections must be disabled before you can edit or delete them. You disable adapter connections using the Integration Server Administrator.
To disable a connection
Procedure
Testing the Execution of an RFC
About this task
After you have verified that you can connect to an SAP system, you can use the following procedure to verify that the SAP system accepts and processes an RFC request from Adapter for SAP.
To test an RFC from Adapter for SAP
Procedure
- In the Adapters menu in the Integration Server Administrator navigation area, click IBM webMethods Adapter for SAP.
- In IBM webMethods Adapter for SAP menu, click Lookup.
- From the drop down list in the System ID field, select the system ID of the SAP system that hosts the function module you want to test.
-
In the
Function
Name field of the
Function
Search group, enter the name of the function module you want to
test. For example, enter
RFC_FUNCTION_*. Click Search. Adapter for SAP searches for all RFCs that begin with RFC_FUNCTION_. - In the list of matching RFCs that is returned, follow the link of the RFC you want to test. For this example, select RFC_FUNCTION_SEARCH. Adapter for SAP displays the function signature for the selected function module. It lists the imports, exports, and tables comprising this function module.
- Select Test Function to invoke the function module on the SAP system you selected in step 3 of this procedure.
-
Enter
RFC_*in the field FUNCNAME and click Test Functionagain to proceed. After a few moments, a screen displays the number of functions found. - Follow the entries link beside this row count to view the functions found.
Testing the Execution of an RFC-XML
About this task
You can invoke a function module with RFC-XML from Adapter for SAP user interface via the Lookup screen. This screen contains an RFC-XML template you can use to invoke function modules. Perform the following procedure to access the Lookup screen and invoke a function module via RFC-XML.
To invoke a function module via XML from Adapter for SAP
Procedure
Testing the Execution of a BAPI Via XML
The lookup-tool comes with a built-in BAPI Browser. You can use this tool for an overview of the BAPI interfaces inside your SAP system, and also to directly call a BAPI via XML.
Starting to Browse
About this task
You can start browsing your BAPIs using the Lookup tab. Here you can enter the name of a business object and a BAPI. This selection always applies to the SAP system selected in the field System ID.
There are several ways you can fill out the form:
- In the group BAPI By Name enter the full name of the business object and BAPI. You can either view the details of the BAPI by selecting Lookup or directly invoke the BAPI via XML by clicking bXML.
- In the group BAPI By Name enter only the name of the business object. Select Lookup to view details of the business object and select one BAPI from the list of available BAPIs for the business object.
- In
the group
BAPI By
Name enter
*in the business object field to view a list of all business objects available in the selected system.
Displaying a List of Business Objects in the System
About this task
By entering
* in the business
object field on the Lookup main page, you can view a list of all business
objects available on the selected system.
Each link in this list represents a business object. If you follow the link, you will get a detailed view of this business object. This list can also contain business objects that do not contain BAPI methods.
Displaying a Business Object
About this task
By entering a correct name of a business object in the corresponding field on the Lookup main page, you can view detailed information for this business object. The detailed information consists of a list of all the key fields of a business object and a list of all its BAPI methods. For business objects, which only provide instance-independent methods ("static" methods in programming languages like C or JAVA), the Key fields list is empty.
For business objects that do not provide BAPIs, the list of BAPIs will be empty.
Just follow the links to the corresponding table fields to display more information on a specific key field or BAPI.
Displaying a BAPI
By entering the full name of the business object and BAPI in the corresponding field on the Lookup main page, you can display detailed information of the BAPI. You can also display this information by following the corresponding link on the display page for a business object.
| Field | Description |
|---|---|
| Static method | The Static method flag is true if the BAPI is an instance-independent method. In practice, that means that you do not have to specify the business objects key fields when calling this method. |
| Dialog method | The Dialog method flag is true if the method is a dialog method. If the method is not using a dialog, the flag is false. Dialog BAPIs require a SAPGui. |
| Factory method | The Factory method flag is true if the BAPI is used to create an object instance inside the SAP system. Factory methods return the key fields of the business object. |
| Function module | The Function module is the message type that has to be used to set up routing for synchronous calls coming from an SAP system. This is technically realized via RFC, so here the name of the corresponding RFC function module inside the SAP system is provided. Although it is possible at the moment, it is not recommended to call BAPIs directly via RFC-XML, as this would only be an implementation-dependent view of the BAPI. |
| ALE message type | The ALE message type is the message type that has to be used to set up routing for asynchronous calls coming from an SAP system. This is technically implemented via IDoc transfers, but when using the BAPI styled XML calls, the ALE message type is only needed to set up routing. |
| Parameters | The Parameters field contains a list of all parameters in the BAPI interface. By selecting this link, you can display more information on each parameter. Please note that the key fields of a business object are not displayed in this parameter area but in the Key fields area on the business object detail page. |
By clicking the Create XML template button, you can generate the XML message that has to be used to invoke this BAPI via XML. After it has been generated, you can immediately send the XML to the SAP system for testing purposes (see below).
Displaying a BAPI Parameter
By selecting a specific parameter from the list of parameters provided on the BAPI detail page, you can display additional information for this parameter.
| Field | Description |
|---|---|
| Internal Name | Parameter name of the underlying RFC. |
| Direction | The use-direction of the parameter is displayed. BAPIs use importing, exporting and changing (= importing and exporting) parameters. |
| Optional | If the flag Optional is set to true, you can omit this parameter in an XML message. Usually, the implementation inside the SAP system uses specific default values for optional parameters that were omitted. |
| Table | If the flag Table is set to true, this parameter may consist of several lines. Each line has the data type specified in the ABAP Dictionary Type field. |
| ABAP Dictionary Type | The ABAP Dictionary Type is a link to the data type description used for this parameter. This may be a whole structure or just a field of a structure. By following the hyperlink, you will always see the whole structure. |
Displaying a Key Field
By selecting a specific key field from the list of key fields provided on the business object detail page, you can display additional information for this key field.
| Field | Description |
|---|---|
| Internal Name | Parameter name of the underlying RFC. |
| ABAP Dictionary Type | The
ABAP
Dictionary Type is a link to the data type description used for
this parameter. This is usually a field of a structure inside the SAP Data
Dictionary. By following the hyperlink, you will see the whole structure.
Note: Key fields are used with
instance-dependent (non-static) methods and with factory methods.
In calls to these methods, the key fields of the corresponding business object have to be specified as attributes of the business document root element. For example, using the key field
|
Generating XML Calls for a BAPI
By entering the full name of the business object and BAPI in the corresponding field on the Lookup main page and then choosing Create XML Template, you can generate an XML message representing the call to this BAPI. You can also generate this message by following the corresponding link on the display page for a BAPI.
The page displays the XML message needed to call the BAPI which is wrapped in the BizTalk XML envelope. You can edit the XML and enter your specific data into the pre-generated XML elements for parameters and key fields.
You can also adjust the pre-generated information in the BizTalk XML header fields that are filled with default data.
There are three ways of calling the BAPI, which can be selected through the list:
- Synchronously calling the BAPI in an SAP system.
- Asynchronously calling the BAPI in an SAP system. This only works for BAPIs that are mapped to an ALE interface. To see whether the BAPI is mapped to an ALE interface, check the BAPI detail page. If an ALE message type is specified, the BAPI can be called asynchronously.
- Applying routing notification: The call will be sent to the BAPI inbound process of the routing listener that will check if a routing notification for this BAPI call exists and will forward the call to the specified service. This will only work if a correct routing notification has been setup, otherwise you will receive an XML error message.
After clicking Invoke, the result of your XML call is displayed. In the case of synchronous processing, this will be a BizTalk message with either the exporting parameters of the BAPI or with an error message.
For asynchronous calls, this will be a BizTalk message with an empty body in the case of success or with an error message, if the message could not be delivered to an SAP system. Application specific errors are not returned in the case of asynchronous calls, but you can use the ALE monitoring tools in the target SAP system to check these errors.
Posting a BAPI from an HTTP Client
For information about calling a BAPI from an external client using an XML document, see Routing BAPIs Through Adapter for SAP.