on 06-03-2013 8:16 AM
Hello Guru’s,
I have a mapping to do, and I’m a little bit lost.
I have a XML file, and I need to generate for each file one to many Idocs following the OrderNumber.
The XML structure and the Idoc DELVRY05 rules for this mapping are explain next.
I have change the definition of the Idoc in MM with "<xsd:element name="IDOC" type="DESADV.DELVRY05" maxOccurs="unbounded"/>" to allow more than one idocs.
ASN xml file
<ns0:MT_ASN xmlns:ns0="www.bia.be:komatsu">
<InvoiceNumber>PSI/13002432</InvoiceNumber>
<Supplier>
<Identifier>Supplier1</Identifier>
<Name>Supplier</Name>
...
</Supplier>
<ShipTo>
<Identifier>Supplier1</Identifier>
<Name>Supplier</Name>
...
</ShipTo>
<Invoicee>
<Identifier>Supplier1</Identifier>
<Name>Supplier</Name>
...
</Invoicee>
<Case Identifier="Box 1" Type="Carton">
<CaseSize Unit="CM" Height=" 21" Length=" 42" Width=" 25"/>
<CaseWeight Unit="KG" Gross=" 14.00" Net=" 13.70"/>
<Line Number="1">
….
<OrderNumber>10</OrderNumber>
<OrderLineNumber> 1</OrderLineNumber>
…
</Line>
<Line Number="2">
….
<OrderNumber>10</OrderNumber>
<OrderLineNumber> 2</OrderLineNumber>
…
</Line>
<Line Number="3">
….
<OrderNumber>10</OrderNumber>
<OrderLineNumber> 4</OrderLineNumber>
…
</Line>
</Case>
<Case Identifier="Box 2" Type="Carton">
<CaseSize Unit="CM" Height=" 21" Length=" 42" Width=" 25"/>
<CaseWeight Unit="KG" Gross=" 14.00" Net=" 13.70"/>
<Line Number="1">
….
<OrderNumber>10</OrderNumber>
<OrderLineNumber> 3</OrderLineNumber>
…
</Line>
<Line Number="2">
….
<OrderNumber>10</OrderNumber>
<OrderLineNumber> 5</OrderLineNumber>
…
</Line>
</Case>
<Case Identifier="Box 3" Type="Carton">
<CaseSize Unit="CM" Height=" 21" Length=" 42" Width=" 25"/>
<CaseWeight Unit="KG" Gross=" 14.00" Net=" 13.70"/>
<Line Number="1">
….
<OrderNumber>11</OrderNumber>
<OrderLineNumber> 1</OrderLineNumber>
…
</Line>
<Line Number="2">
….
<OrderNumber>11</OrderNumber>
<OrderLineNumber> 2</OrderLineNumber>
…
</Line>
<Line Number="3">
….
<OrderNumber>11</OrderNumber>
<OrderLineNumber> 3</OrderLineNumber>
…
</Line>
</Case>
</Message>
</ns0:MT_ASN>
Idoc Splitting
Thanks a lot
Jean-Claude
Hi Jean-Claude,
From the example, this is what I could gather. Hope it is correct understanding else please share the screenshot of mapping with source structure clearly shown and I can suggest on mapping.
In this case, 2 IDoc should be created one each for Order Number 10 and 11 ?
First IDoc should have 9 E1EDL24 segments and the second one 3.
For IDoc creation, map OrderNumber with higher context to IDoc node using SplitByValue(Value Change) - > CollapseContext. this should create the IDoc nodes.
For Line Item segment E1EDL24, map OrderNumber with higher context to IDoc node using SplitByValue(Value Change) to E1EDL24 node
For E1EDL37,you should have 2 segments for first order and 1 for second.
OrderNumber (context Case) -> collapseContext - > Split by Value (ValueChange)
Similarly, you have to play around with context of Order Number field even though you have to create E1EDL44 based on LineNumber
Hope it helps.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ambrish,
Now I have a problem with Segment E1EDL20. This one have to created with some header data (always the same for each Idoc coming from one XML File).
I have one segment E1EDL20 per Idoc, and when I apply the same mapping that for Idoc, I have the following message in testing
" Cannot create target element /DELVRY05/IDOC[2]/E1EDL20. Values missing in queue context."
What's the problem
For the other segments, your mapping is correct.
Thanks a lot.
JC
Hi JC,
You can simply map it to a constant value since it is a header segment and should always be created.
For the field level, if they can follow the same rule you followed for IDoc creation with collapseContext. Take the first value from the set of values and populate the target field.
If you have any doubts, give me a sample field and which value you want populated from source and I can help you further.
Ambrish
Hello Ambrish,
In segment E1EDL20, I need PO Date and PO Number (from Vendor) coming from
<Document Identifier="13002432" Date="20130524" Function="9"/> on the same level than <Case>
Where E1EDL20-PODAT = Date
and E1EDL20-LIFEX = Identifier
I have also the Segment E1EADRM1 (3 times) for the partner base on :
<Supplier>
<Identifier/>
<Name/>
<StreetAndNumber/>
<CityName/>
<Country/>
</Supplier>
<ShipTo>
<Identifier/>
<Name/>
<StreetAndNumber/>
<CityName/>
<Country/>
</ShipTo>
<Invoicee>
<Identifier/>
<Name/>
<StreetAndNumber/>
<CityName/>
<Country/>
</Invoicee>
All this are correct for the first Idoc, but not exists for the others
Thanks a lot for your help.
JC
Hi JC,
First on field population of header segment E1EDL20.
the source node <Document Identifier="13002432" Date="20130524" Function="9"/> is at the same level as Case but whats the occurence. If it occurs once per Order, map the fields directly. I don't see the segment in the structure above so I am not confident.
for adrm1 segment, use duplicate subtree twice and create the segment always by mapping to a constant value. For field level, do if Identifier = X, map source field to target field. I am sure the ADRM1 segment will be populated based on identifiers.
Hope it helps!
Ambrish
Hello Ambrish,
Now it's work fine.
For other Segment (always the same in each Idoc), I have used the Graphical Variable, like explain in the William Li's blog
Thanks a lot for your help.
JC
Hi Jean,
I am running into same issue. I need to create one IDOC i.e. E1EDL20 per Load number(Like Order number in your case) and many E1EDL24s per each different Items(Like order lene number in your case).
I am not able to map many E1EDL24s under one E1EDL20. If you can share your mapping, it will be very helpful.
Thanks in advance...
By
Satish
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.