on 10-13-2009 9:19 AM
Hi Pals,
In source message X1,X2 and X3 data type is there and in target L1,L2,L3 data type is there. I have added X1 to L1,X2 to L2 and X3 to L3 using remote context function. But not getting desired output. Other info is below :
Structure is as follows
<L1>50</L1>
- <Test>
<L2>40</L2>
- <Test1>
<L3>05</L3>
</Test1>
- <Test1>
<L3>10</L3>
<Test1>
</Test>
Desired output is below -
L1 50
L2 40
L3 05
L1 50
L2 40
L3 10
Can any one guide me how to do mapping to get below output.
Best Regards
Hi Vijay,
Only 3rd level, i.e Test1 is repeating?
Or even second level Test is repeating?
And if yes, then what is the required output in that case?
Regards,
Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suraj -
SOURCE STR-
<L1>10</L1>
- <Test>
<L2>10</L2>
- <LINE>
<L3>05</L3>
</LINE>
- <LINE>
<L3>10</L3>
</LINE>
</Test>
<L1>45</L1>
- <Test>
<L2>15</L2>
- <LINE>
<L3>25</L3>
</LINE>
</Test>
TARGET STRUCTURE - 3 simple nodes below a common segment
X1
X2
X3
Output will be like
X1 L1 10
X2 L2 10
X3 L3 05
X3 L3 10
X1 L1 45
X2 L2 15
X3 L3 25
Pls suggest how mapping needs to be done b/w source and target structure.
Best Regards
Best Regards
Hello..
thinking your target to be like
root
-Details
--X1
---L1
--X2
---L2
--X3
---L3
Map[ping can be done as
L3 - removecontext-Details
L1 (source) -useoneasmany - splitbyValue-X1 (target)
L3 (context root)
L3 (context LINE)
L1 (source) -useoneasmany - splitbyValue-L1 (target)
L3 (context root)
L3 (context LINE)
L2 (source) -useoneasmany - splitbyValue-X2 (target)
L3 (context root)
L3 (context LINE)
L2 (source) -useoneasmany - splitbyValue-L2 (target)
L3 (context root)
L3 (context LINE)
L3----X3
L3 --- L3
PS: It is difficult to say whether this will work or not.. Try for X1 and L1 then X2 L2 and then X3 L3
Regards
suraj
Hi Vijay...
if your input is like this....
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_TestSDNIn xmlns:ns0="http://abc.com/YH1314/Test">
<Record>
<L1>50</L1>
<Test>
<L2>40</L2>
<Test1>
<L3>05</L3>
</Test1>
<Test1>
<L3>10</L3>
</Test1>
</Test>
<Test>
<L2>50</L2>
<Test1>
<L3>05</L3>
</Test1>
</Test>
</Record>
<Record>
<L1>60</L1>
<Test>
<L2>50</L2>
<Test1>
<L3>05</L3>
</Test1>
</Test>
</Record>
</ns0:MT_TestSDNIn>
and if you want the output like this....
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_TestSDNOut xmlns:ns0="http://abc.com/YH1314/Test">
<Record>
<L1>50</L1>
<L2>40</L2>
<L3>05</L3>
</Record>
<Record>
<L1>50</L1>
<L2>40</L2>
<L3>10</L3></Record>
<Record>
<L1>50</L1>
<L2>50</L2>
<L3>05</L3>
</Record>
<Record>
<L1>60</L1>
<L2>50</L2>
<L3>05</L3>
</Record>
</ns0:MT_TestSDNOut>
Use this Mapping...
Test1---->removeContex----->Record
L1-------------------------\
L3(manual context change to Record)--->UseOneAsMany---->SpliByValue(EachValue)----->L1
Test1---------------------------/
L2---------\
Test1-------->UseOneAsMany---->SpliByValue(EachValue)----->L3
Test1--------/
L3----L3
Thanks
Hi Vijay,
'useOneAsMany' has 3 arguments.
If it is showing yellow, that means your mapping is incomplete.
First argument would be your source field.
2nd will be the Test1 field with context change according to which you will be changing the value in output queue.
And 3 rd argument would be the Test1 field for context changes in output queue.
Regards,
Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
see my second reply about how to use useOneAsMany standard function in this thread
you use function useOneAsMany() if a field that only occurs once needs to be replicated as often as another field occurs in the outbound message so that the fields can be written to the target structure in pairs as a record.
it takes three inputs
first input values to be replicated
second input for how many times the values is to be repeated(Occurence)
third input How to structure the values
L1-------------------------\
L3(manual context change to Record)--->UseOneAsMany---->SpliByValue(EachValue)----->L1
Test1---------------------------/
first input is L1
Second input is L3(right click on L3 to change the context Record)
third input is Test1
if you still have doubts,then refer this http://wiki.sdn.sap.com/wiki/display/XI/Explainnodefunctions
for how to use UseOneAsMany std function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
In the above example, you have mentioned teh following output:
X1 L1 10
X2 L2 10
X3 L3 05
X3 L3 10
But hows it possible?
X3 is a simple element with 0 to 1 occurence, correct me if I am wrong.
In that case your output shuld look like,
X1 L1 10
X2 L2 10
X3 L3 05
X1 L1 10
X2 L2 10
X3 L3 10
Regards,
Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.