cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem

Former Member
0 Kudos

Hi guys!

I have following mapping issue:

source:

<a/> (1..1)

+<b/> (1..n)

++<c/> (1..n)

+++<d/> (1..1)

target

<at/> (1..1)

+<bt/> (1..n)

++<ct/> (1..1)

I need to have mapped b->bt, that's for sure, because I need so many target elements. However, in each b is c n-times and always contains the same value in context of b. I need to achieve, that ONLY FIRST D will be in ct.

When I create mapping: constant->ct (creates only 1 ct) I do not get values d from context of b! I get them all in order! Example:

<a>

<b>

<c>

<d>1</d>

</c>

<c>

<d>1</d>

</c>

</b>

<b>

<c>

<d>2</d>

</c>

</b>

</a>

I get

<at>

<bt>

<ct>1</ct>

</bt>

<bt>

<ct>1</ct>

</bt>

</at>

I need to get:

<at>

<bt>

<ct>1</ct>

</bt>

<bt>

<ct>2</ct>

</bt>

</at>

Why it ignores the context and takes all values of a? I need the first one of context b, and b is mapped correctly to bt!

Any help appriciated!

Olian.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try setting context of d to b. bcoz you want to produce ct the same no of times as that of b

Former Member
0 Kudos

Mugdha, how do I do that?

Olain

Former Member
0 Kudos

Hi Olian,

As I told earlier you have to change the context to b.

You can right click on d in your mapping editor and you will get the option context and click to b.

d(context to b)-->collapseContexts-->bt
d(context to b)-->collapseContexts-->SplitByvale-->ct

Thanks

Shubhankar

Former Member
0 Kudos

Shubhankar, sorry, but there is no option oh change context to b. If I click d node on the source structure, I get only:

Where Used

Copy Path

Dependencies

No context change.

We're on PI7.0

Olian

Former Member
0 Kudos

Don't click on source structure. Click on Data-Flow editor.

Former Member
0 Kudos

Well, there is no need to use node functions. It was enough to link it directly , just context of d had to be changed to b. Shubhankar, but for your patience, you've got 10pts

Thanx!

Olian

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Olian,

d(context to b)-->collapseContexts-->bt
d(context to b)-->collapseContexts-->SplitByvale-->ct

And tell me your result.

Thanks

Shubhankar

Former Member
0 Kudos

Shubhankar, this doesn't work. I get all ct nodes in the first bt node.

What is collapseContexts good for?

Olian

Former Member
0 Kudos

Hi Olian,

But you have 1..1 for ct node and then how are you getting multily ct nodes under bt node.

See the below link for collapseContexts

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/4b/d11e3e1c3b120ae10000000a114084/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/4b/d11e3e1c3b120ae10000000a114084/content.htm</a>

Thanks

Shubhankar

Message was edited by:

Shubhankar Mandal

Former Member
0 Kudos

Shubhankar, you're right, sorry. It had to be 1..10 occurence and need only 1 node. Olian

Former Member
0 Kudos

try using collapseContext() while mapping ct in the target. Play around with context