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: 
As members of the Integration team, we frequently encounter requests from both the sender and receiver teams to trace specific messages based on a key value. Currently, searching for these individual messages within a large stack can be quite laborious.

By introducing custom headers, we can simplify this task. These headers would allow us to store key fields associated with each message, which can then be displayed on the monitor page. This way, we can easily search for messages using the values stored in these custom headers, significantly reducing the effort required to locate a particular message from the heap of stacked messages.

To streamline our integration process, I highly propose implementing custom headers as a solution.

To incorporate custom headers effectively, we can employ a brief Groovy script immediately after the component responsible for receiving the input file within the integration flow (iflow).


In the scenario of integrating SuccessFactors with a third-party (Ariba) system, where we receive input in XML format, we can utilize the "person_id_external" field (employee number) as a key identifier. To simplify message tracing for specific employees, we propose assigning this key field to a custom header called EMPID.

By implementing this approach, we can populate the EMPID custom header with the employee number value during the integration process. Subsequently, when there is a need to track a particular employee, we can conveniently leverage the EMPID custom header on the monitoring screen. This enables us to swiftly locate and trace the relevant messages associated with the desired employee, streamlining the overall monitoring and troubleshooting process.


Input : I just used a small piece of input file here

<?xml version='1.0' encoding='UTF-8'?>


Groovy Script :

I have used XmlSlurper to parse the input XML in this script, the script will change based on the input format.

import java.util.HashMap;

import java.lang.*;

import groovy.xml.MarkupBuilder;

def Message processData(Message message)


def messageLog = messageLogFactory.getMessageLog(message);

def body = message.getBody(java.lang.String) as String;

if(messageLog != null)


        def doc = new XmlSlurper().parseText(body);

        String str = "";

        doc.'**'.findAll { == 'person' }.each



            messageLog.addCustomHeaderProperty("EMPID", str);



return message;


Thats all, Now lets see how to search the message in the monitoring screen.

Monitoring Page:

Once you have selected the Artifact name, proceed to click on the "Use more fields" filter. Within this filter, you will find the "Custom Header" option. Here, you can input the Custom header name and its corresponding value, which in this case would be the employee you are searching for.

After entering the Custom header name and value, simply press the enter key. The monitoring screen will then display the message(s) associated with the specified employee, allowing you to easily locate the desired information. You can refer to the image below for a visual representation of this process.


I hope this is helpful, comment if you think we can enhance this script in a better way.



1 Comment
Labels in this area