on 08-08-2014 1:38 PM
Hi Experts,
I would like to write query to get Batch wise inventory transfer to particular Bin Location.
- regards
vikas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikas,
The Query :
DECLARE @WTREntry int = 1
SELECT T0."ObjType"
, T0."DocEntry"
, T1."DocLine"
, T1."ItemCode" "ItemCode"
, T3."DistNumber" "BatchNumber"
, (T1.DocQty/Abs(T1.DocQty)) * T2."Quantity" Quantity
, T2."BinAbs" "BinAbs"
, T1."LocCode" "Whse"
, T4."BinCode" "BinCode"
, T1."LogEntry"
FROM OWTR T0 JOIN OITL T1 ON T0."DocEntry" = T1."DocEntry" AND T0."ObjType" = T1."DocType" AND ISNULL(T1."DefinedQty",0)>0
JOIN OBTL T2 ON T1."LogEntry" = T2."ITLEntry"
LEFT JOIN OBTN T3 ON T2."SnBMDAbs" = T3."AbsEntry"
LEFT JOIN OBIN T4 ON T2."BinAbs" = T4."AbsEntry"
WHERE T0."DocEntry" = @WTREntry
ORDER BY T0."DocEntry", T1."DocLine", T1."LogEntry"
Change the @WTREntry to your doc entry.
Note the negative qty mark the direction is out.
Positive qty mark direction in. If you need to get only the in, then filter the negative quantity.
Also note that the above assume a transfer from Bin to Bin.
Regards
Edy
User | Count |
---|---|
109 | |
15 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.