Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
57 views3 pages

Node Functions of MM

The document provides an overview of Node Functions in SAP Cloud Integration's Message Mapping tool, which are used to transform data structures visually. It outlines the purpose and example use cases for frequently used Node Functions such as exists(), ifWithoutElse(), and removeContexts(). Best practices for using these functions effectively in mapping scenarios are also highlighted.

Uploaded by

j barath kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views3 pages

Node Functions of MM

The document provides an overview of Node Functions in SAP Cloud Integration's Message Mapping tool, which are used to transform data structures visually. It outlines the purpose and example use cases for frequently used Node Functions such as exists(), ifWithoutElse(), and removeContexts(). Best practices for using these functions effectively in mapping scenarios are also highlighted.

Uploaded by

j barath kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

In SAP Cloud Integration (CPI), Message Mapping allows you to visually transform data from

one structure to another (typically XML-to-XML). Within the Message Mapping tool, Node
Functions are some of the most frequently used functions, especially when working with
repeating structures, conditional mappings, and hierarchy changes.

Here’s a detailed overview of the frequently used Node Functions in SAP CPI Message
Mapping:

What Are Node Functions?

Node Functions operate on node-level structures — such as repeating elements or groups


— in the source and target messages. They help:

• Control occurrence mapping (1:n, n:1, or 1:1)

• Implement conditional mapping logic

• Handle hierarchical transformations

• Manage empty or null nodes

Most Frequently Used Node Functions

Node Function Purpose Example Use Case

Checks if a source node exists (is Only map if Customer/Address


exists()
present) node exists

Conditionally map target node Map Discount only if TotalAmount


ifWithoutElse()
based on source > 1000

Flattens hierarchical structures Combine multiple line items into a


removeContexts()
(removes node contexts) flat list

Repeats a single value for multiple Assign the same OrderID to


useOneAsMany()
target occurrences multiple Item lines

Create separate groups in the


splitByValue() Splits source node by unique values
target per OrderID

Removes empty contexts, useful for Remove null or empty values in


collapseContexts()
flattening nested nodes
Node Function Purpose Example Use Case

Copies the current value, often Used with splitByValue or


copyValue()
used in loops conditional structures

Counts the number of occurrences Map total number of Items into a


count()
of a node summary field

equals() / Route mapping based on status


Compares node values
notEqual() being Open

Reorder Items by Price or


sort() Sorts repeating nodes by value
ItemNumber

How These Are Typically Used in Mapping

1. exists()

TargetField → exists(SourceField)

Only maps if SourceField exists. Useful in optional structures.

2. ifWithoutElse()

TargetField → ifWithoutElse(condition, sourceValue)

Maps only if a condition is true — without default fallback.

3. removeContexts() + collapseContexts()

Used together to flatten and clean nested/repeating structures.

collapseContexts(removeContexts(SourceNode))

4. useOneAsMany()

Repeats a constant or single value multiple times.

useOneAsMany(Constant("Order123"), SourceItemList)

5. splitByValue()
Splits based on unique values, useful in 1:n transformations.

splitByValue(Source.OrderID)

Example: Common Use Case

Scenario: You want to send multiple Item lines under a single Order, and assign a constant
order number to each item.

You would use:

• useOneAsMany() → Repeat OrderID

• removeContexts() → Flatten nested items

• collapseContexts() → Remove null items

Best Practices

• Use collapseContexts() with caution – it can remove meaningful structure if


overused.

• Always simulate mapping using the "Test" tab to validate node behavior.

• Chain functions logically — e.g., collapseContexts(removeContexts(...)).

• Use Message Mapping logs and traces to debug mapping results.

Quick Reference: When to Use What

Requirement Node Function

Conditional Mapping ifWithoutElse(), equals(), notEqual()

Flatten Structure removeContexts(), collapseContexts()

Group or Loop Mapping useOneAsMany(), splitByValue()

Count Elements count()

Check Existence exists()

Copy/Re-map Values copyValue()

You might also like