User Defined Message Search in SAP CPI

user defined message search in SAP CPI
SAP

User Defined Message Search in SAP CPI

INTRODUCTION

User-Defined Message Search allows one to search a message based on the content in the incoming payload. This feature is not available in SAP CPI as a standard configuration. However, it can be achieved by using the two header parameters mentioned below. 

  1. SAP_ApplicationID : This header parameter is assigned a Key value from  incoming message using Xpath condition/expression. 
  2. SAP_MessageType : This header parameter is used to give a description about SAP_ApplicationID or to specify from which element the value is being taken. This usually is a constant.

HYPOTHETICAL SCENARIO

The source is triggering ‘n’ messages where each message is differentiated by Order Number field in the payload as below 

Message 1 : 

<Order_MT> 
         <orderNumber>1</orderNumber> 
         <supplierName>Walt1</supplierName> 
         <productName>Timber1</productName> 
</Order_MT>

Message 2:  

<Order_MT> 
         <orderNumber>2</orderNumber> 
         <supplierName>Walt2</supplierName> 
         <productName>Timber2</productName> 
</Order_MT>

And so on… 

Say you want to Find a message with Order Number = 5 in monitoring out of processed thousands of messages, 

In this case, 

  1. SAP_ApplicationID : //orderNumber 
  2. SAP_MessageType : Order Number 

Sample Integration Flow would look as below: 

Integration Flow

EXECUTION STEPS

Step 1: Create an Integration Flow with HTTPS connection. 

HTTPS

Step 2: Use a Content Modifier to add SAP headers as stated above. 

User Defined Message Search

Step 3: In In Message Body, use ${in.body} to add an incoming message. 

User DMS

Step 4: Save and Deploy the flow. 

Step 5:  Copy the endpoint from Overview Window once the Deployed flow is started. 

EndPoint

Step 6 : Trigger some 10 messages from POSTMAN by changing the <orderNumber> value. 

Postman

Step 7: Check that all your messages are successful in Overview Window. 

 monitoring

Step 8:  Now, In order to search a message with Order Number =5, you just have to type 5 in the ID search bar and hit enter as shown below. All the messages with Order Number = 5 in the incoming payload will be Displayed. 

User Defined Message Search

This simple Custom step makes searching a message a lot easier. 

A practical Example could include searching a message using Document Number in IDOC to any scenario.

FINAL VERDICT :

In conclusion, I hope you enjoyed reading this article on “User Defined Message Search in SAP CPI”, If yes, then don’t forget to spread the word about it. Do send the feedback and to know more about it. Signing off Sudarshan@recodehive.com

Tagged , , , ,
Back To Top