on 01-28-2010 4:45 AM
hi, guru, I have to post this thread again to seek a detailed help on this.
I have a source as below
<source>
<record typeA="xx" typeB="yy">
<name>name1</name>
</record>
<record typeA="xx" >
<name>name2</name>
</record>
</source>
I'd like to create output as
<target>
<record>
<type>typeA</type>
<value>xx</value>
<name>name1</name>
</record>
<record>
<type>typeB</type>
<value>yy</value>
<name>name1</name>
</record>
<record>
<type>typeA</type>
<value>xx</value>
<name>name2</name>
</record>
</target>
How do I write this mapping without UDF ? some ones told me to use UseOneAsMany, but I really donn't know the details.
Can somebody help to show the details mapping for it?
Thanks a lot
Hi.
Well it's some difficult without UDF but you can try this.
duplicate the node record in your target message (click right ) and map atribut @typeA for first one and @typeB for another
@TypeA(change context source)----
>Record
@TypeB(change context source)----
>Record[1]
@TypeA(change context source)----
>Value
@TypeB(change context source)----
>Value[1]
map the source(name) twice.
name----
>name
name----
>name[1]
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luis,
this is a very good approach.
But it does not work correctly
The output looks like this:
<target>
<record>
<type>typeA</type>
<value>xx</value>
<name>name1</name>
</record>
<record>
<type>typeA</type>
<value>xx</value>
<name>name2</name>
</record>
<record>
<type>typeB</type>
<value>yy</value>
<name>name1</name>
</record>
</target>
The point is: All typeA elements come before all typeB elements instead of alternating.
In fact alternating sequences in the target source are a big issue for the graphical mapping tool.
right, this is the issue.
I'm wondering if we can use a variable to rememer the index of typeA and typeB, and then sort the target element by this index.
However I could not figure out a way to do it.
>
> Hi Luis,
>
> this is a very good approach.
> But it does not work correctly
>
> The output looks like this:
> <target>
> <record>
> <type>typeA</type>
> <value>xx</value>
> <name>name1</name>
> </record>
> <record>
> <type>typeA</type>
> <value>xx</value>
> <name>name2</name>
> </record>
> <record>
> <type>typeB</type>
> <value>yy</value>
> <name>name1</name>
> </record>
> </target>
>
> The point is: All typeA elements come before all typeB elements instead of alternating.
> In fact alternating sequences in the target source are a big issue for the graphical mapping tool.
Hi ShiWu,
I agree with Stefan, this is not possible without using UDF. Since as Stefan mentioned, it is an issue for XI/PI to handle alternating inputs. There is no way to get past this unless you have a function(UDF) that adds/joins the contexts of typeA and typeB so that this can be checked as just one whole context.
Hope this helps,
Is this a real scenario or a mapping puzzle
Sorry, I have no solution for this. This is really difficult and only experienced guys can solve this.
I wonder if there is a chance to adjust the source or the target structure to make the mapping easier?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Check this link. The example here is similar to yours
http://help.sap.com/saphelp_nw04/helpdata/EN/45/e3dd94f87c6f74e10000000a1553f6/frameset.htm
Regards,
Deepak.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> hi,
>
> Check this link. The example here is similar to yours
> http://help.sap.com/saphelp_nw04/helpdata/EN/45/e3dd94f87c6f74e10000000a1553f6/frameset.htm
>
> Regards,
> Deepak.
thanks, but this help talks about "Cache Monitoring ", is the link correct?
>
> Hi,
>
> Can u please elaborate the logic on which ur mapping...
>
> On what logic exactly u r mapping the source to Traget...
thanks, the logic is:
source structure is like
<source>
<record typeA="xx" typeB="yy">
<name>namexxxx</name>
<record>
<record>.
....
</record>
</source>
The attribute typeA, typeB are optional.
If there is typeA, then will create one target element for it , and output the <type>, <value> & <name>
<record>
<type>typeA</type>
<value>xx</value>
<name>name1</name>
</record>
And if there is typeB, will create similar element for it, too.
That means, if one source record has both typeA and typeB attributes, we will create 2 target element for it.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.