Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacky_Liu
Product and Topic Expert
Product and Topic Expert

In SAP S/4Hana Cloud, when event for some business object happened like sales order created, some additional logic need to be triggered, for example additional information should be put for this sales order.  We can utilized SAP Event Mesh and SAP Integration Suite to realized such kinds of requirements .

The following is solution example .

SolutionOrderCpi.drawio.png

Prerequisites:

  • SAP S/4Hana Cloud has gone alive or in implementation.
  • Have subscribed SAP Event Mesh in Sap Business Application Platform
    and finished the initial settings. You have the Event Mesh instance Service Key which will be used in step 1 .
    image.png
     
  • Have subscribed SAP Integration Suite in Sap Business Application Platform and finished the initial settings .

    Realizing Steps:

    Step 1:  Create communication user  and create  communication arrangement for scenario SAP_COM_0092 in SAP S/4Hana Cloud .

    image-1.png

    image-2.png

    image-3.png

    image-4.png

    image-5.png

    image-6.png

    Step 2:  Create communication arrangement for sales order in SAP S/4Hana Cloud .

    image-3.png

    image-7.png

    Step 3:  Bind sales order created topic to event channel in SAP S/4Hana Cloud .

    image-8.png

    image-9.png

    image-10.png

    image-11.png

    Step 4:  Create event queue for sales order in SAP Event Mesh Subscription in SAP Business Technology Platform.

    image-12.png

    image-13.png

    image-14.png

    image-15.png

    image-16.png

    Now the event queue can receive events of sales order created from S/4Hana Cloud .

    Step 5:  Create and Deploy Iflow in SAP Integration Suite .

    Create Oauth2 Client Credential base on Event Mesh service key and Basic User account for Sales Order API Inbound user in SAP Integration Suite.
    image-17.png
    image-18.png

    image-19.png

    image-20.png

    image-21.png

    Create and Deploy Iflow.
    image-22.png
    image-23.png
    image-24.png
    image-25.png
    image-26.png

 

 

 

 

 import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import groovy.json.JsonSlurper;
def Message processData(Message message) {
    def body = message.getBody(java.lang.String)
    
    def jsonObject = new JsonSlurper().parseText(body)
    def salesOrder = jsonObject.data.SalesOrder
    message.setHeader('salesOrder', salesOrder)
    
    def messageLog = messageLogFactory.getMessageLog(message)
    if (messageLog != null) {
        messageLog.addAttachmentAsString('event', body, 'application/json')
    }
    return message
}

 

 

 

image-27.png

image-28.png

image-29.png

image-30.png

image-31.png

image-32.png

image-34.png

 

 

 

import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
    def body = message.getBody(java.lang.String)
    def messageLog = messageLogFactory.getMessageLog(message)
    if (messageLog != null) {
        messageLog.addAttachmentAsString('SalesOrder', body, 'application/xml')
    }
    return message
}

 

 

 

image-33.png

Step 6: Test - Create Sales Order in S/4Hana Cloud and Check result in SAP Integration Suite .

image-35.png

image-36.png

image-37.png

image-38.png

The End

Thanks for your time!

Jacky Liu

2 Comments
CH06
Participant
0 Kudos

Hello, this 4 week old Blog by a SAP employee proposes using SAP 'Event Mesh' classic, but it would appear that this Service has been stealthily retired since :

https://discovery-center.cloud.sap/protected/index.html#/serviceCatalog/event-mesh?region=all

Is it possible that SAP has retired 'Event Mesh' classic in the past week or so without even the knowledge of its own employees ?

 

Jacky_Liu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi CH06,

Thanks for reminding! I think in Q2, there are some news for SAP Integration suite but not confirmed yet. I will make some adjustment at the end of Q2.

Best regards!

Jacky Liu