on 04-06-2012 3:34 PM
Hello Friends,
Our input csv file contains Purchase Order details, arranged with Header and Details like below.
-------------------------------------------------------
H,100
D,S101,Screw 2,5,NOS,2.00
D,S102,Screw 3,6,NOS,3.00
H,101
D,V100,V Belt A-48,1,NOS,4.25
H,102
D,G101,Grease A-51,2,KGS,629.50
D,G102,Grease A-52,3,KGS,350.21
D,G103,Grease A-53,4,KGS,225.10
-------------------------------------------------------
The input structure (Message Type) to receive this data we designed like below.:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_PurchaseOrder xmlns:ns0="http://abc.com/PI/TEST">
<PurchaseOrder>
<OrderNo>100</OrderNo>
<ItemDetails>
<ItemNo>S101</ItemNo>
<Description>Screw 2</Description>
<Qty>4</Qty>
<UOM>Nos</UOM>
<Price>110.00</Price>
</ItemDetails>
<ItemDetails>
<ItemNo>S102</ItemNo>
<Description>Screw 3</Description>
<Qty>5</Qty>
<UOM>Nos</UOM>
<Price>120.00</Price>
</ItemDetails>
</PurchaseOrder>
<PurchaseOrder>
<OrderNo>101</OrderNo>
<ItemDetails>
<ItemNo>G101</ItemNo>
<Description>Grease 2 T</Description>
<Qty>2</Qty>
<UOM>Kgs</UOM>
<Price>180.00</Price>
</ItemDetails>
</PurchaseOrder>
</ns0:MT_PurchaseOrder>
This input XML taken from the message mapping. In this structure <PurchaseOrder> node occurrence is 0..unbounded and <ItemDetails> node occurrence is 0..unbounded. Then <ItemDetails> node in under the parent node <PurchaseOrder>.
We use the same Message Type for inbound interface (receiver). Mapping is simple one-to-one mapping.
In the sender channel, we have specified the FCC parameters are as below.
Document Name: MT_PurchaseOrder
Document Namespace: http://abc.com/PI/TEST
Recordset Structure: PurchaseOrder,*,ItemDetails,*
Recordset Sequence: Ascending
Recordsets per Message: *
Key Field Name: key
--------------------------------------------------------------------
PurchaseOrder.fieldSeparator : ,
PurchaseOrder.fieldNames: key,OrderNo
PurchaseOrder.keyFieldValue: H
PurchaseOrder.keyFieldInStructure: ignore
PurchaseOrder.endSeparator: 'nl'
ItemDetails.fieldSeparator: ,
ItemDetails.endSeparator: 'nl'
ItemDetails.fieldNames: key,ItemNo,Description,Qty,UOM,Price
ItemDetails.keyFieldValue: D
ItemDetails.keyFieldInStructure: ignore
ignoreRecordsetName: true
--------------------------------------------------------------------
When we place the input file and test, the adapter converts into XML format. In this XML, <PurchaseOrder> end tag comes immediately after end tag of Order No field. </OrderNo>. Whereas in the design time mapping check, </PurchaseOrder> end tag comes after last item details node in each purchase order. Due to this <PurchaseOrder> tag misplace, in the output XML, <ItemDetails> node mapping is skipped. Really we don't understand why this. I have attached the input.xml and output.xml for your reference.
Friends, could you please clarify, how to fix this.
Kind regards,
Jegathees P.
Since this requirement has two level relationship and it' not easy to fit using the recordset structure definition, as I already mentioned above you cannot handle just using File content conversion parameters. Follow other alternate options.
Plus you get Header followed by items in a repeated fashion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You may want to check this below thread which also has a similar scenario.
http://scn.sap.com/thread/1969830
-Zameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just few cents...
I see you wrap ItemDetails inside purchaseorder. But Recordset Structure says
Recordset Structure: PurchaseOrder,*,ItemDetails,*
Is that right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is two level relationship structure. THe given Recordset structure would not work. THinking about other options. In the meantime try as below
provide just PurchaseOrder,* see how that behaves.
Plus, PurchaseOrder fieldNames does not contain Items, so the output.xml would not show the items inside purchase order.
Hi,
You need a small change to your FCC configuration. Add "PurchaseOrder" as a value for Recordset Name attribute that you did not use so far. In addition to that, add the following to the attributes list:
PurchaseOrder.ignoreRecordsetName = true
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Grzegorz
Thank you for your immediate reply. As you said, I have entered Recordset Name: PurchaseOrder in the channel and added FCC parameter PurchaseOrder.ignoreRecordsetName = true. And executed the scenario. Still the same error I am getting. There is no change in the input.xml and output.xml.
Really I am wondering what is the mistake?, why the system adds
</PurchaseOrder> tag immediately after
</OrderNo> tag , instead at the end of the
</ItemDetails> in each purchase order. This is causing the trouble.
Any idea Grezegorz?
Hi,
I think I can see the problem now, and I have to admin that I was wrong. The solution to prepare has to be a little bit more complex. Required changes, comparing to your initial setup, are:
I hope this solves your problem finally. And once again apologies for my initial mistake.
Greg
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.