on 12-09-2009 7:44 PM
Dear Friends,
I have source structure as follows: <Matgrp>Renu</Matgrp> tag shld come in header node in Target.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_SS1 xmlns:ns0="http://test.com/renu">
<Header>
<Matno>100</Matno>
<matdesc>sample</matdesc>
</Header>
<Item>
<MAtno>100</MAtno>
<itemno>201</itemno>
<Matgrp>Renu</Matgrp>
</Item>
<Item>
<MAtno>200</MAtno>
<itemno>202</itemno>
<Matgrp>Raj</Matgrp>
</Item>
</ns0:MT_SS1>
My Target Stucture is as follows:
I need to repeat Header for each Item node.
Kindly guide me.
Renu.
Hi,
You can use std. fun CopyValue for repeating the header values.
For more help on CopyValue function do a search on SDN.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My Target Stucture is as follows:
I need to repeat Header for each Item node.
I am not able to view the target structure......If you want to repeat the Header for each Item node then both Header and Item in the target should be mapped to the Item node from Source ..... you may need to adjust the Context of the source nodes within Header and Item nodes while mapping them to thate corresponding taregt nodes.
The target message structure should be as shown by Chirag if you want to maintain sequence between a Header and corresponding Item node.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If I understood correctly u want the below target structure.
<ns0:MT_SS1 xmlns:ns0="http://test.com/renu">
<Message>
<Header>
<Matno>100</Matno>
<matdesc>sample</matdesc>
</Header>
<Item>
<MAtno>100</MAtno>
<itemno>201</itemno>
<Matgrp>Renu</Matgrp>
</Item>
</Message>
<Message>
<Header>
<Matno>100</Matno>
<matdesc>sample</matdesc>
</Header>
<Item>
<MAtno>200</MAtno>
<itemno>202</itemno>
<Matgrp>Raj</Matgrp>
</Item>
</Message>
</ns0:MT_SS1>
In this case - inside message (Occurance 0-unbounded) make header and item as child node( occurance 0-1).
map the source with the same values.
Chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Friends,
My source Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_SS1 xmlns:ns0="http://test.com/renu">
<Header>
<Matno>100</Matno>
<matdesc>Test</matdesc>
</Header>
<Item>
<MAtno>100</MAtno>
<itemno>A100</itemno>
<Matgrp>grp1</Matgrp>
</Item>
<Item>
<MAtno>101</MAtno>
<itemno>A101</itemno>
<Matgrp>grp2</Matgrp>
</Item>
</ns0:MT_SS1>
I am getting my current target structure aa:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_TT1 xmlns:ns0="http://palm.com/bpm">
<Header>
<MAtno>100</MAtno>
<Matdesc>Test</Matdesc>
<Matgrp>grp1</Matgrp>
</Header>
<Item>
<Matno>100</Matno>
<itemno>A100</itemno>
</Item>
<Item>
<Matno>101</Matno>
<itemno>A101</itemno>
</Item>
</ns0:MT_TT1>
I am not getting my desired result my Header is not repeating to item node.
Kindly guide me friends.
Renu.
Hi,
I mapped Header Node of source to Header node of Target as follows
Matno of Header -
>
Itemno of Item node -
> Use One as MAny -
>Split By Value------->Header
Item no of item node------->
I am getting following error in IR.
11:54:53 Start of test
Runtime exception during processing target field mapping /ns0:MT_TT1/Header. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too few values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MT_TT1/Header. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too few values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:364) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too few values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ] at com.sap.aii.mappingtool.tf3.rt.Q2QFunctionWrapper.cacheQueue(Q2QFunctionWrapper.java:104) at com.sap.aii.mappingtool.tf3.rt.Q2QFunctionWrapper.gotoNextContext(Q2QFunctionWrapper.java:41) at com.sap.aii.mappingtool.flib3.SplitByValue$SplitByEach.gotoNextContext(SplitByValue.java:127) at com.sap.aii.mappingtool.flib3.SplitByValue.gotoNextContext(SplitByValue.java:31) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:266) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:326) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:415) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:118) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:319) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:200) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172) RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MT_TT1/Header. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too few values in first queue in function useOneAsMany. It must have the same number of contexts as second queue.] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ]
11:54:53 End of test
Hi Renu,
If you want to repeat the header node many times then you have to use the OneAsMany node function.
Inputs for the OneAsMany node function.
first input give the header field (matdesc or matno what ever you required)
second and third fields input as same, that is Item field node segment. (item node based on your given input).
After this node function use split by value then map the target field.
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Renu,
If i am right tahn your target message structure should be
<message> (0..n)
<>Header> (1..1)
<Item > (1..1)
</message>
- Simply map source <Item> node to target <Message>
- Hardcode Header target node
- Header elements of source to Hedaer elements of target
- Hardcode Item node of target
- map source item elements to target item elements
Thanks
-Kulwant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
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.