cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with mapping

Former Member
0 Kudos

Hello professionals,

I need to map this structure

<message>

<node1>

<ab>1</ab>

<ab>2</ab>

<ab>3</ab>

</node1>

<node1>

<ab>3</ab>

<ab>4</ab>

</node1>

<node1>

<ab>5</ab>

<ab>6</ab>

<ab>7</ab>

</node1>

</message>

So, in the target structure I need to take only the first "ab" occurence in node1:

<message>

<node1>

<ab>1</ab>

</node1>

<node1>

<ab>3</ab>

</node1>

<node1>

<ab>5</ab>

</node1>

</message>

How can I do this? Many thanks for help!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use the Node function CollapseContext and keep the context of the source field as node1.

Node1 --> CollapseContext --> target field

former_member854360
Active Contributor
0 Kudos

Hi,

You can use COLLAPSECONTEXT or COPYVALUE(0) function

see this

http://help.sap.com/saphelp_nw04/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm

Former Member
0 Kudos

Thank you very much, Also I need to use SplitByValue after CollapseContext and it works. The main problem for me was the wrong context for <ab>, I need to use the same context as <node1>

Thanks!

Answers (0)