cancel
Showing results for 
Search instead for 
Did you mean: 

Unbounded to falt structure mapping

Werner_Magerl
Participant
0 Kudos

Hello,

I think I have a very easy mapping problem but I do not find the solution.

I want to map

<field> maxoccurs = 4

to

<field1>

<field2>

<field3>

<field4>

so the first occurance of <field> should goto <field1> ....

Source

<field>value1</field>

<field>value2</field>

<field>value3</field>

target

<field1>value1</field1>

<field2>value2</field2>

<field3>value3</field3>

Does this work with built-in function or do I have to write a UDF....???

best regards

Werner

Accepted Solutions (1)

Accepted Solutions (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,

yourmapping should be

field1>copyValue(0)>field1

field1>copyValue(1)>field2

field1>copyValue(2)>field3

field1>copyValue(3)>field4

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

U can go for UDF :

There will be 2 inputs var1 and var2.

Execution Type: All values of a context

UDF:

int a = Integer.parseInt(var2[0]);

result.addValue(var1[a]);

(modify this UDF according to ur req)

Mapping will be:

field

-> UDF -> filed1 (in this case output will be "value1")

Contant(0)

proceed in the same way for other target field mapping.

Thanks

Amit

Werner_Magerl
Participant
0 Kudos

does this coding work also in PI7.0???

Werner

former_member241146
Active Participant
0 Kudos

Hello Werner.

I undertood that your XML result have to be dynamic, is that right?

You can use a Java Mapping or XSLT Mapping.

Above some links about this topics:

Generic XSLT Mapping for SAP XI, Part II.pdf

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a

How to Optimize and Encrypt Your Exchange Infrastructure Java Mappings

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/91640c86-0b01-0010-5f9f-95e095674090

Good luck

Bruno

Werner_Magerl
Participant
0 Kudos

Hello,

now the strcuture is not really dynamic....also my structure is only a part of a complex structure I want to map

with graphical mapping.

<field> can be unbounded (but will be maxoccurs=10)

<field1>, <field2>....<field4> is defined fix....

So my goal is to get the first 4 records from <field>,

all others will be lost

Werner