Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
maxLevel2
absoluteUrltrue

Overview

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.

Prerequisites

  • Valid client ID

NoneImage Added

Prerequisites

  • A valid account with appropriate access permissions to connect to the SAP S/4HANA On-Premise instance. See SAP S/4HANA Accounts.

Support for Ultra Pipelines

Capture if Ultra Mode is supported. If the Snap requires certain configurations to support Ultra mention those as well.   

See Snap Support for Ultra Pipelines.

Limitations and Known Issues

  • Supports reading from S3 only...
  • ...
  • SAP S/4HANA On-Premise does not support server-side pagination. As a result, the $skiptoken used for server-side pagination is not supported.

Snap Input and Output 

...

Input/OutputType of ViewNumber of ViewsExamples of Upstream and Downstream SnapsDescription
Input 

Document

Binary

Binary or

Document

  • Min:0
  • Max:1
  • Mapper Snap
  • Copy Snap
  • ..
  • Requires the EDI data and internal ID as a JSON document.Output

    Document

    Binary

    Binary or Document

    • Min:
    • Max:
    • ..
    • ..

    The EDI transaction ID and order confirmation.

    Snap Settings

    ...

    titleDocumenting Fields Based On Data Type/UI Element

    **Delete Before Publishing**

    Choose from the following sentences to document specific field types.

    ...

    • XML Parser
    • Binary to 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)

    • Min:1
    • Max:1
    • Multipart Reader
    • File Writer
    • JSON Formatter
    • JSON Splitter

    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.

    • The binary stream contains the header and the original API batch-request response.
    • The document stream contains the JSON structured API batch-request response split from the original API batch-request response. 

    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 Batch Read

    API object

    String

    RequiredSelect the API that you want to access in SAP S/4HANA On-Premise instance by clicking the Image Added 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. 

    Info

    Client-side pagination is supported through the use of the $top (Output entry limit), and $skip (Output entry offset)
    Odata operations. 
    $skiptoken is not supported for this release.

    You must specify each entity in a separate row.  Click Image Added to add a new row in this table and define the values accordingly. 

    This field set comprises of the following fields:

    • Entity
    • Output entry limit
    • Output entry offset
    • Is an active entity
    • Count

    Entity

    String

    Required. Select a business object (the Entity or Endpoint) for the API object chosen above, by clicking the Image Added 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.

    Info
    titleExample

    When Output entry limit is 100, the Snap:

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


    N/A10

    Output entry    offset

    Integer

    The starting index, that can also be used with an Output entry limit, for the output.

    Info
    titleExample 1

    When Output entry offset is 50, the Snap:

    • Retrieves API response records starting from index 51 from the server (if more than 50 records are present in API response).
    • Retrieves all available records starting from index 51 (up to the last index/record).
    • Returns empty result (if 50 or less records are present in API response).


    Info
    titleExample 2

    When Output entry offset is 100, and Output entry limit is 100, the Snap skips the first 100 records and collects the 200 - 300 records in the API response from the server.


    N/A10

    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: if the entity does not need IsActiveEntity field specified in the HTTP request.
    • true: to set this field in the HTTP request to true and get all records with field IsActiveEntity = true in the returned response.
    • false: to set this field in the HTTP request to false and get all records with field IsActiveEntity = false in the returned response.
    not availabletrue
    CountCheck box

    Select this check box to return only the total number of records retrieved in the API response.

    Note
    titleNo records retrieved

    For all entities specified with this check box selected, the Snap returns ONLY the count of records matching the the respective entity criteria and DOES NOT return any records from the SAP S/4HANA instance (for those entities). If this check box is not selected for one or more entities, records matching each entity's criteria are returned.


    Not selectedSelected

    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
    • Maximum request attempts
    • RetryInterval

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

    ...

    Check boxes:

    • If selected, <Snap behavior>.
      If selected, an empty file is written when the incoming document has no data.
    • If selected, <behavior>. If not selected/Otherwise, <behavior>
      Use "If not selected" if the first sentence is long.
      If selected, the Snap uses the file path value as is. Otherwise, the Snap uses the file path value in the URL.
      If selected, an empty file is written when the incoming document has empty data. If there is no incoming document at the input view of the Snap, no file is written regardless of the value of the property.
    • Select to <action>
      Use this if the behavior is binary. Either this or that, where the converse behavior is apparent/obvious.
      Select to execute the Pipeline during validation.

    Text Fields

    • Describe what the field represents/contains. Additional details, as applicable, in a separate sentence. Include caveats such as the field being conditionally mandatory, limitations, etc.
      The name of the account.
      The account ID that you want to use to log in to the endpoint.
      Required if IAM Role is selected.
      Do not use this field if you are using batch processing.

    Numeric Text Fields

    • Describe what the field represents/contains. Additional details, as applicable, in a separate sentence. Include caveats such as the field being conditionally mandatory, limitations, etc. Include special values that impact the field's behavior as a bullet list.
      The number of records in a batch.
      The number of seconds for which you want the Snap to wait between retries.
      The number of seconds for which the Snap waits between retries.
      Use the following special values:
      * 0: Disables batching.
      * 1: Includes all documents in a single request.

    ...

    Field Sets

    Specify advanced parameters that you want to include in the request.

    This fieldset consists of the following fields:

    • Field 1
    • Field 2
    • Field 3

    Troubleshooting

    ...

    Batch execution failed

    ...

    The Pipeline ended before the batch could complete execution due to a connection error.

    Verify that the Batch size field is configured to handle the inputs properly. If you are not sure when the input data is available, configure this field as zero to keep the connection always open.

    Examples

    Excluding Fields from the Input Data Stream

    You can exclude the fields that you do not require from the input data stream by omitting them in the Input schema field set.

    <screenshot of Pipeline/Snap>

    ...

    Validate & Execute

    Execute only

    Troubleshooting

    ErrorReasonResolution

    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.

    Additional Information

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

    Snap General Behavior

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

    • GET operation to read multiple data objects from the SAP S/4HANA server.
    • OData querying operations: $filter (FilterRecords), $select (OutputFieldSelection), $orderby (OrderBy), $top (Output entry limit), and $skip (Output entry offset). FilterRecords, OutputFieldSelection, and OrderBy will be shown in the input schema for this Snap.
    • OData operation $count (Count check box).
    • Connection-failed-retry mechanism.
    • Client-side pagination through $top (Output entry limit) and $skip (Output entry offset) mechanisms.
    • 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).

    Sending Batch Request

    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.

    Batch Input Schema

    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. 

    Image Added

    Schema settings 

    Parameter Name Data TypeDescription

    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

    StringThe 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

    StringSpecify the name of the system parameter $filter fields to be included in the output.

    operator

    StringSpecify the comparison operator for the system parameter $filter.

    value

    AnyThe 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

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

    Info

    Key parameters are NOT the same as filters which can return multiple records. Use key parameters only to retrieve specific records. To use a filter like normal select, use the parameters at the Filter records section instead.


    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

    StringSpecify the field that will be used for sorting by descending or ascending order.

    value

    StringSpecify the Order Type (Ascending or Descending order).
    OutputFieldSelectionWith 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.
    nameStringThe name of the entered field to be included in the output.

    Using Customized Headers

    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.

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

    The HTTP headers listed above are internally handled by the Snap and need NOT be defined again in CustomizedHeader section.

    Accessing Related Entities from Snap Outputs for an Entity

    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.

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

    Info
    titleExample: 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 multiple Account and Contact records from SAP S/4HANA server

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

    Note

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

    Image Added

    Mapper Snap

    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.

    Image Added

    SAP S/4HANA Read Batch 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.

    • API objectZCRM_BUPA_ODATA_0001 (Odata Services for Business Partner) 
    • EntitiesAccountCollection and ContactCollection

    Image Added

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

    The Binary output view: 

    Image Added

    JSON Document output view:

    Image Added

    File Writer

    The File Writer Snap is connected to the SAP S/4HANA Batch Read Snap to save/write the JSON-formatted data into a file.
    Image Added

    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 containing the batch response data can be seen below:
    Image Added

    Download this Pipeline.

    Downloads

    Note
    titleImportant 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.

    Attachments
    patterns.*.slp, .*.zip

    Insert excerpt
    XYZ SAP S/4HANA Snap PackXYZ
    SAP S/4HANA Snap Pack
    nopaneltrue

    ...

    See Also