cancel
Showing results for 
Search instead for 
Did you mean: 

Batch Number's Quantity per Warehouse

leandro_daminelli2
Participant
0 Kudos
1,596

Hello Everyone.

I need to develop a form that lists the quantity of an item, grouping by warehouse and batch number.

I can retrieve the quantity per warehouse by querying OITW, but I don't know how to measure the quantity by batch numbers in each warehouse.

Can someone help-me?

Accepted Solutions (1)

Accepted Solutions (1)

former_member201110
Active Contributor
0 Kudos

Hi Leandro,

You don't mention which version of SBO you are using. The batch tables were changed between 2007A and 8.8 and have been further complicated in 9.0 by the introduction of bin locations.

I'm going to assume that you are using 8.8 or higher:


select

     T0.ItemCode, T2.ItemName, T0.DistNumber as BatchNum, T1.WhsCode, T1.Quantity

from

     OBTN T0

     inner join OBTQ T1 on T0.ItemCode = T1.ItemCode and T0.SysNumber = T1.SysNumber

     inner join OITM T2 on T0.ItemCode = T2.ItemCode

where

     T1.Quantity > 0 and T0.ItemCode = 'XYZ'

order by

     T1.WhsCode, T0.DistNumber

And for V9 with Bin Locations:


select

     T0.ItemCode, T2.ItemName, T0.DistNumber AS BatchNum, T1.WhsCode, T4.BinCode, T3.OnHandQty

from

OBTN T0

inner join OBTQ T1 on T0.ItemCode = T1.ItemCode and T0.SysNumber = T1.SysNumber

inner join OITM T2 on T0.ItemCode = T2.ItemCode

inner join OBBQ T3 on T0.ItemCode = T3.ItemCode and T0.SysNumber = T3.SnBMDAbs

inner join OBIN T4 on T3.BinAbs = T4.AbsEntry

where

T1.Quantity > 0 and T0.ItemCode = 'XYZ'

order by

T1.WhsCode, T0.DistNumber

Kind Regards

Owen

Answers (1)

Answers (1)

leandro_daminelli2
Participant
0 Kudos

Thank you, Owen!