on 09-14-2010 2:16 PM
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
hi,
yourmapping should be
field1>copyValue(0)>field1
field1>copyValue(1)>field2
field1>copyValue(2)>field3
field1>copyValue(3)>field4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.