Olá Sandra,
Envio o query que usamos para você testar, solicita código de depósito e data.
SELECT T0.[ItemCode] 'CÓDIGO SAP', T2.[ItemName] 'DESCRIÇÃO', T2.SWW 'REF.FÁBRICA', T3.FIRMNAME 'MARCA',
(SELECT (SUM(Y.InQty) - SUM(Y.OutQty))
FROM OINM Y WHERE Y.ItemCode = T2.ItemCode AND Y.Warehouse = T1.WhsCode AND Y.DocDate BETWEEN '01/01/2001' AND '[%1]') 'ESTOQUE', T1.[WhsCode] 'DEPÓSITO', T1.WHSNAME 'NOME DEPÓSITO', (SELECT (SUM(Y.TransValue))
FROM OINM Y WHERE Y.ItemCode = T2.ItemCode AND Y.Warehouse = T1.WhsCode AND Y.DocDate BETWEEN '01/01/2001' AND '[%1]') '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 '01/01/2001' AND '[%1]' and (t0.whscode = [%2] OR t0.whscode = [%3] OR t0.whscode = [%4] OR t0.whscode = [%5] OR t0.whscode = [%6] OR t0.whscode = [%7] OR t0.whscode = [%8] OR t0.whscode = [%9] OR t0.whscode = [%10] OR t0.whscode = [%11] OR t0.whscode = [%12] OR t0.whscode = [%13])) != '0'
ORDER BY T0.[WhsCode], T0.[ItemCode]
Me conta como está indo.