If you are working as a Integration support sometimes you got challenge when your user ask you to find a certain document let say for example Purchase Order or Sales Order that created 2 or 3 weeks ago. And your third party inform didn’t receive it. How you prove that the data really send successfully or not with the easy way? Luckily in SAP BTP Integration Suite we can use custom header properties to help us to solve this challenge.
Let’s develop our iFlow.
In this example SAP as a sender will send PO documents using XI adapter to our third party system.
a. Content modifier with label ‘Payload’
In this content modifier we will set our custom header. Let say we have payload just like below:
We will put our custom header in exchange property tab instead of message header. This is to avoid any conflict or issue if your third party service has the same header name with what you defined.
Create 2 property name,
b. Groovy script with label ‘setCustomHeader’
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
def properties = message.getProperties();
for ( property in properties ){
if ( property.getKey().toString().matches( "_(.*)")){
messageLog.addCustomHeaderProperty(property.getKey().toString().substring(1) , property.getValue().toString());
}
}
}
return message;
}
Let’s test send a data from our SAP system. And this is the look in our SAP BTP Integration Suite monitoring Monitor Message Processing.
And this is how we can find the data from monitor message processing in our SAP BTP Integration Suite
Write in Custom Header tab: OrderNumber = 4800101052 then press enter.
Limitation: If the payload has multiple row, SAP BTP Integration Suite will be save single record only (first line). If you want to collect all value for EBELN (our example case above) you can use string-join in Source Value.
#SAP BTP Integration Suite