Skip to Content

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

Purchase Analysis and Sales Analysis Report by Warehouse

Hi Experts,

Good day!

I would like to know if there's a query designed to filter Sales Analysis/Purchase Analysis Reports by warehouse. In the selection criteria reports in SAP, there's no field for warehouse.

Thanks!

Ashley

Tags:
Former Member
replied

Try for purchase analsysis based on AP invoice:

SELECT T0.[CardCode], T0.[CardName], sum( T1.[LineTotal]) as Total, T1.[WhsCode] FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[WhsCode]  between [%0] and [%1] and  T0.[DocType] = 'i' and  T0.[DocDate] between [%2] and [%3] GROUP BY T0.[CardCode], T0.[CardName], T1.[WhsCode]

union all

SELECT T0.[CardCode], T0.[CardName], -sum( T1.[LineTotal]) as Total, T1.[WhsCode] FROM ORPC T0  INNER JOIN RPC1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[WhsCode]  between [%0] and [%1] and  T0.[DocType] = 'i' and  T0.[DocDate] between [%2] and [%3] GROUP BY T0.[CardCode], T0.[CardName], T1.[WhsCode]

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