SAP S/4HANA Cloud Read
In this article
Overview
You can use this Snap to read and retrieve data objects from the SAP S/4HANA Cloud instance.
Snap Type
SAP S/4HANA Cloud Read Snap is a READ Snap that reads and fetches data objects from the SAP S/4HANA Cloud instance.
Prerequisites
A valid account that supports SAP S/4HANA Cloud instance, with the appropriate access permissions. Learn more: SAP S/4HANA Cloud Accounts.
Support for Ultra Pipelines
Works in Ultra Pipelines.Â
Limitations and Known Issues
None.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document  |
|
| A document with data that indicates the entities to be filtered and retrieved from the SAP S/4HANA Cloud instance. |
Output | Document  |
|
| A document containing the entity data retrieved from an SAP S/4HANA Cloud instance. |
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. The available options are:
Learn more about Error handling in Pipelines. |
Snap Settings
Asterisk (*) - indicates a mandatory field.
Suggestion icon () - indicates a list that is dynamically populated based on the configuration.
Expression icon ()- indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon ( ) - indicates that you can add fields in the field set.
Remove icon () - indicates that you can remove fields from the field set.
Field Name | Type | Description | |
---|---|---|---|
Label* Default Value: SAP S/4Hana Cloud Read | String | Specify 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. | |
API Object* Default Value: N/A | String/Expression/Suggestion | Select the API that you want to access in SAP S/4HANA Cloud instance. This dropdown list contains APIs available for the S/4HANA account configured in the Snap, each with a short description.  | |
Entity* Default Value:Â N/A | String/Suggestion | Select a business object (the Entity or Endpoint) for the API Object chosen above. Â | |
Subentity Default Value: N/A | String | Add a subentity for the entity chosen.  | |
Customized Header | Use this field set to add customized HTTP request headers for implementing specific HTTP requests other than the ones listed in the Additional Information - Usage of Customized header section of this page. | ||
Field Name Default Value:Â None | String | Specify the field name of the customized HTTP request header. | |
Field Value Default Value: None | String | Specify the field value for the above field of the customized HTTP request header.  | |
Key Parameter | Use this field set to specify the key parameters for a specific entity. Providing values for all key parameters in the dropdown list allows SAP S/4HANA to identify a unique record. Key parameters are not the same as filters which can return multiple records. To use a filter like normal select, use the parameters at the Filter records section instead. Only one key parameter can be specified in each row. Click plus to add a new row in this table and define the values accordingly. | ||
Field Name Default Value:Â None | String | Specify the reference parameter in this field. Â | |
Field Value Default Value: None | String | Specify the value for the reference parameter in this field. The data type—String, Integer, Boolean, or any other—depends on the Field name you specified for the parameter.  | |
Filter Records | Use this field set to define how the response result should be filtered based on the specified parameters. | ||
Field Name Default Value: None | String | Specify the system parameter—$filter field—to filter the records in the output.  | |
Operation Default Value:Â Equals | String | Specify the comparison operator for the $filter field specified above from this dropdown list. Available options are:Â
| |
Field Value Default Value: None | String | Specify the value with which the above $filter field must be compared. The data type—String, Integer, Boolean, or any other—depends on the $filter field you specified for the filter criterion. | |
Condition Default Value: None | String | Select a value from this dropdown list to set the correlation between this filter criterion (row) and the next one (row), if being defined at all, to apply the filters for generating the final output. Available options are:Â
| |
Output Field Selection | Use this field set to select the fields to be included in the output. Only one output field can be specified in each row. To return all available fields in the output, do not specify any output field. | ||
Element Default Value:Â None | String | Specify the fields from the result dataset to be populated in the output. Â | |
Order by | Use this field set to order the resulting records based on the specified element. The order types to be selected are either ascending or descending. Click plus to add a new row in this table and define the sort order criteria accordingly. | ||
Element Default Value:Â None | String | Specify the field that should be used for sorting by descending or ascending order. Â | |
Order By Type Default Value:Â Ascending | String | Specify the Order Type (Ascending or Descending order). Â | |
Output Fields Advanced Options | Use this field set to customize the output set:Â the number of output entries and the index of the starting entry. | ||
Output Entry Limit Default Value:Â 500 | Integer | Specify the maximum number of entries that SAP S/4 HANA Cloud must return in the output. | |
Output Entry Offset Default Value: N/A | Integer | Specify the record index starting from which SAP S/4 HANA Cloud must return records in the output. Use this field along with the Output entry limit to retrieve a specific set of entries in the output.  | |
Is an Active Entity Default Value: not available | Dropdown list | Select a value from this dropdown list to get the records from active entities or from all entities. Available options are:Â
| |
Count Default Value: Deselected | Checkbox | Select this checkbox to return the total number of records retrieved in the API response.  | |
Allow empty result Default Value: Selected | Checkbox | Select this checkbox to define whether output views can show empty results. If this checkbox is not selected, the Snap displays an error when the output has no records.  | |
Connection Details | Use this field set to specify the connectivity parameters. | ||
Connection Timeout Default Value: 300 | Integer | Specify the duration in seconds for which the Snap must try to establish a connection with SAP S/4HANA Cloud. If the connection cannot be established within this duration, the Snap times out writes the event to the log and waits until the specified RetryInterval before attempting to reconnect.  | |
Maximum Retry Attempts Default Value: 3 | Integer | Specify the maximum number of attempts the Snap should make to perform the selected operation in case of connection failure or timeout.  | |
Retry Interval Default Value:Â 1 | Integer | Specify the time interval in seconds between the two successive retry requests. A retry happens only when the previous attempt resulted in an exception. Â | |
Snap Execution Default Value:Â Validate & Execute | Dropdown list | Select an option to specify how the Snap must be executed. Available options are:
|
Troubleshooting
Error | Reason | Resolution |
---|---|---|
There is an empty value in the Output field selection table. | The Output field selection table has an empty field. | Provide a valid entry for the selected output field. |
There is an empty value in the Order by table. | The Order by table has an empty field. | Enter a valid value to define sort order. |
There is an empty value in the Field name field for the Key parameter. | The Field name field must not be empty for the Key parameter. | Enter a valid Field name for the Key parameter. |
There is an empty field in the Field name/value field for the Customized header. | The Field name/value field must not be empty for the Customized header. | Enter a valid Field name/value for the Customized header. |
Empty result found. | API call does not return any data. Possible reasons:
| Select the Allow empty result checkbox |
API object does not exist. | Allowed API object format is <API ID>(Description). | Locate and select an API Object from the dropdown list. |
Entity does not exist. | The entered Entity is not found in the server. | Locate and select the Entity from the dropdown |
Additional Information
Here is some information to assist you while using the SAP S/4HANA Cloud Read Snap.
Snap General Behavior
The SAP S/4HANA Cloud Read Snap supports the following:
GET operation to read data from the SAP S/4HANA Cloud instance.
OData querying operations:Â $filter (Filter records), $select (Output field selection), $orderby (Order by), $top (Output entry limit), and $skip (Output entry offset).
OData operation $count (Count checkbox).
Connection-failed-retry mechanism.
Client-side pagination through $top (Output entry limit) and $skip (Output entry offset) mechanisms. For more information, see Pagination.
Customized HTTP Headers. For more information, see SAP S/4HANA Cloud Read | Usage-of-Customized-Header .
Dynamic loading of API metadata with a Parent-child dependency structure. This means that you can:Â
Select an API object from the API Object field to view only entities that are related to the API object and support GET queries (read operations).
And then, select an entity to view and specify values for only read-compatible parameters related to this entity in Key parameter, Filter records, Output field selection, and Order by fields.
Pagination
Client-side pagination is supported through the use of the $top (Output entry limit), and $skip (Output entry offset) Odata operations.
Examples
Snap Output Setting | Pagination result |
---|---|
Output entry limit: 100 |
|
Output entry offset: 100 |
|
Output entry offset: 100, and |
|
Usage of Customized Header
SAP S/4HANA Cloud contains a large number of API objects and entities. It also allows you to create and use customized API objects and entities as needed.
Some entities may require specific/customized HTTP headers like, If-Match, Etag.
SAP S/4HANA Cloud Snap Pack supports the definition and usage of such customized HTTP headers.
This Snap Pack currently contains the following common HTTP headers pre-defined and ready to use. You can however add any custom or specific HTTP headers to fulfill your requirement.
Content-type
Cache-Control
Authorization
Accept
X-CSRF-Token,
Cookie
The HTTP headers listed above are internally handled by the Snap and need NOT be defined again in Customized header section. Below is an example of a custom HTTP header defined:
Accessing Related Entities from Snap Outputs for an Entity
Records in SAP S/4HANA Cloud Read Snap output may contain navigation properties, typically URI fields, belonging to some entities related to the entity specified in Snap Settings.
For example, the SAP S/4HANA Cloud 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.
The navigation properties can be used to access specific details of these related entities.
In the API response, the navigation property values are displayed as URLs.
You can use one of the following methods to retrieve the details of each related entity returned in the output.
Pass the value (URL) from the Snap output as input to another SAP S/4HANA Cloud Read Snap to navigate to or access details of these related entities. OR
Parse the value (URL) from the Snap output and use it as input to Service URL field of a REST Get Snap.
Both of these methods return the properties of the corresponding related entity.
Example
Retrieving customer material data from SAP S/4HANA Cloud
The example assumes that you have configured & authorized a valid SAP S/4HANA Cloud Account (see SAP S/4HANA Cloud Accounts). The following SAP S/4HANA Cloud Read Snap and Pipeline shows how you can query and retrieve records from SAP S/4HANA Cloud. In this example, the Read Snap queries the customer material data using the API object "API_CUSTOMER_MATERIAL_SRV_0001 (Remote API for Customer Material)"Â and the Entity "A_CustomerMaterial".
The configuration of the SAP S/4HANA Cloud Read Snap is shown below. The Snap specifies that the query results were filtered by the DistributionChannel value equal to '10'.  | A successful validation of the Snap gives the following output preview, showing the query results. |
Finally, a JSON Formatter Snap and a File Writer Snap are used to format and save data in a new file. The image below shows the configuration of the File Writer Snap. | To view the newly created file, you must SSH to the target directory and open the newly-created file. The following image shows the preview of the result output JSON file. |
Download this Pipeline
Downloads
Snap Pack History
Â
Related Links
Â
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.