Anda di halaman 1dari 5

SR: SRQ01977706

Issue: The Inbound delivery confirmation message sent for FG pallet when receiving through ASN has missing information like Qty ,Vendor Batch, Requested Batch as 0 and NULL. This causes the message to fail at SAP end. The Sample Inbound delivery and ASN is attcahed with the SR and can be used for Replication. The following test have been conducted on the affliate environment but should be reproducible at DEv as well with the sample Inbound files. Root Cause: Operation: PMIIU_ConfirmDelivery - PMI.IV.2.5.001 Step: Send CONFIRM_DECENTRAL_ID+ASN Function: RetrieveOrderData

WITH Picking_Sum AS ( SELECT CP.WipOrderNo, CP.WipOrderType, SUM(CP.Quantity) Quantity, CP.PartnerLotNo PartnerLotNo, SUM(IC.quantityonhand) QuantityOnhand, SUM(IC.quantityallocated) QuantityAllocated,I.UomCode UomCode,L.LotNo LotNo, MIN (CP.VendorLotNo) VendorLotNo, MIN (CP.ProductionDate) ProductionDate, I.InventoryStatus InventoryStatus FROM at_container_picking CP LEFT OUTER JOIN inventory_container IC ON IC.Container = CP.Container LEFT OUTER JOIN inventory I ON I.ID = IC.InventoryID --CHG00002847 LEFT OUTER JOIN lot_no L ON I.LotNo = L.LotNo AND I.ProductId = L.ProductId

WHERE Status<> 5 --Cancelled GROUP BY WipOrderNo, WipOrderType, CP.PartnerLotNo, I.InventoryStatus, I.UomCode,L.LotNo ) SELECT OD.OrderLineNo OrderLineNoList, OD.OALineID MasterLineNoList, ISNULL(dbo.AF_ConvValueToDifferentUOM(PS.UomCode,OD.OrderedUomCode,P.ID , (PS.QuantityAllocated+PS.QuantityOnhand)),0) as QuantityList, OD.OrderedUomCode UomCodeList, P.ProductNo ProductNoList, PS.LotNo LotNoList, CASE WHEN dbo.AF_GetUnitCharacteristicAttribute(OD.UnitId, 'RequestedBatch')IS NOT NULL THEN NULL ELSE PS.VendorLotNo END VendorLotNoList, --PS.VendorLotNo VendorLotNoList, PS.ProductionDate ProductionDateList, CASE ISNULL (PS.InventoryStatus, OD.ToInventoryStatus) WHEN '1' THEN 'F' WHEN '2' THEN 'X' WHEN '3' THEN 'S' ELSE 'F' END AS StockTypeList, ISNULL (PS.InventoryStatus, OD.ToInventoryStatus) AS ToInventoryStatusList, --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation dbo.AF_GetNominatorValue(UomCodeFrom,UomCodeTo,P.ID,'1800099074') AS 'Numerator',--X UomCodeFrom, dbo.AF_GetDenominatorValue(UomCodeFrom,UomCodeTo,P.ID,'1800099074') AS 'Denominator',--Y UomCodeTo, 0 AS ConversionFactor --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation FROM Wip_Order WO INNER JOIN order_detail OD ON WO.OrderNo = OD.OrderNo AND WO.OrderType = OD.OrderType AND WO.OrderLineNo = OD.OrderLineNo INNER JOIN product P ON P.ID = OD.ProductID --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation LEFT JOIN Picking_Sum PS ON PS.WipOrderNo = WO.WipOrderNo AND PS.WipOrderType = WO.WipOrderType LEFT JOIN Product_Uom_Conversion PUC on PUC.ProductID=P.ID AND PUC.UomCodeFrom=OD.orderedUomCode AND PUC.UomCodeTo=PS.UomCode WHERE WO.OrderNo = '1800099074' AND OD.OrderType = 1016 GROUP BY OD.OrderLineNo , OD.OALineID, OD.OrderedUomCode, P.ProductNo, PS.LotNo,PS.ProductionDate, PS.UomCode, P.ID, OD.UnitId, PS.VendorLotNo, PS.InventoryStatus, OD.ToInventoryStatus,PS.QuantityAllocated,PS.QuantityOnhand, --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation PUC.ConversionFactor, PUC.UomCodeFrom, PUC.UomCodeTo

The quantity, Batch and Vendor batch details are fetched from the temp table Picking_Sum which in turn fetches the details from AT_Container_Picking and Inventory_container Let deconstruct the query a bit. The Temporary table Picking_Sum returns Zero rows for the
Inbound delivery WO.OrderNo = '1800099074'

