Hola @Sergio.lopez, por supuesto, mira te sugiero sacar esa info de la OINM, si tienes activado el costeo por FIFO, si podras sacar el costo por lote, y ahi tendrias que sacar la info de OITW, sino prueba con este query:
select distinct t1.itemcode, t1.batchnum, t1.quantity,
t1.WhsCode into #TEMP_JM12193
from
(
select distinct prodlist.itemcode, prodlist.batchnum,
prodlist.quantity, prodlist.WhsCode from
( select itemcode, batchnum, whscode,
Quantity
from oibt
group by itemcode, batchnum,
WhsCode,Quantity
) prodlist
inner join
( select itemcode,batchnum, suppSerial As
SuppSerial
from oibt
group by itemcode,batchnum, SuppSerial
) sublist
on sublist.itemcode = prodlist.itemcode and
sublist.batchnum=prodlist.batchnum
) t1
select distinct t0.itemcode, t0.batchnum, t0.whscode,
tmp.quantity"On Hand", t2.CalcPrice"Fifo Item Cost"
--t2.CalcPrice
from oibt t0 inner join #TEMP_JM12193 tmp on t0.itemcode =
tmp.itemcode and t0.batchnum = tmp.batchnum
and t0.WhsCode = tmp.WhsCode
inner join OINM t2 on t2.ItemCode = tmp.ItemCode and
t2.Warehouse = tmp.WhsCode
where tmp.Quantity <> '0'
order by t0.ItemCode
drop table #TEMP_JM12193