Adapter Services
Overview
Adapter services for Adapter for SAP work by executing a function module residing on an SAP system. A function module performs functions against data in the SAP system.
You can create a service for any function module that is designated for external use (for example: ‘remote enabled'). This includes all BAPIs, which are formalized function modules.
Before you can create an adapter service, you must configure an RFC client connection to the SAP system you want to access. You identify a connection alias and specify information that is required to connect to the SAP system. To create an adapter service, you select the SAP system and the RFC that you want the service to execute. After creating the adapter service, you can create a client that invokes the service.
This chapter describes how to create an adapter service for a specific function module on one specific SAP system and how to test the adapter service.
Creating an Adapter Service that Executes an RFC
To create an adapter service that executes an RFC, select the RFC Adapter Service template. This feature allows the function module to be exposed as a standard service. After you create the adapter service, business partners interested in calling this service can incorporate it into their client code.
Terminology
To use Adapter for SAP successfully, you should understand the following terms and concepts:
| Term | Description |
|---|---|
| Export | Output parameters of a function module. Output parameters are simple values or structures. |
| Function Signature | Specifications of the import, export, and table parameters of an function module. Also known as a function interface. |
| Import | Input parameter to an RFC. Input parameters are simple values (such as string or number) or structures. |
| RFC Adapter Service | Adapter for SAP terminology for an association between a function module on an SAP system and an adapter service based on the RFC Adapter Service template on Adapter for SAP. |
| Structure | SAP data structure containing one or more fields. This can be thought of as a single row of a table. |
| Table | SAP data structure that is both an import and export to a function. Tables can be created and passed to an RFC. The function module can modify these tables and return them. The tables themselves are no different from relational database tables; they consist of a series of fields and rows of data for these fields. |
Creating an RFC Adapter Service
About this task
Use the following procedure to create an RFC adapter service that makes a remote function call to a function module on the SAP system. This example shows how to create an RFC adapter service for RFC_FUNCTION_SEARCH.
To create an adapter service for an RFC
Procedure
Testing the RFC Adapter Service
About this task
Use the following procedure to test the RFC adapter service you just created.
To test an RFC adapter service for a function module
Procedure
Results
After you create an RFC adapter service that executes a function module, you can create other services and clients that invoke the service.
LOGLIST. To pass
this table, click
Set Value
for this parameter.
If the empty table should only be the default value, unselect Overwrite Pipeline Value. With these setting, the optional table is always returned.
Posting an RFC-XML Document from an HTTP Client
There are several possible ways to invoke the RFC adapter service which will call a function module. It is important that you understand the namespace convention for services. (For more information, see IBM webMethods Integration Server Administrator’s Guide for your release. )
You can invoke the service illustrated previously by calling the following URL:
http://<Integration Server>:<port>/invoke/<folder1>.<folder2>/<service>
Invoking the RFC Adapter Service from a Browser
About this task
To invoke the service
Procedure
Results
The HTTP Body must consist of the XML document, encoded in RFC-XML. Depending on whether the call was processed successfully, you will get a response or an exception XML document. You can also force Adapter for SAP to invoke the function module with tRFC by setting a transaction ID in the Envelope of the XML document. However, you should bear in mind that only function modules without return parameters can be called with tRFC.
Invoking the RFC Adapter Service Using the pub.client.http Service
About this task
To use the pub.client.http service
Procedure
Results
For more information about the pub.client:http service, see IBM webMethods Integration Server Built-In Services Reference for your release.