Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need warehouse stock report

Hi,

I need all warehouse stack report with g/L account(Format code) for particular day(31/03/2015).

Please provide me query for that.

Regards,

J.vigneshwaran

Tags:
Former Member
replied

Hi Vigneshwaran,

Please try to communicate all of your requirements in one stretch

Please try below query

Declare @DocDate DateTime

Select @DocDate = Max(AA.DocDate) from OINM AA Where AA.DocDate<=[%0]

Set @DocDate = '[%0]'

SELECT T0.[ItemCode], T1.[ItemName], T0.[Warehouse], T3.WhsName

,T2.FormatCode,T2.AcctName--, T0.InvntAct

,@DocDate[Stock As on Date]

,Sum(T0.[InQty]-T0.[OutQty])[Qty]

,Sum(T0.[TransValue]) [Value]

FROM OINM T0 

  INNER JOIN OITM T1 ON T0.[ItemCode] = T1.[ItemCode]

  Left Outer Join OACT T2 on T0.InvntAct = T2.AcctCode

  Inner join OWHS T3 on T0.Warehouse = T3.WhsCode

WHERE T0.[DocDate] <=@DocDate

GROUP BY T0.[ItemCode], T1.[ItemName], T0.[Warehouse], T3.WhsName--, T0.InvntAct

,T2.FormatCode ,T2.AcctName

Having ABS(Sum(T0.[InQty]-T0.[OutQty]))+ABS(Sum(T0.[TransValue]))>0

Thanks

Unnikrishnan

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question