SAP CPI Content Modifier: A Quick Guide


In SAP Cloud Platform Integration (CPI), the Content Modifier is a very commonly used step in an integration flow (iFlow). It allows you to set or modify various parts of the message, such as:

Main Uses of Content Modifier

It can modify these parts of the message:

  1. Message Body

    • You can set a custom body (e.g., fixed XML/JSON, plain text, etc.)

    • You can use expressions like ${property.<propertyName>} to dynamically set content.

  2. Message Headers

    • Add or modify message headers.

    • Useful for routing, target system requirements, etc.

  3. Message Properties

    • These are local variables used during message processing.

    • Useful for temporary storage or decision-making in the iFlow.

  4. Exchange Properties (optional in advanced usage)

    • These are technical, camel-level properties (less commonly modified here).


Structure of Content Modifier

When you open the Content Modifier in CPI, you'll see four tabs:

  • Message Header – Add/modify headers.

  • Message Body – Replace or modify the body.

  • Message Exchange Property – Not commonly used unless you're interacting with adapter-level parameters.

  • Message Property – Add or modify custom properties for use in mapping, routing, etc.


Example Use Case

Scenario: Add a custom header and set a JSON body.

  • Message Header:

    Name             Type    Value
    Content-Type             String                     application/json

  • Message Property:

    Name                        Type               Value
    orderId                      String              123456

Tips

  • You can use expressions like ${header.<headerName>}, ${property.<propertyName>}, ${in.body}, etc.

  • Properties are local to the iFlow. They are not sent to target systems.

  • Headers are usually included in HTTP calls.


Happy Integration!


Post a Comment

0 Comments