Try this query:
SELECT [Item] as Item#,
[OPEN],Opencost,[REJ_FG],REJ_FGcost,[SFTO-618],SFTO618cost,[TOOL],TOOLcost
FROM(SELECT T0.[ItemCode] as Item, sum(T0.[InQty] - T0.[OutQty]) AS QTY, T0.[Warehouse] AS WAREHOUSE,
Case when T0.[Warehouse] = 'open' then sum(T0.[TransValue]) end as 'Opencost',
Case when T0.[Warehouse] = 'REJ_FG' then sum(T0.[TransValue]) end as 'REJ_FGcost',
Case when T0.[Warehouse] = 'SFTO-618' then sum(T0.[TransValue]) end as 'SFTO618cost',
Case when T0.[Warehouse] = 'TOOL' then sum(T0.[TransValue]) end as 'TOOLcost'
FROM OINM T0
WHERE T0.[DocDate] <= [%0] AND T0.[ItemCode] = [%1] group by T0.[ItemCode],T0.[Warehouse]) S
PIVOT
(SUM(QTY) FOR WAREHOUSE IN ([OPEN],[REJ_FG],[SFTO-618],[TOOL])) P