on 02-12-2011 10:26 AM
Hi Experts,
I have a file to IDoc scenario for Goods Receipts.
I am receiving the good receipts in batch and the incoming structure is given below-
DT_SABRE_GoodsReceipts
GoodsReceiptsData 0.unbounded
Header 0.1
Posting_Date 0.1
Delivery_Note_Date 0.1
DataRecord 0.unbounded
MaterialCode
TypeCode
TrackingID_Number
QTY_Accepted
QTY_Received
DeliveryNote_Number
LineStation_Code
PO_LineItem_Number
PO_Number
QTY_Rejected
all the fields in the data record are 0.1 occurrence and having String as XSD type.
A sample example of the incoming XML is given below-
<GoodsReceiptsData>
<Header>
<Posting_Date>1</Posting_Date>
<Delivery_Note_Date>2</Delivery_Note_Date>
</Header>
<DataRecord>
<MaterialCode>m1</MaterialCode>
<TypeCode>t1</TypeCode>
<TrackingID_Number>12</TrackingID_Number>
<QTY_Accepted>23</QTY_Accepted>
<QTY_Received>2</QTY_Received>
<DeliveryNote_Number>111</DeliveryNote_Number>
<LineStation_Code>wsd</LineStation_Code>
<PO_LineItem_Number>10</PO_LineItem_Number>
<PO_Number>111</PO_Number>
<QTY_Rejected>21</QTY_Rejected>
</DataRecord>
<DataRecord>
<MaterialCode>m2</MaterialCode>
<TypeCode>t1</TypeCode>
<TrackingID_Number>12</TrackingID_Number>
<QTY_Accepted>23</QTY_Accepted>
<QTY_Received>2</QTY_Received>
<DeliveryNote_Number>222</DeliveryNote_Number>
<LineStation_Code>wsd</LineStation_Code>
<PO_LineItem_Number>10</PO_LineItem_Number>
<PO_Number>222</PO_Number>
<QTY_Rejected>21</QTY_Rejected>
</DataRecord>
<DataRecord>
<MaterialCode>m3</MaterialCode>
<TypeCode>t1</TypeCode>
<TrackingID_Number>12</TrackingID_Number>
<QTY_Accepted>23</QTY_Accepted>
<QTY_Received>2</QTY_Received>
<DeliveryNote_Number>111</DeliveryNote_Number>
<LineStation_Code>wsd</LineStation_Code>
<PO_LineItem_Number>20</PO_LineItem_Number>
<PO_Number>111</PO_Number>
<QTY_Rejected>21</QTY_Rejected>
</DataRecord>
</GoodsReceiptsData>
<GoodsReceiptsData>
<Header>
<Posting_Date>3</Posting_Date>
<Delivery_Note_Date>2</Delivery_Note_Date>
</Header>
<DataRecord>
<MaterialCode>m6</MaterialCode>
<TypeCode>t1</TypeCode>
<TrackingID_Number>12</TrackingID_Number>
<QTY_Accepted>23</QTY_Accepted>
<QTY_Received>2</QTY_Received>
<DeliveryNote_Number>111</DeliveryNote_Number>
<LineStation_Code>wsd</LineStation_Code>
<PO_LineItem_Number>30</PO_LineItem_Number>
<PO_Number>111</PO_Number>
<QTY_Rejected>21</QTY_Rejected>
</DataRecord>
<DataRecord>
<MaterialCode>m9</MaterialCode>
<TypeCode>t1</TypeCode>
<TrackingID_Number>12</TrackingID_Number>
<QTY_Accepted>23</QTY_Accepted>
<QTY_Received>2</QTY_Received>
<DeliveryNote_Number>33322</DeliveryNote_Number>
<LineStation_Code>wsd</LineStation_Code>
<PO_LineItem_Number>90</PO_LineItem_Number>
<PO_Number>33322</PO_Number>
<QTY_Rejected>21</QTY_Rejected>
</DataRecord>
</GoodsReceiptsData>
</ns0:MT_SABRE_GoodsReceipts>
Here, Delivery_Note_Date will be same for all the Header Section for all the GoodReceipts nodes, but the posting date will differ.
Now at the target side we have to create the IDOc in the below way-
for each goodreceipt file we need to check how many number of data records are there. In the example above-
for the first goodsreceipts we have 2 data records for the same PO number 111, so 1 IDOc will be created and this Idoc will contain two line items for each of this data records. and this IDoc will contain the respective dates from the Header Node.
Again for the PO number 222 another IDoc will be created with only one detail record and having the same Dates from the Header node.
Now we have again the PO number 111 in the 2nd goods receipt file, and in this case the header contains the different date.
considering this goods receipts file we have to create another IDoc with one detail record and date will be taken from the header node of the second goods receipt file.
As we have another PO 33322 in 2nd goods receipt file so another IDoc should be created with 1 line item. this will also contain the dates from the header of the 2nd good receipt file.
So as per the example given above we should have-
4 Idocs at target side.
1st IDoc- will contain 2 detail record from the first good receipt for PO num 111
2nd IDoc- will contain 1 detail record from the first good receipt for PO num 222
3rd IDoc- will contain 1 detail record from the 2nd good receipt for PO num 111
4th IDoc- will contain 1 detail record from the 2nd good receipt for PO num 33322.
The IDoc I am using at target side- as imported XSD and using multiple occurence. I am usnig - MBGMCR IDoc having basic type - MBGMCR03
Below is the mapping rule -
Idoc segment
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_HEAD_01
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE1
E1BP2017_GM_HEAD_01
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE1
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE
E1BP2017_GM_ITEM_CREATE
Target IDoc Fields ( the below fileds can be found in the segments mentioned above)
PLANT
PSTNG_DATE
PO_NUMBER
DELIV_NUMB
DOC_DATE
PO_ITEM
MATERIAL
QUANTITY
ENTRY_QNT
PO_PR_QNT
STGE_LOC
ORDERID
REF_DOC
Source fileds
Line station code
Posting date
PO number
Delivery Note number
Delivery Note date
PO line item number
Material code
Quantity received (in order UOM)
Quantity accepted (in order UOM)
Quantity rejected (in order UOM)
Type Code
Reference number
Tracking Id Number
I am able to produce the IDoc at target side, using below way-
POnumber( sting this to upper context)-> sort -> splibyvalue(value change)->co;;apse context--> IDoc
it is creating 4 IDocs.
But I am stuck with the other fields and the date fields from the header.
Request all of you for your help. Any help would be much appreciated.
please let me know if any information required.
Thanks
Sugata B Majumder
I have done the two step mapping and handled the context wrt higher level. it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For the date field try using CopyValue Function with parameter [0].
Regards,
Aravind
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am sorry, I don't know why the post looks like this, I have uploaded one file in the below link please download the same where I have written the same query but it looks good.
[http://www.filefactory.com/file/b55h6c3/n/Mapping_Required.doc]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.