on 08-01-2007 11:28 AM
Hi Crew,
I need the mapping logic to acheive this target structure from the source structure.
Source Structure:
<Pen>
<colour>Red</colour>
<company>Parker</company>
<type>Refill</type>
</Pen>
Target Structure:
<Pen>
<character>
<no>1</no>
<name>colour</name>
<value>Red</value>
</character>
<character>
<no>2</no>
<name>company</name>
<value>Parker</value>
</character>
<character>
<no>3</no>
<name>type</name>
<value>Refill</value>
</character>
</Pen>
Kindly help!
Thanks in advance
karthik kaveriselvan
Karthik,
First let me confirm your structure.
Source
<Pen> 0..Unbounded
<color/>
<company/>
<type/>
</Pen>
Target
<Pen>0..Unbounded
<character>0..Unbounded
<no/>
<name/>
<value/>
</character>
</Pen>
If you think i'm correct, then proceed with below logic.
In Mapping editor Right click on <character> and click duplicate sub-tree three times.
Now follow the logic.
Pen -
>Pen.
character(1 occurrence)
Constant[1] -
> no
Constant[colour]----->name
colour -
> value
Character(2 occurrence)
Constant[2] -
>no
Constant[Company]----name
company---->value.
Character(3 occurrence)
Constant[3]---->no
Constant[Type]---->name
type--->value.
Hope it helps!!!!
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
set the context of the subnodes to PEN.
<b>Generate character for every entiries in Source</b>
pen ---> splitbyvalue(valuechanged) -> No
<b>Generate numbers</b>
pen ---> splitbyvalue(Eachvalue) ->INDEX -> No
for the rest u might need to use a udf to read the source node name. let me check if there is a std function for this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
According to your query, i am taking the following asumption and writtten logic. if my asumpation are true then you can use the following logic
1. Pen has 3 feature always [color,company,refill]
Logic. Create the following 3 UDF's
1 UDF
Return the 3 sequence numbers and use Split by value after the UDF. Mapped to the No
2. UDF
Return the 3 hard coded values Color, Company, Type and use the Split by value after the UDF. Mapped to the Name
3. UDF
Return the 3 values Color, Company, Type and combined and use the Split by value after the UDF. Mapped to the value
and Map the First UDF also with Character.
Pen to Pen.
Then your problem will solve
Best Regads,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi karthik
/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
simple java function:
advanced java function:
http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
hope it will help u ....
Pls reward if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.