Environment:
iVend 6.6 with SAPB1 10.
Problem Statement :
There is need to have SQL Queried to find Open Stock Transfers in iVend Enterprise database
SQL Queries :
Below Queries are used :
a)
select a.StockTransferKey,a.FromWarehouseKey,a.ToWarehouseKey,a.BusinessDate,b.ProductKey,b.Quantity,b.QuantityOpen,b.QuantityReceived,b.QuantityShipped,c.id as Warehouseid,c.InTransitWarehouseKey,
e.id as Itemcode,e.ProductKey,
d.InStockQuantity,
d.InReturnQuantity,
d.OnRentQuantity,
d.LostQuantity,
d.OnLayawayQuantity,
d.OnOrderQuantity,
d.OnFulFillmentQuantity,
d.AvailableQuantity ,
d.InTransitQuantity ,
d.ReservedQuantity
from InvStockTransfer (nolock) a,
InvStockTransferdetail (nolock) b,
InvWarehouse (nolock) c,
InvInventoryItem (nolock) d,
invproduct (nolock) e
where a.StockTransferKey=b.StockTransferKey
and a.Status in (0,2)
and a.ToWarehouseKey=c.WarehouseKey
and b.ProductKey=d.ProductKey
and d.ProductKey=e.ProductKey
and c.InTransitWarehouseKey=d.WarehouseKey
b)
Select IP.id,
x.*, III.AvailableQuantity as 'INTRANSITQTY' from
(
Select ISTD.ProductKey, sum(istd.QuantityOpen) as TOTALOPENQTY from InvStockTransfer IST join InvStockTransferDetail ISTD on IST.StockTransferKey = ISTD.StockTransferKey where IST.Status in (0,2)
group by ISTD.ProductKey) as x join invinventoryitem III on x.ProductKey = III.ProductKey and III.WarehouseKey = 'PASS INTRASIT WAREHOUSE KEY' join InvProduct IP on IP.productkey = x.ProductKey
where x.TOTALOPENQTY > III.AvailableQuantity
** Need to pass the parameter of INTRASIT WAREHOUSE KEY