Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Adapter Connections | Testing the Execution of a BAPI Via XML | Generating XML Calls for a BAPI
 
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.