SAP S/4HANA Read

In this article

Overview

Use this Snap to read and retrieve data objects from the SAP S/4HANA On-Premise instance.

Prerequisites

Support for Ultra Pipelines

See Snap Support for Ultra Pipelines.

Limitations and Known Issues

  • SAP S/4HANA On-Premise instance does not support server-side pagination. As a result, the $skiptoken is not supported.
  • The Snap does not support OData navigation link.

Snap Input and Output

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
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 SAP S/4HANA On-Premise instance

Output

Document

  • Min: 1
  • Max: 1
  • Mapper Snap
  • Copy Snap
  • XML Formatter
  • JSON Formatter

A document containing the entity data retrieved from a SAP S/4HANA On-Premise instance.

Snap Settings

Parameter NameData TypeDescriptionDefault ValueExample 

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 Read

API object

String

Required. Select the API that you want to access in SAP S/4HANA On-Premise instance. 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)

Entity

String

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

N/A

AccountCollection

Customized header

Use this field set to add customized HTTP request headers for implementing specific HTTP requests other than the ones listed in the Using Customized Headers section of this page. Only one customized header can be specified in each row. Click  to add a new row in this table and specify the values accordingly.

This field set comprises the following fields:

  • Field name
  • Field value 

Field name

StringThe field name of the customized HTTP request header.N/AIf-Match

Field value

StringThe field value for the above field in the customized HTTP request header. N/AW/"'82F636DC08F14D22260CE67E505C231D0D2ACD95'"

Key parameter

This field set enables you to specify the key parameters for a specific entity. Providing values for all key parameters in the drop-down list enables 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  to add a new row in this table and define the values accordingly. 

This field set comprises the following fields:

  • Field name
  • Field value

Field name

StringSpecify the reference parameter in this field.N/AaccountID

Field value

StringSpecify the value for the reference parameter in this field.N/ATEST_001

Filter records

This field set enables you to define how the response result be filtered based on the specified parameters (filter criteria).

Only one filter can be specified in each row. Click  to add a new row in this table and define the values accordingly. Multiple filters, if defined in this table, will be applied for generating the final output, in the order they are defined.

This field set comprises the following fields:

  • Field name
  • Operation
  • Field value
  • Condition

Field name

StringSpecify the system parameter—$filter field—to be used for filtering the records in the output.N/AaccountID

Operation

String

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

  • Equals
  • Not Equals
  • Greater than or Equal
  • Greater than
  • Less than or Equal
  • Less than
  • Starts with
  • Ends with
EqualsEquals

Field value

StringSpecify 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.N/ATEST-AC-01

Condition

String

Select a value from this drop-down 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 records that match both the current criterion and the next criterion.
  • None: To specify that the current and the next criteria can be evaluated independent of each other in retrieving the records.
OrNone

Output field selection

This field set enables you to select the fields to be included in the output. 

Only one output field can be specified in each row. Click  to add a new row in this table. 

To return all available fields in the output, do not specify any output field.

Element

String/ExpressionSpecify the fields from the result dataset to be populated in the output.N/AaccountID, name1, name2

Order by

This field set enables you to define the sort order for the records in the output. 

Only one column name can be specified in each row for the sort order. Click  to add a new row in this table and define the sort order criteria accordingly. Multiple Order by criteria will be applied in the same sequence as they are defined.

This field set comprises the following fields:

  • Element
  • Order by type

Element

StringSpecify the field in the expected output by which the records in the output must be ordered.N/Aname1

Order by type

String

Depending on the field selected above, define whether the rows must be sorted in the ascending order or descending order. Available options are:

  • Ascending
  • Descending
DescendingDescending
Output fields advanced options

Use this section of Snap Settings to customize the output set: the number of output entries and the index of the starting entry. Available options are:

  • Output entry limit
  • Output entry offset
  • Is an active entity
  • Count
  • Allow empty result
  • Pass through

Output entry limit

Integer

Specify the maximum number of entries that SAP S/4 HANA On-Premise instance must return in the output.

500

10

Output entry offset

Integer

Specify the record index starting from which SAP S/4 HANA On-Premise instance must return records in the output.

Use this property along with the Output entry limit to retrieve a specific set of entries in the output.

N/A

10

Is an active entity

Dropdown list

Choose the value for this field. Available options are: 

  • true: get all records with field IsActiveEntity = truein the returned response.
  • false: get all records with field IsActiveEntity = false in the returned response.
  • not available: Do not require this field.

There are many SAP S/4HANA entities that require the field IsActiveEntity to be set as true or false and added to the HTTP request. If this field is not added for these entities, an error 'Draft 2.0 object <SERVICE~ENTITY> requires selection condition on IsActiveEntity' will be returned. If ‘true’ is selected, the IsActiveEntity will be set as true, vice versa. In order to refer to the entities which do not need this field, please select 'not available'.

not available

true

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

Allow empty result

Checkbox

Select this checkbox to define whether output views can show empty result. If this check box is not selected, an error will be thrown when the output has no records.

Selected

Deselected

Connection details

Use this field set to specify the connectivity parameters: timeout, retry count, and retry interval.  This field set contains the following fields:

  • TimeOut
  • Maximum request attempts
  • RetryInterval

TimeOut

Integer

Required. Enter, in seconds, the duration for which the Snap must try to establish connection with SAP S/4HANA On-Premise instance. 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.

300

120

Maximum request attempts

Integer

Required. Specify an integer value to set the maximum number of reconnection attempts that the Snap must perform, in case of connection failure or timeout.

3

5

RetryInterval

Integer

Required. Enter, in seconds, the duration for which the Snap must wait between two reconnection attempts, until the number of retries is reached.

1

10

Snap Execution

String

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

Validate & Execute

