cancel
Showing results for 
Search instead for 
Did you mean: 

Advice required for mapping

Former Member
0 Kudos

Hi,

This is my source structure

ZMODEL (0:40)

---ZICP(0:1000)

And my target xml structure is

Models(0:1)

--Model(0:40)

---ICPS(0:1)

--ICP(1:unbounded)

I mapped them as ZICPICPS and ZICPICP. When the ZMODEL segment is repeated and ZICP is coming multiple times in that segment. My mapping is throwing an error saying it cant create ICP segment inn 2nd occurance of ZMODEL segment.

ONly ICP coming in first occurance of ZMODEL is being accepted. But the second occurance is throwing error

Can you tell me any changes in mapping?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

u can have a small udf:

execution type: all values of a context

iput : var1


if(var1.length!=0)
result.addValue("");
else
result.addSuppress();

mapping:

ZICP ---UDF - ICPS

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>ZICP--ICPS

ZICP(0:1000) and ---ICPS(0:1)

so how can you map those two ? the error you see is correct - you cannot have more then one ICPS

remove this mapping and it should work

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi,

it's not creating node ICPS if i removed that mapping. That is the reason i was confused and posted here

Former Member
0 Kudos

map constant to "ICPS"

constant---ICPS

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Can you try


ZICP -> removeContext -> ICP

Hope this helps,

Mark

Former Member
0 Kudos

@Amit i cant map with constant coz the subnode is 1:unbound, Which will throw an error if ZICP node is not generated on source side

@Mark It didnt throwed any error but didnt created ICP segment for the second occurance.Only first occurance was considered

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Models(0:1)

--Model(0:40)

---ICPS(0:1)

--ICP(1:unbounded)

Is this correct? Model is at the same hierarchy(level) as ICP?

Regards,

Mark

Former Member
0 Kudos

No they are subnodes to each other

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

In that case, for every Model that is created, ZICP should exist at least once.


ZICP -> mapWithDefault -> ICP

Hope this helps,

Mark