 | This article discusses important concepts and best practices to use when integrating with SAP. It is outside the scope of this article to fully document every aspect of the application's interfaces including record types and field definitions. Please consult the application's official documentation for full reference information. As always, familiarity with the data of the systems to be integrated is strongly advised. |
General Concepts
Every SAP Connector call consists of a request message and a response message. When getting data from SAP, the request message contains selection criteria and the response message contains the resulting data records. When sending data into SAP, the request message contains the data records to insert/update and the response contains the status of the call.
The format of the request and response messages are represented by the Request and Response XML Profiles selected in the SAP Operation Component. You use these Profiles in Maps to transform to/from other formats.
Sending Data to SAP
Sending data to SAP always produces a response message with the result of the import. You should always interrogate the response to determine whether the action completed successfully. Every standard BAPI has a BAPIRET2 table structure with a field TYPE. Possible values: (S)uccess, (E)rror, (W)arning, (I)nformation, (A)bort (terminated). If calling a custom BAPI/function, you may need to interrogate a different field depending how you designed the function's export/table parameters. Use a Decision shape to evaluate the return code/status and handle failures by creating a dynamic alert message or exception in the Process.
Best Practices
- BAPI vs. IDoc - For use with Boomi, BAPIs are preferred over IDocs because BAPIs are processed synchronously. This means Boomi can determine whether the transaction was successful. With IDocs, Boomi simply submits the IDoc for subsequent SAP processing and cannot determine the actual outcome of the transaction.
- Custom BAPIs - Although SAP provides a number of Standard BAPI's, it is often necessary/desirable to develop a custom function to perform the required logic. Sometimes the custom function can serve as a lightweight "wrapper" that performs some initial validation or cross reference steps before calling an existing standard function. To import your custom function using the Import Wizard, you must assign the function to a Business Object and assign the function's Development Class to a Component.
- Security - Create a separate user account/authorization profile for Boomi and other applications that need to connect to SAP. Set them up as non-dialog users and restrict access to only what they need (you may need to do some trial and error to determine all the dependencies). Use SAP transaction "SU02" to modify the Authorization Profile S_A.SCON, then maintain values for object S_RFC.
Miscellaneous
Although the Operation Import Wizard only displays BAPIs and IDocs, technically you can invoke any remote-enabled function. However, you will need to create the request and response XML Profiles manually. Here are the general structures:
<REQUEST>
<YOUR-FUNCTION-NAME>
<INPUT>
<YOUR-FIELD_1>
<YOUR-FIELD_2>
...
</INPUT>
<TABLES>
<YOUR-TABLE-NAME>
<item>
<TABLE-FIELD_1>
<TABLE-FIELD_2>
...
</item>
</YOUR-TABLE-NAME>
...
</TABLES>
</YOUR-FUNCTION-NAME>
</REQUEST>
|
<RESPONSE>
<YOUR-FUNCTION-NAME>
<OUTPUT>
<YOUR-FIELD_1>
<YOUR-FIELD_2>
...
</OUTPUT>
<TABLES>
<YOUR-TABLE-NAME>
<item>
<TABLE-FIELD_1>
<TABLE-FIELD_2>
...
</item>
</YOUR-TABLE-NAME>
...
</TABLES>
</YOUR-FUNCTION-NAME>
</RESPONSE>
|
Additional Resources
BAPI Programming Guide
BAPI Programming Guide Reference