SAP S/4HANA Cloud Update

In this article

Overview

You can use this Snap to to update data objects in the SAP S/4HANA Cloud instance.

Snap Type

SAP S/4HANA Cloud Update Snap is a WRITE-type Snap that updates data objects in the SAP S/4HANA Cloud instance

Prerequisites

  • A valid account that supports SAP S/4HANA Cloud instance, with the appropriate access permissions. See SAP S/4HANA Cloud Accounts.

Support for Ultra Pipelines

Works in Ultra Pipelines. 

Limitations

None.

Known Issues

The Snap does not support OData navigation link.

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

  • Max: 1

  • Mapper Snap

  • Copy Snap

  • JSON Parser

Each input document contains data that must be updated and written into the SAP S/4HANA Cloud instance for the selected entity.

Output

Document

  • Min: 0

  • Max: 1

  • Mapper Snap

  • Copy Snap

  • XML Formatter

  • JSON Formatter

Each document contains the response of the update operation.

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 Update
Example: SAP S/4Hana Cloud_Update

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: None
Example: API_BUSINESS_PARTNER_0001 (Remote API for Business Partner)

String/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: None
Example: A_Supplier

String/Suggestion

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

Subentity

Default Value: None
Example: to_SupplierCompany

String/Suggestion

Add a subentity for the entity choosen.

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. 

The Snap provides the CustomizedHeader in the input schema to help you define the customized headers to the UI using the expression function. You can also manually enter the customized header names with values on the UI Customized header fieldset. If you provide only the customized header names or values using schema, but not link to the UI using the expression, the names or values you have entered will not be delivered to the API.

Field Name

Default Value: None
Example: If-Match

String/Expression

Specify the field name of the customized HTTP request header.

Field Value

Default Value: None
Example: '82F636DC08F14D22260CE67E505C231D0D2ACD95'

String/Expression

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/Expression

Specify the reference parameter in this field.

 

Field Value

Default Value: None
Example: TestUser

String/Expression

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.

 

Updating method

Dropdown list

Specify if the Replace or the Merge method should be implemented for updates.

  • By Replace, it is able to replace an entire old record to new.

  • By Merge, it is able to overwrite a new update to old records and merge them together.

Connection Details

Use this field set to specify the connectivity parameters.

Connection Timeout

Default Value: 300
Example: 500

Integer/Expression

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 Retry Interval before attempting to reconnect.

Maximum Retry Attempts

Default Value: 0
Example: 3

Integer/Expression

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

Integer/Expression

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

Dropdown list

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.

Troubleshooting

Error

Reason

Resolution

Error

Reason

Resolution

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.

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

Locate and select the Entity from the dropdown list.

Additional information

The following content provide some helpful information to assist you while using the SAP S/4HANA Update Snap.

The General Behavior of SAP S/4HANA Cloud Update Snap

  • Supports PUT operation to Update data to the SAP S/4HANA Cloud instance.

  • Supports customized HTTP Header. Learn more: Additional Information - Usage of Customized header.

  • Supports the input schema by which it is allowed to display the Update supported input parameter set from the upstream input snap.

  • Supports dynamic metadata loading, by which it is allowed to load the API metadata with a Parent-child dependency structure.
    Select an API object from the API Object field. only this selected API-object related and Update supported (PUT operation supported) entities are displayed. After selecting an entity, only this selected entity related and Update supported (PUT operation supported) parameters are shown in the dropdown field of Key parameter and input schema.

Input Schema

The input schema for SAP S/4HANA Update Snap is divided into two parts, CustomizedHeader, KeyParameter and Payload as shown below.

The CustomizedHeader and KeyParameter schema can help you to define the customized headers and key parameters to the UI using the expression function. You can also manually enter the customized header names with values or select key parameter names from the suggestion dropdown list and select/enter the key parameter values on the UI  Customized header or Key parameters fieldset. If you provide only the customized header or key parameters' names and values using schema, but do not link to the UI using the expression, the names or values you have entered are not be delivered to the API.  

The Payload schema can help you to define the input payload for the API call via Update Snap. It dynamically loads and represents all the parameters that you need for the data object updating. If you have Mapper Snap or a Snap which can display the entire input schema, always use Payload schema to define your input payload. Otherwise, in your input JSON object, always include "Payload" text as a key in the parent of your input. 

Schema Settings 

Parameter Name  

Data Type

Description

Parameter Name  

Data Type

Description

CustomizedHeader

Default Value: N/A
Example: N/A

Array

Add the customized HTTP request header to implement specific HTTP requests. 

name

Default Value: N/A
Example: If-Match

String

Specify the field name of the customized HTTP request header.

value

Default Value: N/A
Example: W/"'82F636DC08F14D22260CE67E505C231D0D2ACD95'"

String

Specify the field value of the customized HTTP request header. 

Payload

Default Value: N/A
Example: N/A

Object

Specify the input data parameters for the selected entities.

Usage of Customized Header

For this Snap Pack, setting customized HTTP headers is allowed. SAP S/4HANA Cloud contains a large number of API objects and entities. It is also possible to create customized API objects and entities in SAP S/4 HANA. For some entities, specific HTTP headers might be required. Example: If-Match and Etag. In the current release, only a few commonly used HTTP headers are predefined in the Snap. You can however add any custom or specific HTTP headers to fulfill your requirement. The following headers are already defined in Snap: Content-type, Cache-Control, Authorization, Accept, X-CSRF-Token, and Cookie.

See the example below for a defined custom header. 

Example

Updating Customer Material from SAP S/4HANA Cloud

The example assumes that you have configured and authorized a valid SAP S/4HANA Cloud Account. The following SAP S/4HANA Cloud Update Snap and pipeline shows how you can update material data for a specific data entry in SAP S/4HANA via the API_CUSTOMER_MATERIAL_SRV_0001 (Remote API for Customer Material) and the entity A_CustomerMaterial.

The configuration of the SAP S/4HANA Cloud Update Snap is shown below.

 

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 shows the configuration of the File Writer.

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