cancel
Showing results for 
Search instead for 
Did you mean: 

User define functions in Mapping - Need help...

Former Member
0 Kudos

I have the following Source structure

<root> (1...Unbounded)

<field1>

<field2>

<field3>

</root>

and need to map this in

<target>

<fields1>

<struct1>

<field2>

</struct1>

<struct1>

<field3>

</struct1>

</target>

i.e i need to create twice the struct1 one for each field (field2, field3) no matter how many rows I have...

Example:

<row>

<f1>1.1

<f2>1.2

<f3>1.3

</row>

<row>

<f1>2.1

<f2>2.2

<f3>2.3>

</row>

should result:

<target>

<f1>1.1

<struct1>

<f>1.2

</struct1>

<struct1>

<f>1.3</f>

</struct1>

</target>

Please advide

Accepted Solutions (1)

Accepted Solutions (1)

former_member192892
Active Contributor
0 Kudos

Hi,

You don't need UDF for this...

Create your target Message type as

<target>(1)

<fields1>(0---1)

<struct1>(0---unbounded)

<field2>(0---1)

<field3>(0---1)

</struct1>

</target>

here in your mapping right click on struct1 node and choose Duplicate Subtree

Now map like this

<field1>------<fields1>

<field2>-------<field2>(In the 1st struct1 node)

<field3>-------<field3>(In the 2nd struct1 node)

Former Member
0 Kudos

Thanks for the answer. But the problem is that the target structure is a standard IDOC and can not be change to be more exact:

The target message has two fields

<row>

GIDate

DocDate

</row>

and need to create two segments of the idoc SHP_IBDLV_CONFIRM_DECENTRAL.SHP_IBDLV_CONFIRM_DECENTRAL02

for segment E1BPDLVDEADLN where TIMETYPE and TIMESTAMP_UTC changes based on the two flat fields of the row structure:

e.g.

if I have

<row>

...

<deliveryNo>1111111111

<GIdate>20070909</gidate>

<DocDate>20071010</DocDate>

...

</row>

...

in the Idoc I neew to have

<E1BPDLVDEADLN>

<DELIV_NUM>1111111111

<TIMETYPE>WSHDRWADTI

<TIMESTAMP_UTC>20070909

</E1BPDLVDEADLN>

<E1BPDLVDEADLN>

<DELIV_NUM>1111111111

<TIMETYPE>WSHDRLFDAT

<TIMESTAMP_UTC>20071010

</E1BPDLVDEADLN>

I hope this is more clear...

Former Member
0 Kudos

I try the duplication on the target message nad now it works. Thanks it was a helpfull hint....

Answers (0)