SAP CPI Hands On – Exercise 4

4 hours ago 3

SAP CPI Exercise 4

Overview

In SAP Cloud Integration (CPI), there are situations where we need to determine whether data received from an external system has changed since the last execution. Instead of comparing the entire payload manually, the Message Digest step provides a simple and efficient way to identify changes by generating a unique hash value based on the message content.
In this hands-on exercise, you will build an integration flow that retrieves customer review data from an external WebShop OData service, calculates a message digest, and stores the digest value in a Data Store. By using the digest as the Data Store Entry ID, any change in the source data automatically results in a new digest value and a new Data Store entry. This enables quick and reliable change detection without analyzing the complete payload.

Message Digest

Imagine you are integrating with an external WebShop system. Your integration flow fetches product review data from the WebShop. You do not want to manually compare the full payload every time to check whether the WebShop data has changed.

Instead, you want SAP Cloud Integration to calculate a unique fingerprint of the payload. This fingerprint is called a message digest.

When the payload remains the same, the digest value remains the same.

When the payload changes, even slightly, the digest value changes.

This makes Message Digest useful for:

  • Detecting changes in external system responses.
  • Avoiding unnecessary payload comparison.
  • Creating lightweight change-detection logic.
  • Storing unique versions of a message in the Data Store.
  • Supporting audit, tracking, and integration validation scenarios.

You can use the Message Digest step to simply check if a message has been changed without checking the payload.
After the first message processing run, you can add an own review to the WebShop and run the integration flow again. As the response from the WebShop is now different than during the first message processing run, another digest is calculated which results in a new data store entry. This scenario shows a simple way to quickly check if a message (in this case, the response from the WebShop) has been changed without the need to check the payload itself.

Prerequisites

Before starting the hands-on activity, make sure you have:

  1. Access to SAP Integration Suite / SAP Cloud Integration.
  2. Authorization to create and deploy integration flows.
  3. Postman or another REST client.
  4. Access to the ESPM WebShop service used in the assignment.
  5. Basic understanding of iFlow steps such as HTTPS Adapter, Request Reply, OData Adapter, and Data Store.

The OData endpoint used in the guide is:

https://refapp-espm-ui-cf.cfapps.eu10.hana.ondemand.com/espm-cloud-web/espm.svc/

Step-1:

HTTPS Adapter:

Before we proceed with our tutorial, we would like to give you an opportunity to join our ZAPYard’s learning community where we have more than 35 groups and more than 1850 real SAP Consultants interacting with each other daily. Only SAP topics and not BS. Else, they will be banned from the community without warning. 👇👇👇👇

If you want to be part of ZAPYard’s Discussion Community, please feel free to check the below Link. We Ask, Answer, Help and Learn Together. There are more than 35 groups from different topics like Generative AI, SAP Joule, CAPM, BTP, RAP, BPT, Fiori, iRPA, CAI, CPI, PI/PO, ABAP on HANA, SAPUI5, SAP Build, SAP Adobe Forms, ChatBots, SAC etc. Join any group of your interest and interact with our Community.

Join ZAPYard’s WhatsApp Community – Ask, Answer, Propose & Defend SAP Topics

Step-2:

Connect Request Reply with OData Adapter

Address: https://refapp-espm-ui-cf.cfapps.eu10.hana.ondemand.com/espm-cloud-web/espm.svc/

Step-3:

Message Digest

Add header{SAPMessageDigest} to store digest of payload fetched from external data source

Step-4:

Add datastore to write the payload

Entry ID: ${header.SAPMessageDigest}

(if payload changes, then SAPMessageDigest header will change and Entry ID will get changed to write other data in Datastore confirming there is change in payload)

Deploy the IFLOW and test from POSTMAN

Your payload will be written to datastore

Now add the review in ESPM web shop

Again, GET request from POSTMAN, your Message digest value will change as new review has been added up

Check in data store new data is added with new entry id

The Message Digest step in SAP Cloud Integration provides a simple and efficient way to detect changes in message content without comparing the entire payload. In this exercise, we used a digest value generated from WebShop data and stored it as a Data Store Entry ID. As the source data changed, a new digest value was created, resulting in a new Data Store entry. This approach helps integration developers quickly identify data changes, improve monitoring, and build lightweight change-detection solutions in SAP CPI.

If you found this article helpful, we’d love to hear from you! Share your thoughts, questions, or experiences in the comments below—your feedback is always welcome and helps us craft even more valuable content for your. Stay tuned for the next part in the series, where we’ll continue exploring essential tools and techniques to level up your SAP development skills.

Please follow our LinkedIn PageLinkedIn Group , Facebook PageFacebook GroupTwitter & Instagram.

Do not forget to SUBSCRIBE to our YouTube Channel for Free Courses and Unconventional Interesting Videos.

Do join ZAPYard’s Learning Community.

Read Entire Article