Blog

Header, Property, and Exchange in SAP Integration Suite

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.

1.Basics of the Concepts

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 Errors

Scenarios
  1. Reading and processing a custom header from an adapter within the iFlow.
  2. Using a property to pass data to a subflow.
  3. Processing the entire message and metadata in a script step using the Exchange context.
 Common Mistakes
  1. Trying to read a property from the header:
// Incorrect usagedef value = message.getProperty(“HTTP_Header_Name”) // Not a header, but a property
  1. 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.
  1. Misunderstanding the exchange context:
o    The exchange encompasses the message and metadata. Changing only the message may not affect the header or property. 

3.Practical Recommendations

  • Where to store values?
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 iFlowdef message = exchange.getMessage()message.setProperty(“CustomerID”, “12345”, true) // true = global propertyexchange.setMessage(message) // In the Subflowdef subMessage = exchange.getMessage()def customerId = subMessage.getProperty(“CustomerID”)println(“Customer ID: ” + customerId) // 12345This 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.

Similar
Blog

Your mail has been sent successfully. You will be contacted as soon as possible.

Your message could not be delivered! Please try again later.