But AT_container_picking contains details of the container with respect to ASN order 1500256771.

The above query needs to be changed to consider the ASN order while joining with the temp table Picking_Sum

Thus , the highlighted part of the Query needs to be changed. Tentative Suggested solution is as follows:
WITH Picking_Sum AS (

SELECT CP.WipOrderNo, CP.WipOrderType,WO.OrderNo, WO.OrderType, SUM(CP.Quantity) Quantity, CP.PartnerLotNo PartnerLotNo, SUM(IC.quantityonhand) QuantityOnhand, SUM(IC.quantityallocated) QuantityAllocated,I.UomCode UomCode,L.LotNo LotNo, MIN (CP.VendorLotNo) VendorLotNo, MIN (CP.ProductionDate) ProductionDate, I.InventoryStatus InventoryStatus FROM at_container_picking CP LEFT OUTER JOIN inventory_container IC ON IC.Container = CP.Container LEFT OUTER JOIN inventory I ON I.ID = IC.InventoryID --CHG00002847 LEFT OUTER JOIN lot_no L ON I.LotNo = L.LotNo AND I.ProductId = L.ProductId LEFT JOIN WIP_ORDER WO ON CP.WipOrderNo= WO.WipOrderNo and CP.WipOrderType=WO.WipOrderType WHERE Status<> 5 --Cancelled GROUP BY CP.WipOrderNo, CP.WipOrderType, CP.PartnerLotNo, I.InventoryStatus, I.UomCode,L.LotNo,WO.OrderNo, WO.OrderType ) SELECT OD.OrderLineNo OrderLineNoList, OD.OALineID MasterLineNoList, ISNULL(dbo.AF_ConvValueToDifferentUOM(PS.UomCode,OD.OrderedUomCode,P.ID , (PS.QuantityAllocated+PS.QuantityOnhand),0) as QuantityList, OD.OrderedUomCode UomCodeList, P.ProductNo ProductNoList, PS.LotNo LotNoList, CASE WHEN dbo.AF_GetUnitCharacteristicAttribute(OD.UnitId, 'RequestedBatch')IS NOT NULL THEN NULL ELSE PS.VendorLotNo END VendorLotNoList, --PS.VendorLotNo VendorLotNoList, PS.ProductionDate ProductionDateList, CASE ISNULL (PS.InventoryStatus, OD.ToInventoryStatus) WHEN '1' THEN 'F' WHEN '2' THEN 'X' WHEN '3' THEN 'S' ELSE 'F' END AS StockTypeList, ISNULL (PS.InventoryStatus, OD.ToInventoryStatus) AS ToInventoryStatusList --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation ,dbo.AF_GetNominatorValue(UomCodeFrom,UomCodeTo,P.ID,'1800099074') AS 'Numerator',--X UomCodeFrom, dbo.AF_GetDenominatorValue(UomCodeFrom,UomCodeTo,P.ID,'1800099074') AS 'Denominator',--Y UomCodeTo, 0 AS ConversionFactor --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation FROM Wip_Order WO INNER JOIN order_detail OD ON WO.OrderNo = OD.OrderNo AND WO.OrderType = OD.OrderType AND WO.OrderLineNo = OD.OrderLineNo INNER JOIN product P ON P.ID = OD.ProductID --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation

LEFT JOIN Picking_Sum PS ON PS.OrderNo = @ASNOrderNo AND PS.WipOrderType = @ASNOrderType LEFT JOIN Product_Uom_Conversion PUC on PUC.ProductID=P.ID AND PUC.UomCodeFrom=OD.orderedUomCode AND PUC.UomCodeTo=PS.UomCode WHERE WO.OrderNo = @OrderNo AND OD.OrderType = @OrderType GROUP BY OD.OrderLineNo , OD.OALineID, OD.OrderedUomCode, P.ProductNo, PS.LotNo,PS.ProductionDate, PS.UomCode, P.ID, OD.UnitId, PS.VendorLotNo, PS.InventoryStatus, OD.ToInventoryStatus,PS.QuantityAllocated,PS.QuantityOnhand, --CHG00109315-Issue with UoM conversion in SAP Delivery confirmation PUC.ConversionFactor, PUC.UomCodeFrom, PUC.UomCodeTo

Note :The @ASNOrderNo and @ASNOrderType is already available in the SO and function.

Anda mungkin juga menyukai