Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

AVRAGE INVENTORY

Former Member
0 Likes
439
  • SAP Managed Tags

I am trying to do a query to take out the stock with more than one date, I have tried this query but it does not work

SELECT T0.ItemCode,T0.ItemName,

DATE 1 = (select ItemCode, SUM(inqty)-SUM(outqty) from OINM where docdate <= '2021-04-01' group by ItemCode),

DATE 2 = (select ItemCode, SUM(inqty)-SUM(outqty) from OINM where docdate <= '2021-04-02' group by ItemCode),

DATE 3 = (select ItemCode, SUM(inqty)-SUM(outqty) from OINM where docdate <= '2021-04-03' group by ItemCode),

FROM OITM T0 INNER JOIN OINM T1 ON T0.ItemCode = T1.ItemCode group By T0.ItemCode, T0.ItemName

I am trying to do a query to take out the stock with more than one date, I have tried this query but it does not work

SELECT T0.ItemCode,T0.ItemName,

DATE 1 = (select ItemCode, SUM(inqty)-SUM(outqty) from OINM where docdate <= '2021-04-01' group by ItemCode),

DATE 2 = (select ItemCode, SUM(inqty)-SUM(outqty) from OINM where docdate <= '2021-04-02' group by ItemCode),

DATE 3 = (select ItemCode, SUM(inqty)-SUM(outqty) from OINM where docdate <= '2021-04-03' group by ItemCode),

FROM OITM T0 INNER JOIN OINM T1 ON T0.ItemCode = T1.ItemCode group By T0.ItemCode, T0.ItemName

0 REPLIES 0