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

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

 

  • Min: 0

  • Max: 1

  • Mapper Snap

  • Copy Snap

  • JSON Parser

A document with data that indicates the entities to be filtered and retrieved from the SAP S/4HANA Cloud instance. 

Output

Document

 

  • Min: 0

  • Max: 1

  • Mapper Snap

  • Copy Snap

  • JSON Parser

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:

  • 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.

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

Field Name

Type

Description

Label*

Default Value: SAP S/4Hana Cloud Read
ExampleSAP 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 ValueN/A
ExampleAPI_BUSINESS_PARTNER_0001 (Remote API for Business Partner)

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 ValueN/A
ExampleA_Supplier

String/Suggestion

Select a business object (the Entity or Endpoint) for the API Object chosen above.

 

Subentity 

Default ValueN/A
Exampleto_SupplierCompany

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 ValueNone
ExampleIf-Match

String

Specify the field name of the customized HTTP request header.

Field Value

Default Value: None
Example'82F636DC08F14D22260CE67E505C231D0D2ACD95'

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
Example: userId

String

Specify the reference parameter in this field.

 

Field Value

Default Value: None
Example: TestUser

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
Example: userId

String

Specify the system parameter—$filter field—to filter the records in the output.

 

Operation

Default ValueEquals
Example: Equals

String

Specify the comparison operator for the $filter field specified above from this dropdown list. Available options are: 

  • Equals

  • Not Equals

  • Greater than or Equal

  • Greater than

  • Less than or Equal

  • Less than

  • Starts with

  • Ends with

Field Value

Default Value: None
Example: TestUser

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
Example: Or

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: 

  • Or: To retrieve records that match either the current criterion or the next criterion.

  • And: To retrieve only those records that match both the current criterion and the next criterion.

  • None: To specify that the current and the next criteria can be evaluated independently of each other in retrieving the records.

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
Example: name

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
Example: name

String

Specify the field that should be used for sorting by descending or ascending order.

 

Order By Type

Default ValueAscending
Example: Descending

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 Value500
Example: 20

Integer

Specify the maximum number of entries that SAP S/4 HANA Cloud must return in the output.

Output Entry Offset

Default ValueN/A
Example: 20

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 Valuenot available
Example: true

Dropdown list

Select a value from this dropdown list to get the records from active entities or from all entities. Available options are: 

  • true: Select this option to get records only from the active SAP S/4HANA entity.

  • false: Select this option to get records from all entities.

  • not available: Select this option when you need to get the records from those entities where this field is not set.

Count

Default ValueDeselected
Example: Selected

Checkbox

Select this checkbox to return the total number of records retrieved in the API response.

 

Allow empty result

Default ValueSelected
Example: Deselected

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 Value300
Example: 500

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 Value3
Example: 5

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 Value1
Example: 2

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 ValueValidate & Execute
Example: Execute only

Dropdown list

Select an option to specify how the Snap must be executed. Available options are:

  • Validate & Execute: Performs limited execution of the Snap (up to 50 records) during Pipeline validation; performs full execution of the Snap (unlimited records) during Pipeline execution.

  • Execute only: Performs full execution of the Snap during Pipeline execution; does not execute the Snap during Pipeline validation.

  • Disabled: Disables the Snap and, by extension, its downstream Snaps.

Troubleshooting

Error

Reason

Resolution

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:

  • No relevant data available in the API database

  • Filter setting is restrictive

  • URL parameter setting is restrictive

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

Snap Output Setting

Pagination result

Output entry limit: 100

  • Retrieves the first 100 API response records from the server (if more than 100 records are present in the API response).

  • Retrieves all the available API response records from the server (if 100 or fewer records are present in the API response).

Output entry offset: 100

  • Retrieves API response records starting from index 101 from the server.

Output entry offset: 100, and 
Output entry limit: 100

  • Skips the first 100 records and collects the 200 - 300 records in the API response from the server.

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:

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