SAP Integration
SAP CPI Value Mapping and Content Modifier Basics
Learn how to combine value mapping and content modifiers in SAP Cloud Integration to enrich messages, set headers and properties, and troubleshoot common iFlow issues.
What value mapping solves
SAP Cloud Integration value mapping converts one business-system value into another. A typical example is converting an external company code, plant, cost center, or payment term into the value expected by an SAP backend. The mapping keeps this translation separate from the message transformation logic, which makes an iFlow easier to maintain when partner values change.
A value mapping contains a source agency, source identifier, target agency, target identifier, source value, and target value. The agencies and identifiers describe the systems or business contexts that own the values. The source and target values hold the actual conversion pair.
When to use a Content Modifier
A Content Modifier changes the message body, headers, or exchange properties at a defined point in an iFlow. It is useful for setting a constant receiver value, preparing a value for a later step, storing a correlation identifier, or creating a small message body for a controlled test.
Use exchange properties for values that should remain available across later processing steps. Use headers when a value must be visible to an adapter or routing step. Keep values that belong to the business payload in the body or in the message mapping model.
The Content Modifier is especially useful before a lookup or routing step. For example, an iFlow can read a source field, place it in a property, perform a value mapping lookup, and then use the result in a receiver-specific transformation.
A practical iFlow sequence
A maintainable design separates message structure changes from value translation. The following sequence works well for a simple inbound integration:
- Receive the source message through the selected sender adapter.
- Validate the required source field and record a correlation value.
- Use a Content Modifier to set a property or header needed by the next step.
- Apply value mapping when a source business value must become a target-system value.
- Transform the message with Message Mapping, XSLT Mapping, or Groovy where structural changes are required.
- Set receiver-specific headers in a second Content Modifier when the adapter needs them.
- Send the transformed message through the receiver adapter.
- Add exception handling and logging appropriate to the data sensitivity of the interface.
For broader iFlow design guidance, see SAP CPI iFlow basics. For interfaces that use IDocs, see SAP CPI IDoc integration basics.
Configure a value mapping lookup
Create or maintain the value mapping artifact in the integration package, then define the source and target context used by the lookup. Keep the naming convention consistent across related interfaces so that the same business translation can be reused safely.
In the mapping step, select the source field and provide the agency and identifier values required to resolve the target value. Test the lookup with a value that exists and with a value that is intentionally missing. A missing result should follow an explicit error or fallback policy rather than silently producing an empty target field.
A good value mapping table is small, business-focused, and owned by the team responsible for the interface. Keep technical defaults in the iFlow configuration when they are not business translations. This prevents a Content Modifier from becoming an unstructured collection of mapping rules.
Use a Content Modifier safely
Open the Content Modifier step and configure the relevant sections for the body, headers, and exchange properties. Choose the data type that matches the value being assigned, and use expressions only when the value must be read from the current message or from an earlier processing step.
Set a property when the value is an internal processing variable, such as a normalized country code or a lookup result. Set a header when the value controls an adapter or routing decision. Avoid storing credentials or sensitive payload data in logs while testing these values.
When a property is created from an XPath or expression, verify the namespace and the existence of the source node. When a constant is used, document its business purpose in the step description. This makes later changes safer than relying on an unexplained literal.
Troubleshoot lookup and modifier errors
A missing value mapping result usually comes from a mismatch in agency, identifier, source value, or target context. Compare the runtime input with the maintained mapping entry and inspect the message immediately before the lookup. Whitespace, capitalization, leading zeros, and namespace differences can change the lookup key.
If a Content Modifier value is empty, inspect the source path and confirm that the preceding step produced the expected structure. For properties and headers, check the exact name used by downstream steps. A property named CompanyCode is distinct from a property named companyCode.
Use SAP Cloud Integration monitoring to inspect message processing, attachments, headers, and exception details according to your organization’s data-retention policy. The monitoring view should help identify whether the failure occurred before the lookup, during transformation, or at the receiver. For a broader operational workflow, see SAP CPI monitoring and error handling basics.
Test before deployment
Create test cases for a valid source value, a missing mapping entry, an empty source field, an unexpected format, and a receiver value that requires special characters. Confirm both the functional result and the runtime behavior when a lookup cannot be completed.
Test with representative payload sizes and realistic encoding. Verify that headers and properties are available at the step where they are consumed, then remove temporary tracing and test-only values before deploying the artifact.
After deployment, monitor the first successful messages and at least one controlled failure. Record the mapping ownership, expected fallback behavior, and the operational contact responsible for maintaining the table.
Example design checklist
- The mapping artifact has a clear source and target context.
- The Content Modifier uses properties and headers for their intended purposes.
- Missing mappings produce an observable and actionable outcome.
- Receiver-specific values are set close to the receiver step.
- Sensitive values are excluded from message logs.
- Test data covers valid, missing, empty, and malformed values.
Summary
Value mapping handles reusable business-value translation, while the Content Modifier prepares message content and runtime metadata. Combining them in a deliberate sequence keeps an iFlow readable, testable, and easier to operate.