Introduction
When using SAP Integration Suite, there is a confusing topic that often arises during message flow: Header, Property, and Exchange. Although these three concepts appear similar, if not used correctly, they can lead to unexpected errors or data loss in iFlows. In this blog, we will discuss the differences between these concepts, their areas of use, and the most common mistakes.
Understanding the clear distinction between Header, Property, and Exchange is essential for building stable and predictable integrations. Each concept serves a different purpose, and misusing them can result in null values, inconsistent data, and difficult debugging processes. Knowing where and how to store and access data correctly prevents integration errors and ensures reliable iFlow design.
1.What Are Header, Property, and Exchange in SAP Integration Suite?
Header:- Carries the technical metadata of the message.
- It is typically used to transfer data between adapters.
Example: HTTP headers, SOAP headers, etc.
- Travels with the message, meaning it can pass between adapters.
Property:- A data element carried within the Integration Flow.
- Local Property: Only valid within the iFlow or subflow where it is defined.
- Global Property: Can also be carried between subflows and routes.
- Ideal for storing and sharing values throughout the workflow.
Exchange:- A container that holds the entire message and metadata.
- Contains headers and properties.
- All steps in the iFlow send messages via Exchange.
2.Usage Scenarios and Common Mistakes with Header, Property, and Exchange
Scenarios
- Reading and processing a custom header from an adapter within the iFlow.
- Using a property to pass data to a subflow.
- Processing the entire message and metadata in a script step using the Exchange context.
Common Mistakes
- Trying to read a property from the header:
// Incorrect usagedef value = message.getProperty(“HTTP_Header_Name”) // Not a header, but a property
- Using a local property in a subflow:
o A local property is only valid in the scope where it is created. Trying to access it in a subflow returns null.
- Misunderstanding the exchange context:
o The exchange encompasses the message and metadata. Changing only the message may not affect the header or property.
3.Best Practices for Storing and Accessing Values in an iFlow
o Values from the adapter → Headero Calculations or flags within the iFlow → Local Propertyo Data sharing between subflows → Global Property
- Caution in Script or Mapping steps:
Know the difference between
message.getHeaders()and
message.getProperties() .
4.Example: Transferring Data to Subflow with Global Property
// In Parent iFlow
def message = exchange.getMessage()
message.setProperty(“CustomerID”, “12345”, true) // true = global property
exchange.setMessage(message)
// In the Subflow
def subMessage = exchange.getMessage()
def customerId = subMessage.getProperty(“CustomerID”)
println(“Customer ID: ” + customerId) // 12345
This example shows the safest way to pass data to a subflow using a global property.
5.Conclusion
Understanding the differences between Header, Property, and Exchange in SAP Integration Suite prevents data loss in your iFlows and facilitates debugging.In summary:
- Header: Technical data transferred between adapters.
- Property: Storing and sharing values within an iFlow or subflow.
- Exchange: Container encompassing the message and metadata.