Skip to Content
Former Member
Jun 24, 2015 at 06:24 PM

Sales Order Batch Allocation


In SAP B1, if i create a sales order for 10 batch controlled item and preallocate those batch numbers from a particular warehouse and bin, how can i find, via a query, what bins the batches were allocated from?

Below I have a query that tells me the batch to the warehouse level, but i cannot find a table that relates it down to a bin level.

SELECT T0.DocNum,T0.DocLine,T2.ItemCode,T2.DistNumber,SUM(T1.AllocQty) AllocQty, T0.LogEntry, rdr1.WhsCode FROM OITL T0

JOIN ITL1 T1 ON T0.LogEntry = T1.LogEntry

JOIN OBTN T2 ON T1.SysNumber = T2.SysNumber AND T0.ItemCode = T2.ItemCode

join rdr1 on rdr1.DocEntry = t0.DocNum

WHERE T0.DocType = 17 And T0.DocNum = '364' And T0.DocLine = '0'

GROUP BY T0.DocNum,T0.DocLine,T2.ItemCode,T2.DistNumber , T0.LogEntry, rdr1.WhsCode

HAVING(SUM(T1.AllocQty) <> 0)

can anyone provide the table that has the bins for this, or modify my query to return the bin as well?