Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 
This blog post is intended to inform readers about a recent objective task I encountered while working on a project that involved two SAP systems. The purchase order number validation in both systems in the SAP CPI environment had to be done. If the two PO numbers were the same and confirmed, then inbound scenario has to be triggered.

System 1 : SAP S4 Hana (Note we will be using HTTPS considering it as SAP System) 

System 2 : SAP ByD 


Below is the list of Contents :


  1. Pre-requisites

  2. Process Flow

  3. iflow Development

  4. Exception Handling




1. Pre-requisites 


  • In order to create this scenario work you will need access to SAP BTP (Integration Suite) with necessary roles and capabilities assigned. Or else you can refer this blog to Set Up Integration Suite  


  • Have knowledge about creating Integration flows (iflow) using SAP CPI.


  • Knowledge of Adapters and other CPI Pallet options.


  • OData API, Mail Credentials (for Exception).


  • Proxy, RFC, IDoc (As we are involving two system SAP & ByD therefore for posting data from SAP to CPI we can do it using the three given options)  *Here we are using HTTPS considering it as a SAP System. 


2. Process Flow


Process Flow


3. iFlow Development


Create a Package and iflow

Fill up Package Name of your choice, Technical Name and Description about the scenario.



Now Create new iflow and fill up details such as name, id and description.

After Clicking on "Ok"


As per our Flow Diagram first step is to Fetch SAP Data into CPI (Content Modifier) 



Postman As SAP System (System A)

Now we will use "Content Enricher" (To know functioning of )



In the 2nd Step we will connect another system (ByD) using OData to "Content Enricher" to merge the payloads from both systems.


OData Configuration :


In the Processing Tab select the fields you want in your payload structure.



Now till this step the message payload could look somewhat like this :

<?xml version='1.0' encoding='UTF-8'?>
<multimap:Messages xmlns:multimap="">
<multimap:Message1> //Message from System A (Which is SAP in our Case)
<PurchaseOrderNumber>12345</PurchaseOrderNumber> //This is the Purchase order number from SAP System
<multimap:Message2> //Message from System B (Which is ByD in our Case)
<rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<PONum>12345</PONum> //This is the Purchase order number from ByD System


<multimap:Message1>   Payload from System A is captured in  </multimap:Message1>   

<multimap:Message2> Payload from System B is captured in </multimap:Message2>

Now in the next step we will use XPATH in content modifier.

Source Value is captured from the XML Payload

Eg. <Parent>

If we want to pick only price then the source value would be.


In the same way select source values of both PO Numbers according to the combined payload.

Now we will use XSLT Mapping Option from Pallets.

and write the below code to compare two nodes together. (Our Logic)

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="" version="1.0">
<xsl:output method="xml" omit-xml-declaration="no" encoding="UTF-8" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="/">

<xsl:apply-templates select="/ParentNode/Child/PONum = /ParentNode_ByD/Child/ID"/>

<xsl:template match="@*|node()">
<xsl:select-templates select="@*|node()"/>


You can notice in the <Output> </Output> Node i have compared the Xpaths which we have stored in Content Modifier in the previous step.

It will ultimately compare both nodes dynamically and give output in the form of Boolean (True or False)

Till this step our development is able to understand whether the XML Nodes are matching or not.


Now we will be using "Router" to bifurcate the flow.



  • Router will have two branches (Matching & Not Matching)


If both the nodes are same the iflow must return a message displaying that both ID's are same and proceed to next scenario.


And in last we will be using Process Direct Adapter to trigger next scenario.


* If Nodes are not equal then user should get a mail that the iflow has failed.

To make this happen.

This step is same as in the Success Node.

Now to get a detailed error description we will use groovy script.

import java.util.HashMap;
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
messageLog.setStringProperty("Logging#1", "Printing Payload As Attachment")
messageLog.addAttachmentAsString("ResponsePayload:", body, "text/plain");
return message;


And to Connect the End with Receiver using Mail How to Configure Mail Adapter



Save & Deploy the Scenario and test it with Postman. 



1 Comment
Labels in this area