Boa tarde Williams, compartilho uma consulta que espero que seja útil. Você deve inserir o código do seu armazém e a data final para visualizar o seu estoque.
SELECT T0.[ItemCode] 'CÓDIGO SAP',
(SELECT (SUM(Y.InQty) - SUM(Y.OutQty))
FROM OINM Y WHERE Y.ItemCode = T2.ItemCode AND Y.Warehouse = T1.WhsCode AND Y.DocDate BETWEEN '20130101' AND '20140421') 'ESTOQUE', T1.[WhsCode] 'ARMAZÉM', T1.WHSNAME 'NOME DO ARMAZÉM', (SELECT (SUM(Y.TransValue))
FROM OINM Y WHERE Y.ItemCode = T2.ItemCode AND Y.Warehouse = T1.WhsCode AND Y.DocDate BETWEEN '20130101' AND '20140421') 'Valor Acumulado'
FROM OITW T0
INNER JOIN OWHS T1 ON T0.WhsCode = T1.WhsCode
INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode
INNER JOIN OMRC T3 ON T2.FIRMCODE = T3.FIRMCODE
WHERE (SELECT (SUM(Y.InQty) - SUM(Y.OutQty)) FROM OINM Y WHERE Y.ItemCode = T2.ItemCode AND Y.Warehouse = T1.WhsCode AND Y.DocDate BETWEEN '20130101' AND '20140421' AND (T0.WhsCode = 'MP')) != '0'
ORDER BY T0.[WhsCode], T0.[ItemCode]
Atenciosamente