Hola Sandra,
Te envío el query que utilizamos para que lo pruebes, solicita código de bodega y fecha.
SELECT T0.[ItemCode] 'CÓDIGO SAP', T2.[ItemName] 'DESCRIPCIÓN', 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]') 'STOCK', T1.[WhsCode] 'BODEGA', T1.WHSNAME 'NOMBRE BODEGA', (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]
Cuéntame cómo te va.