on 10-29-2007 9:00 PM
Hi All,
I need help from you guys to resolve this issue.
The source message is:
<?xml version="1.0" encoding="utf-8" ?>
- <nr1:MT_UnitEstimateData xmlns:nr1="urn:sce-com:xi:fi:UnitEstimateData">
- <MessagePayload>
- <Record>
<RowID>0001</RowID>
<RecordTypeIndicator>2</RecordTypeIndicator>
<OrderNumber>TD20170736</OrderNumber>
<Operation_Activity>0010</Operation_Activity>
<ControlKey>ZA01</ControlKey>
<Hours>1.2E0</Hours>
<UnitOfWork>H</UnitOfWork>
</Record>
- <Record>
<RowID>0002</RowID>
<RecordTypeIndicator>1</RecordTypeIndicator>
<b> <OrderNumber>TD20170736</OrderNumber></b> <Operation_Activity>0010</Operation_Activity>
- <MaterialCode>
- <Material>
<Material>000000000000000721</Material>
<UnitOfMeasure>EA</UnitOfMeasure>
<QTY>1.000</QTY>
<MovingPrice>108.25</MovingPrice>
<UsageCode>DO</UsageCode>
<LegendCode>RM</LegendCode>
</Material>
</MaterialCode>
</Record>
- <Record>
<RowID>0094</RowID>
<RecordTypeIndicator>1</RecordTypeIndicator>
<b><OrderNumber>TD289</OrderNumber></b> <Operation_Activity>0010</Operation_Activity>
- <MaterialCode>
- <Material>
<Material>000000000000000733</Material>
<UnitOfMeasure>EA</UnitOfMeasure>
<QTY>5.000</QTY>
<MovingPrice>58.52</MovingPrice>
<UsageCode>OH</UsageCode>
<LegendCode>20</LegendCode>
</Material>
- <Material>
<Material>000000000000000720</Material>
<UnitOfMeasure>EA</UnitOfMeasure>
<QTY>0.000</QTY>
<MovingPrice>10250.00</MovingPrice>
<UsageCode>OH</UsageCode>
<LegendCode>10</LegendCode>
</Material>
</MaterialCode>
</Record>
- <Record>
<RowID>0095</RowID>
<RecordTypeIndicator>2</RecordTypeIndicator>
<OrderNumber>TD289</OrderNumber>
<Operation_Activity>0020</Operation_Activity>
<ControlKey>ZA01</ControlKey>
<UnitOfWork>H</UnitOfWork>
</Record>
</MessagePayload>
</nr1:MT_UnitEstimateData>
The Target message being produced for this source message is:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_Material xmlns:ns1="urn:sce-com:xi:fi:UnitEstimateData">
<Insert_Material>
<dbTableName action="INSERT">
<table>SCEI_UE_MATERIALS</table>
<access>
<b> <AUFNR>TD20170736</AUFNR></b> <VORNR>0010</VORNR>
<MATNR>000000000000000721</MATNR>
<EINHEIT>EA</EINHEIT>
<MENGE>1.000</MENGE>
<VERPR>108.25</VERPR>
<SORTF1>DO</SORTF1>
<SORTF2>RM</SORTF2>
</access>
<access>
<b> <AUFNR>TD20170736</AUFNR></b> <VORNR>0010</VORNR>
<MATNR>000000000000000733</MATNR>
<EINHEIT>EA</EINHEIT>
<MENGE>5.000</MENGE>
<VERPR>58.52</VERPR>
<SORTF1>OH</SORTF1>
<SORTF2>20</SORTF2>
</access>
<access>
<b> <AUFNR>TD289</AUFNR></b> <VORNR>0010</VORNR>
<MATNR>000000000000000720</MATNR>
<EINHEIT>EA</EINHEIT>
<MENGE>0.000</MENGE>
<VERPR>10250.00</VERPR>
<SORTF1>OH</SORTF1>
<SORTF2>10</SORTF2>
</access>
</dbTableName>
</Insert_Material>
</ns1:MT_Material>
</ns0:Message1>
</ns0:Messages>
Now the issue is here is that I need to create access node for each Material Node in Source. I am doing that using creatif condition and it's wrking fine. It's just that the order number are not coming from right node in access node:
So the right output should be:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_Material xmlns:ns1="urn:sce-com:xi:fi:UnitEstimateData">
<Insert_Material>
<dbTableName action="INSERT">
<table>SCEI_UE_MATERIALS</table>
<access>
<b><AUFNR>TD20170736</AUFNR></b> <VORNR>0010</VORNR>
<MATNR>000000000000000721</MATNR>
<EINHEIT>EA</EINHEIT>
<MENGE>1.000</MENGE>
<VERPR>108.25</VERPR>
<SORTF1>DO</SORTF1>
<SORTF2>RM</SORTF2>
</access>
<access>
<b> <AUFNR>TD289</AUFNR></b> <VORNR>0010</VORNR>
<MATNR>000000000000000733</MATNR>
<EINHEIT>EA</EINHEIT>
<MENGE>5.000</MENGE>
<VERPR>58.52</VERPR>
<SORTF1>OH</SORTF1>
<SORTF2>20</SORTF2>
</access>
<access>
<b> <AUFNR>TD289</AUFNR></b> <VORNR>0010</VORNR>
<MATNR>000000000000000720</MATNR>
<EINHEIT>EA</EINHEIT>
<MENGE>0.000</MENGE>
<VERPR>10250.00</VERPR>
<SORTF1>OH</SORTF1>
<SORTF2>10</SORTF2>
</access>
</dbTableName>
</Insert_Material>
</ns1:MT_Material>
</ns0:Message1>
</ns0:Messages>
this is because access node 2 and 3 are coming from one record which has one common order number for two material codes.
Pls advice it's very important and urgent.
Regards,
XIer
Hi XIer,
this should work without usage of a UDF. Unfortunately it's hard to describe it in "text form", but I'll try it:
Target field mapping of access node:
Material (set context to Record) --> Exists --> createIf --> RemoveContexts --> Header
--> As a result your queue after Remove Contexts should look similar like this:
[SUPPRESS]
000000000000000721
000000000000000733
000000000000000720
[SUPPRESS]
Target field mapping of AURNR element:
useOneAsMany with the following input parameters:
- OrderNumber (set context to Record) --> useOneAsMany 1. parameter
- Material (set context to Record) --> Exists --> createIf --> useOneAsMany 2. parameter
- Material (set context to Record) --> Exists --> createIf --> useOneAsMany 3. parameter
Continue to work with the result of useOneAsMany --> removeContexts --> SplitByValue (Each value) --> AUNR
--> As a result of SplitByValue (Each value) you should have repeated the order number of the record you've two Material elements.
Target field mapping of MATNR should be 1:1 mapping from source to target.
Maybe there's an easier solution but this one should work. If not, please let me know.
Best regards
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hmmm...
Instead of the creatif, I think I might try a SplitByValue for this... with a property of eachValue.
Doug -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Xier,
Did u got the solution for your problem?
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Xier,
Did u gave the full source for the target produced, or just a sample? Coz I can see only one order number <b>TD289</b> in source.
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had a similar problem: you like to have the second field with the same order of the first one. I suggest you to create a User defined function (UDF) of type queue.
input parameter: order number
access node
output parameter: result with the queue of the order number in the right order.
tips: if you have to use the result more than one time Ii suggest you to add change contexts to memorize which order belong to the same access node.
I suggest you to see the following link to learn more about mapping:
Mapping functionality in XI
SAP Exchange Infrastructure - Graphical_Mapping
SAP Exchange Infrastructure - Graphical Mapping Exercise
SAP Exchange Infrastructure - Graphical Mapping - Advanced
SAP Exchange Infrastructure: Mapping Patterns - Understand Context Handling in Message Mapping - Webinar Powerpoint
SAP NetWeaver Exchange Infrastructure Mapping Troubleshooting - Webinar Powerpoint
Mapping Lookups a RFC API
XI 3.0 New Mapping Features
Message was edited by:
Salvatore Quattrocchi
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.