Execute only

Troubleshooting

ErrorReasonResolution

You have 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.

You have an empty value in the Order by table.

The Order by table has an empty field.

Enter a valid value to define sort order.

You have 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.

You have 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.

There is no data coming back from the API call. Possible reasons:

  • No relevant data available in the API database
  • Filter setting is restrictive
  • URL parameter setting is restrictive

Select the Allow empty result check box.


API object does not exist.

Allowed API object format is <API ID>(Description).

Locate and select an API Object from the drop-down list.

Entity does not exist.

The entered Entity is not found in the server.

Locate and select the Entity from the drop-down list.

Additional Information

Here is some information to assist you while using the SAP S/4HANA Read Snap.

Snap General Behavior

The SAP S/4HANA Read Snap supports the following:

  • GET operation to read data from the SAP S/4HANA server.
  • 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 check box).
  • 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 Using Customized Headers.
  • 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 SettingPagination result
Output entry limit: 100
  • Retrieves the first 100 API response records from the server (if more than 100 records are present in API response).
  • Retrieves all the available API response records from the server (if 100 or less records are present in API response).
Output entry offset: 100
  • Retrieves API response records starting from index 101 from the server (if more than 100 records are present in API response).
  • Returns empty result (if 100 or less records are present in API response).
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.

Using Customized Headers

SAP S/4HANA On-Premise instance 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 Snap Pack supports 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, and
    • 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 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 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 any of the three SAP S/4HANA Read Snaps 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: Accessing related entities

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.

  • If using the SAP S/4HANA Read Custom Query Snap in the downstream, enhance the customized query by adding $expand=Contacts,Addresses to display the contents of these two properties in the API response of the entity AccountCollection.

Examples

Retrieve Customer Material Data from SAP S/4HANA On-Premise instance

This Pipeline example demonstrates using a SAP S/4HANA Read Snap to retrieve customer material data from SAP S/4HANA On-Premise instance and write it into a JSON file.

The example assumes that you have configured and authorized a valid SAP S/4HANA Account (see Configuring SAP S/4HANA Accounts).

Download this Pipeline.


 SAP S/4HANA Read Snap

The following settings are defined for the SAP S/4HANA Read Snap to retrieve customer material data from the SAP S/4HANA On-Premise instance it accesses.

  • API objectZSD_F2499_CUSTOMER_MATERIAL_SRV_0001 (Customer Material) 
  • EntityC_CustomerMaterial_F2499T
  • Filter criterion: For Plant 0001 and no other filters (Plant value equals '0001' and Condition None)

A successful validation or execution of the Snap gives the following output preview.

 JSON Formatter Snap

A JSON Formatter Snap is connected to the SAP S/4HANA Read Snap to read and format its output data into standard JSON format.

 File Writer Snap

A File Writer Snap is connected to the JSON Formatter Snap to save/write the JSON-formatted data into a file.

 Output

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 can be seen below:


Downloads

Important Steps to Successfully Reuse Pipelines

  1. Download and import the Pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide Pipeline parameters as applicable.

  File Modified

File SAP_S4HANA_READ_SNAP_EXAMPLE_01_CUSTOMER_MATERIAL.slp

Aug 04, 2020 by Anand Vedam

Snap Pack History

 Click here to expand...
Release Snap Pack VersionDateType  Updates
February 2024main168 StableUpdated and certified against the current SnapLogic Platform release.
November 2023main155 StableUpdated and certified against the current SnapLogic Platform release.
August 2023main150 Stable

Enhanced the input schema for the SAP S/4HANA Create Snap.

August 2023main140 Latest

Fixed the encoding of special characters in the SAP S/4HANA Update Snap.

August 2023main138 Stable

May 2023

main130 

Stable

Upgraded with the latest SnapLogic Platform release.

February 2023main114 StableUpgraded with the latest SnapLogic Platform release.
November 2022main113 StableUpgraded with the latest SnapLogic Platform release.
August 2022main111 StableUpgraded with the latest SnapLogic Platform release.
4.29main108 StableUpgraded with the latest SnapLogic Platform release.
4.28main100 StableUpgraded with the latest SnapLogic Platform release.
4.27 Patchmain95 Latest
  • Enhanced the SAP S/4 HANA Snaps to support sub-entities and pagination support.

  • Removed unnecessary datatype conversions.

  • Reduced metadata request volume.

  • Fixed issues in concurrency exception and potential Snap crashes.

4.27main93 StableUpgraded with the latest SnapLogic Platform release.
4.26main88 StableUpgraded with the latest SnapLogic Platform release.
4.25main73
 
StableUpgraded with the latest SnapLogic Platform release.
4.24main73
StableUpgraded with the latest SnapLogic Platform release.
4.23main7430
 
Stable

Enhances the Snap Pack to handle batch and custom query operations:

  • Introduces the SAP S/4HANA Batch Read Snap that enables retrieving batches of records from an SAP S/4HANA On-Premise instance.
  • Introduces the SAP S/4HANA Batch Write Snap that enables writing batches of records to an SAP S/4HANA On-Premise instance.
  • Introduces the SAP S/4HANA Read Custom Query Snap that enables retrieving multiple records from an SAP S/4HANA On-Premise instance, based on custom queries.
  • Introduces the SAP S/4HANA SSL Auth Account type to enable SSL-based authentication on an SAP S/4HANA On-Premise instance.
  • Adds the Count field to the SAP S/4HANA Read Snap to allow returning the total number of records retrieved.
4.22 Patch 422patches6973 Latest

Enhances the SAP S/4HANA Snap Pack with the following additions:

4.22main6403
 
StableUpgraded with the latest SnapLogic Platform release.
4.21snapsmrc542

 

StableInitial release.


See Also