...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
In this article
Table of Contents | ||||
---|---|---|---|---|
|
Overview
...
Info | ||||
---|---|---|---|---|
| ||||
BAPI technology in SAP is based on import and export parameters that determine the parameters that must be provided (import) and parameters to be returned (export). You can test the BAPI's in the SAP client through transaction code Import parameters contain data to be transferred from SnapLogic to the BAPI. Specific values must be provided as import parameters for the BAPI to execute and return the desired data.
The list of BAPI's in a particular SAP client varies depending on the level of customization. However, an exhaustive set is delivered as standardized BAPI's which provide basic functions and can be used to read and write or change data for most SAP Business Objects. BAPIs for Reading DataThe following BAPIs provide you with read-only access to data in the associated business object:
BAPIs for Creating or Changing DataThe following BAPIs can create, change or delete instances of a business object:
|
Snap Type
SAP Execute Snap is a Write-type Snap.
Prerequisites
Have the SAP BASIS administrator setup the user to be used in the appropriate SAP clients with certain set of authorizations. To execute a BAPI as part of your application program, you must have the appropriate authorizations set up in respective master records. The documentation provided with the BAPI contains information about the required authorizations. Any attempts to execute a BAPI that fail as a result of insufficient authorization are reported back to the calling application.
Limitations and Known Issues
None.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Snap Views
...
...
- Mapper
Document that conforms to the input view schema of the Snap. The document attributes are matched to the SAP BAPI metadata, and the matching attributes are provided to the BAPI program at execution, and any non-matching attributes are ignored.
The attributes can be tabular and structured or scalar. The Snap makes an API call for each document. If there is no input document, the Snap calls the BAPI with no input data.
Note |
---|
Only some BAPIs may be able to process without input. Refer to your BAPI documentation for the BAPIs that correctly processes with no input data. |
...
- JSON Splitter
- Mapper
- Any document processing Snap
...
Document which represents the record structure of the retrieved BAPI output definition. The documents are populated using the result data of each BAPI call for each document passed into this Snap. If the Snap has no input document, only one output document result is created.
...
Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. Learn more about Error handling in Pipelines.
The available options are:
Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.
Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.
Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.
Note |
---|
SAP BAPIs do not enforce standard error messaging, so error views of Snaps that are downstream of the SAP Execute Snap should be set to Discard Error Data and Continue. Else, your Pipeline will fail to run. |
Snap Settings
...
Field Name
...
Description
Label*
Default Value: SAP Execute
Example: SAP BAPI Create Orders
...
Specify a unique and meaningful name for the Snap.
BAPI List configuration
...
Use this field set to configure the list of BAPIs to return. This field set contains the following fields.
BAPI List config key
Default Value:OBJECTTYPE
Example: RELEASED_FUNC
...
Select a key to configure the BAPI list that is being returned. The available options are:
- OBJECTTYPE
- SHOW_RELEASE
- BAPIS_POTENTIAL
- BAPIS_NEW
- BAPIS_OLD
- RELEASED_BAPI
- RELEASED_FUNC
...
Define a value to configure the BAPI list that is being returned. Learn more about object types.
BAPI*
Default Value: N/A
Example: BAPI_MONITOR_GETLIST
...
Specify the BAPI on the SAP server to be executed. This is the ABAP name.
Start Stateful Call Sequence
Default Value: Deselected
...
Select this checkbox to create a stateful session for calling one (or more) BAPIs.
Note |
---|
A Session ID is required if you want to create a stateful call sequence. |
Info |
---|
Ensure to select this checkbox for the Snap where you define your first BAPI call in the Pipeline. Do not select the Commit after BAPI execute checkbox for this Snap, to extend the stateful session and call more BAPIs using this Pipeline (downstream to this Snap). 'Sequence' implies that the output from a BAPI call is needed for the next BAPI call to run. |
Commit after BAPI execute
Default Value: Deselected
...
Select this checkbox to end the stateful session and commit when no exception is raised; else, the BAPI controls the commits.
Info |
---|
Ensure to select this checkbox for the Snap where you define your last BAPI call in the Pipeline. Do not select the Start Stateful Call Sequence checkbox for this Snap. Do not select both Start Stateful Call Sequence and Commit after BAPI execute checkboxes for all other BAPI calls between the first and the last calls in the sequence. For example, Second BAPI call in a 3-call sequence; Second, Third, and Fourth BAPI calls in a 5-call sequence. |
Session ID
Default Value: [None]
Example:xyz987
...
Specify the string to identify a specific session.
All Snaps in a specific stateful call sequence must be in the same session ID, and there should be only call sequence running in a session at a time. If you do not provide any session ID, the Snap runs in its own session.
Date conversion format
Default Value: yyyyMMdd
Example: yyyyMMdd
...
Specify the format to convert string input values into SAP date/datetime fields in SimpleDateFormat.
If you do not specify any value, then no conversion is done and the SAP client displays an error when an input view string is mapped to SAP date/datetime field.
...
Output date time as Text
Default Value: Deselected
...
Select to output date and time as a String data type instead of a DateTime object.
...
Use this field set to define error path and values for handling errors. If any error paths and their error values match a corresponding value in the output document, then the document is routed to the error view (if enabled), or the Snap fails (if error view is disabled).
If you do not define the error handling, the Snap will not by default fail or route anything to the error view if the RETURN[*].TYPE value is 'E'.
...
Default Value: $RETURN[*].TYPE
Example: $RETURN[*].TYPE
...
Specify the error path to which the errors should route.
...
Default Value: E
Example: R
...
Specify the value for the error.
Max request attempts*
Default Value: 3
Example:5
...
Specify the maximum number of SAP connection attempts to make in case of a failure. When you specify 0, the Snap makes infinite connection attempts.
...
Default value: 5
Example: 5
...
Default value: Deselected
...
Select this checkbox to write configuration errors to the error view. If the error is non-recoverable, the errors (especially connection errors such as exception handling) are routed to the error view with relevant information.
...
Default value: Deselected
...
Select this checkbox to reload the metadata (latest schema) for the current BAPI function before executing the BAPI function.
...
In this article
Table of Contents | ||||
---|---|---|---|---|
|
Overview
You can use this Snap to execute the SAP Business API (BAPI) with the given input data. The BAPI input schema and output schema must correctly map data into the SAP BAPI.
...
Info |
---|
SAP BAPIs for IntegrationBAPI technology in SAP is based on import and export parameters that determine the parameters that must be provided (import) and parameters to be returned (export). You can test the BAPI's in the SAP client through transaction code Import parameters contain data to be transferred from SnapLogic to the BAPI. Specific values must be provided as import parameters for the BAPI to execute and return the desired data.
The list of BAPI's in a particular SAP client varies depending on the level of customization. However, an exhaustive set is delivered as standardized BAPI's which provide basic functions and can be used to read and write or change data for most SAP Business Objects. BAPIs for Reading DataThe following BAPIs provide you with read-only access to data in the associated business object:
BAPIs for Creating or Changing DataThe following BAPIs can create, change or delete instances of a business object:
|
Snap Type
The SAP Execute Snap is a Write-type Snap.
Prerequisites
Set up the user (the SAP BASIS administrator should create the user) to be used in the appropriate SAP clients with a specific set of authorizations. To execute a BAPI as part of your application program, you must have the appropriate authorizations set up in respective master records. The documentation provided with the BAPI contains information about the required authorizations. Any attempts to execute a BAPI that fail as a result of insufficient authorization are reported back to the calling application.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description | ||
---|---|---|---|---|---|---|
Input | Document | Min: 0 |
| Document that conforms to the input view schema of the Snap. The document attributes are matched to the SAP BAPI metadata, and the matching attributes are provided to the BAPI program at execution, and any non-matching attributes are ignored.
| ||
Output | Document | Min: 1 |
| Document which represents the record structure of the retrieved BAPI output definition. The documents are populated using the result data of each BAPI call for each document passed into this Snap. If the Snap has no input document, only one output document result is created. | ||
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. Learn more about Error handling in Pipelines.
|
Snap Settings
Field Name | Field Type | Description | |||||||
---|---|---|---|---|---|---|---|---|---|
Label* Default Value: SAP Execute | String | Specify a unique and meaningful name for the Snap. | |||||||
BAPI List configuration | Use this field set to configure the list of BAPIs to return. This field set contains the following fields. | ||||||||
BAPI List config key Default Value:OBJECTTYPE | Dropdown list | Select a key to configure the BAPI list that is being returned. The available options are:
| |||||||
BAPI List config value | String | Define a value to configure the BAPI list that is being returned. Learn more about object types. | |||||||
BAPI* Default Value: N/A | String/Expression/Suggestion | Specify the BAPI on the SAP server to be executed. This is the ABAP name. | |||||||
Start Stateful Call Sequence Default Value: Deselected | Checkbox | Select this checkbox to create a stateful session for calling one (or more) BAPIs. A Session ID is required if you want to create a stateful call sequence. Ensure to select this checkbox for the Snap where you define your first BAPI call in the Pipeline. Do not select the Commit after BAPI execute checkbox for this Snap, to extend the stateful session and call more BAPIs using this Pipeline (downstream to this Snap). 'Sequence' implies that the output from a BAPI call is needed for the next BAPI call to run. | |||||||
Commit after BAPI execute Default Value: Deselected | Checkbox | Select this checkbox to end the stateful session and commit when no exception is raised; otherwise, the BAPI controls the commits. Ensure to select this checkbox for the Snap where you define your last BAPI call in the Pipeline. Do not select the Start Stateful Call Sequence checkbox for this Snap. Do not select both Start Stateful Call Sequence and Commit after BAPI execute checkboxes for all other BAPI calls between the first and last calls in the sequence. For example, the Second BAPI call in a 3-call sequence and the second, Third, and Fourth BAPI calls in a 5-call sequence. | |||||||
Session ID Default Value: N/A | String/Expression | Specify the string to identify a specific session. All Snaps in a specific stateful call sequence must be in the same session ID, and there should be only call sequence running in a session at a time. If you do not provide any session ID, the Snap runs in its own session. | |||||||
Date conversion format Default Value: yyyyMMdd | String/Expression | Specify the format to convert string input values into SAP date/datetime fields in SimpleDateFormat. | |||||||
Output date time as Text Default Value: Deselected | Checkbox | Select to output date and time as a String data type instead of a DateTime object. | |||||||
Error handling | Use this field set to define the error path and values for handling errors. If any error paths and their error values match a corresponding value in the output document, then the document is routed to the error view (if enabled), or the Snap fails (if the error view is disabled). If you do not define the error handling, the Snap will not by default fail or route anything to the error view if the RETURN[*].TYPE value is 'E'. | ||||||||
Error path Default Value: $RETURN[*].TYPE | String/Expression | Specify the error path to which the errors should route. | |||||||
Error value Default Value: E | String/Expression | Specify the value for the error. | |||||||
Max request attempts* Default Value: 3 | Integer | Specify the maximum number of SAP connection attempts to make in case of a failure. When you specify 0, the Snap makes infinite connection attempts. | |||||||
Request retry interval Default value: 5 | Integer | Specify the time in seconds to wait before retrying the request. | |||||||
Route errors Default value: Deselected | Checkbox | Select this checkbox to write configuration errors to the error view. If the error is non-recoverable, the errors (especially connection errors such as exception handling) are routed to the error view with relevant information. | |||||||
Reload Function Metadata Default value: Deselected | Checkbox | Select this checkbox to reload the metadata (latest schema) for the current BAPI function before executing the BAPI function.
| |||||||
Round to SAP decimal*
Default state: Deselected | Checkbox | Select this checkbox to round the decimal value to match the number of decimal places defined in the SAP target field. This prevents a conversion error if the number of decimal places exceeds the value defined in SAP.
Input Value Rounded Value If you deselect this checkbox and the Snap tries to write a decimal value that either exceeds the length or the number of decimal places defined in the SAP packed decimal field, a conversion error is displayed. | |||||||
Snap Execution Default value: Execute only | Dropdown list |
|
Examples
...
The following examples demonstrate how to retrieve data, insert data in SAP using the applicable BAPI, and
...
display an error.
Expand | ||
---|---|---|
| ||
In the first example we will read a list of all sales orders in SAP by Sales Organization and Customer using BAPI_SALESORDER_GETLIST and then split the data by Sales Order # (SD_DOC), format the data to Excel and ultimately write the data to SLDB. We will start with a JSON Generator Snap which provides Customer and Organization ID which is input for the Mapper Snap where we map the relevant details such as CUSTOMER_NUMBER and SALES_ORGANIZATION to prepare as your input data. |
...
The SAP Execute Snap is configured to use BAPI_SALESORDER_GETLIST. I have renamed the Snap "SAP Execute - BAPI" for the purposes of this example. The results are returned from SAP, which match the input criteria (Sales Organization and Customer). |
...
Next, we split the data by Sales Order using a JSON Splitter. The JSON Splitter can use the SALES_ORDERS path to split the incoming document into individual output documents for each sales order and then write the results to an Excel file using Excel Formatter. |
Expand | ||
---|---|---|
| ||
We create an actual sales order in the second example. We use the following JSON as the input to the BAPI_SALESORDER_CREATEFROMDAT2 BAPI.
Then we map the input into the schema for the BAPI_SALESORDER_CREATEFROMDAT2 BAPI . The image below shows the SAP Execute Snap configuration: The execution returns the RETURN attribute (and others) which shows the status. TYPE: 'S' indicates a success and provides additional messages. |
Expand | ||
---|---|---|
| ||
Errors are identified in a BAPI as type "E" in the RETURN message. If the BAPI is not able to process the data provided in the input, the message returned should indicate the corrective action required as in the following example from BAPI_SALESORDER_CHANGE. |
Expand | ||
---|---|---|
| ||
The following Pipeline demonstrates a sequence of 3 BAPI calls on service notifications using an SAP instance. |
...
In this example Pipeline, a Mapper (Feed Notification Data) is used to prepare the sample attributes for the notification. |
...
The output displays the notification attributes. |
...
|
...
...
|
...
|
...
...
|
...
Downloads
Note |
---|
Important Steps to Successfully Reuse Pipelines
|
Attachments | ||||||
---|---|---|---|---|---|---|
|
...
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|