In this article
Use this Snap to retrieve multiple data objects in one HTTP request from SAP S/4HANA applications. The Snap returns a multipart binary stream document in its output. Depending on your requirement, it might be necessary to use a Multipart Reader Snap next to this Snap.
A valid account with appropriate access permissions to connect to the SAP S/4HANA On-Premise instance. See SAP S/4HANA Accounts.
See Snap Support for Ultra Pipelines.
Input/Output | Type of View | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| A JSON document containing input data of the batch request and can be used to filter entities that need to be retrieved in SAP S/4HANA Server. |
Output | Binary Document (default) |
|
| A document that contains the data retrieved from an SAP S/4HANA entity. The output document can be a multipart binary stream or a document stream.
|
Parameter Name | Data Type | Description | Default Value | Example | ||
---|---|---|---|---|---|---|
Label | String | Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline. | N/A | SAP S/4HANA Batch Read | ||
API object | String | Required. Select the API that you want to access in SAP S/4HANA On-Premise instance by clicking the button. This drop-down list contains APIs available for the S/4HANA account configured in the Snap, each with a short description. | N/A | ZCRM_BUPA_ODATA_0001 (Odata Services for Business Partner) | ||
Entities | Required. Use this field set to specify the different entities that you want to access.
You must specify each entity in a separate row. Click to add a new row in this table and define the values accordingly. This field set comprises of the following fields:
| |||||
Entity | String | Required. Select a business object (the Entity or Endpoint) for the API object chosen above, by clicking the button. | N/A | AccountCollection | ||
Output entry limit | Integer | The maximum number of entries that you want to retrieve from SAP S/4 HANA On-Premise for the entity.
| N/A | 10 | ||
Output entry offset | Integer | The starting index, that can also be used with an Output entry limit, for the output.
| N/A | 10 | ||
Is an active entity | String | Specify the value for the IsActiveEntity field in the HTTP request. There are many SAP S/4HANA entities that require the field IsActiveEntity to be set to true or false and included in the HTTP request. The Snap displays the 'Draft 2.0 object <SERVICE~ENTITY> requires selection condition on IsActiveEntity', error if this field is not included for those entities. Available options are:
| not available | true | ||
Count | Check box | Select this check box to return only the total number of records retrieved in the API response.
| Not selected | Selected | ||
Connection details | Use this field set to specify the connectivity parameters: timeout, retry count, and retry interval. This field set comprises the following fields:
| |||||
TimeOut | Integer | Required. Specify the connection timeout duration in seconds, in this field. | 300 | 480 | ||
Maximum request attempts | Integer | Required. Specify the maximum number of re-connections in case of connection failure or timeout. | 3 | 5 | ||
RetryInterval | Integer | Required. Specify the time interval in seconds to be maintained between two reconnections. | 1 | 5 | ||
Snap Execution | String | Specifies the execution type:
| Validate & Execute | Execute only |
Error | Reason | Resolution |
---|---|---|
The entered FilterRecords operator is not allowed for the batch input with Batch ID: <EntityName>_<BatchNumber> | The operator selected for FilterRecords is not allowed. | Select an operator field from the list: Equals, Not equals, Less than, Greater than, Less than or equal, Greater than or equal, Starts with, Ends with. |
The entered FilterRecords condition is not allowed for the batch input with Batch ID: <EntityName>_<BatchNumber> | The FilterRecords condition selected is not allowed. | Select one of the following values in the Condition field: And, Or, None. |
The entered OrderBy value is not allowed for the batch input with Batch ID: <EntityName>_<BatchNumber> | The OrderBy value entered is not allowed. | Enter one of the following values in the OrderBy field: Ascending, Descending. |
Entity is not existing. Batch Number: <BatchNumber>. | The entered entity is not found for the selected API object in the server. | Locate and select an appropriate entity from the drop-down list. |
API object is not existing. | Allowed API object format is <API ID>(Description). | Locate and select an appropriate API object from the drop-down list. |
Here is some information to assist you while using the SAP S/4HANA Batch Read Snap.
The SAP S/4HANA Batch Read Snap supports the following:
The SAP S/4HANA supports the OData 2.0 protocol. SAP S/4HANA APIs that support OData 2.0 can send batch requests with specific requirements and for specific operations. See the documentation at OData 2.0 batch request, for more details.
The Input Schema (the Target Schema of the preceding Mapper Snap) enables you to define the input data for the Batch requests. For SAP S/4HANA Batch Read Snap, the $filter (FilterRecords), $select (OutputFieldSelection), $orderby (OrderBy), KeyParameter and CustomizedHeader can be defined using the Input Schema.
Parameter Name | Data Type | Description | |
---|---|---|---|
CustomizedHeader | Use this property schema to add customized HTTP request headers for implementing specific HTTP requests other than the ones listed under Using Customized Headers section. | ||
name | String | The field name of the customized HTTP request header. | |
value | String | The field value for the above field in the customized HTTP request header. | |
FilterRecords | This property schema enables you to define how the response result be filtered based on the specified parameters. | ||
name | String | Specify the name of the system parameter $filter fields to be included in the output. | |
operator | String | Specify the comparison operator for the system parameter $filter. | |
value | Any | The values of specified input $filter fields. The data type of this field depends on what Field name you selected or entered which can be String, Integer, Boolean, etc. | |
condition | String | Specify the logical operator for the system parameter $filter. | |
KeyParameter | This property schema enables you to specify the key parameters for a specific entity. Providing values for all key parameters represented in the schema list enables SAP S/4HANA to identify a unique record.
| ||
OrderBy | With this property schema, it is possible to order the resulting records based on the specified element. The order types to be selected are either ascending or descending. | ||
name | String | Specify the field that will be used for sorting by descending or ascending order. | |
value | String | Specify the Order Type (Ascending or Descending order). | |
OutputFieldSelection | With this property schema, it is possible to select fields to be included in the output. If not selected, all fields of the selected entity will be returned. | ||
name | String | The name of the entered field to be included in the output. |
SAP S/4HANA On-Premise contains a large number of API objects and entities. It also allows you to create and use customized API objects and entities as needed.
The HTTP headers listed above are internally handled by the Snap and need NOT be defined again in CustomizedHeader section. |
Records in SAP S/4HANA Batch Read Snap output may contain navigation properties, typically uri fields, pertaining to some entities related to the entity specified in Snap Settings.
For example, the SAP S/4HANA Batch Read Snap output for the ZCRM_BUPA_ODATA_0001 (Odata Services for Business Partner) API object and the AccountCollection entity contains navigation properties (of entities) like Contacts, Addresses, Logo, Attachments.
You can use one of the following methods to retrieve the details of each related entity returned in the output.
Both of these methods return the properties of the corresponding related entity.
While querying for AccountCollection entity in the API object ZCRM_BUPA_ODATA_0001 (Odata Services for Business Partner), you can navigate to the Contacts property by connecting any one of the three Read Snaps from this Snap Pack in the downstream to call the ContactCollection entity in the API object ZCRM_BUPA_ODATA_0001 (Odata Services for Business Partner) and filter with a specific accountId.
|
This Pipeline example demonstrates using a SAP S/4HANA Batch Read Snap to query and retrieve multiple records from customer material data in SAP S/4HANA On-Premise and write it into a JSON file. The Snap queries the AccountCollection and ContactCollection entities via API object ZCRM_BUPA_ODATA_0001 (Odata Services for Business Partner).
The example assumes that you have configured and authorized a valid SAP S/4HANA Account (see Configuring SAP S/4HANA Accounts). |
The Mapper Snap is configured to map the schema from its input JSON (coming from the upstream JSON Generator Snap) with the schema propagated backward by the SAP S/4HANA Read Batch Snap. It also outputs the Target Schema as the Input Schema for the SAP S/4HANA Batch Read Snap.
The following settings are defined for the SAP S/4HANA Batch Read Snap to retrieve Accounts and Contact data from the SAP S/4HANA On-Premise instance. The Snap is configured to send three HTTP API requests (one on AccountCollection and two on ContactCollection) in a single call to the SAP S/4HANA server.
A successful validation or execution of the Snap gives the following output preview.
The Binary output view:
JSON Document output view:
The File Writer Snap is connected to the SAP S/4HANA Batch Read Snap to save/write the JSON-formatted data into a file.
To view the output JSON file, you must SSH to the target directory and open the newly-created JSON file. The preview of the output JSON file containing the batch response data can be seen below:
|