cancel
Showing results for 
Search instead for 
Did you mean: 

Query Showing Variance in production Order

Former Member
0 Kudos

I want to create a query showing Actual component Cost , Actual Product Costs, where there is a Variance... I cant seem to locate the table names. I have gone on summary on the production order still cant see the fields.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.......

OIGN, IGN1 for Receipt and OIGE and IGE1 for Issue. Try these table and build the proper relation ship which gives you the variance in production.

Also check OWOR and WOR1 for Production Order

Issue-Receipt=Variance.......

Hope this will help you........

Regards,

Rahul

Former Member
0 Kudos

Hello Raul,

Thanks for this, when you open a Production Order and go to summary the fields are there, but I want to find where they are located as when I do Check System Information it doesn't show were the Table resides.....

Thanks,

Titi

bhavank_gajjar
Active Contributor
0 Kudos

Hi..

its a variable fields and they are coming through SAP standard Coding System.

As rahul says you requires to develop own query using listed tables

Regards,

Bhavank

Former Member
0 Kudos

I have managed to create this query am seeking help on how I can subtract Actual Product Cost & Actual Component Cost

SELECT DISTINCT T0.[DocNum], T0.[PlannedQty], T0.[CmpltQty], T1.[Dscription], T0.[PostDate], (T1.[StockPrice]T0.[CmpltQty]) as 'Actual Product Cost', sum(T2.[LineTotal]) as 'Actual Component Cost' FROM OWOR T0 LEFT JOIN IGN1 T1 ON T0.[DocNum]=T1.[BaseRef] LEFT JOIN IGE1 T2 ON T0.[DocNum]=T2.[BaseRef] WHERE T0.[PostDate] >=[%0] AND T0.[PostDate] <=[%1] GROUP BY T0.[DocNum], T0.[PlannedQty], T0.[CmpltQty], T1.[Dscription], T0.[PostDate], (T1.[StockPrice]T0.[CmpltQty])

Thanks,

Mwelwa

Former Member
0 Kudos

Hi Mwelva......

If you are finding difficulty then i suggest you to use OINM (Warehouse Journal) Table. you dnt want to link any table, you will get both the entries here for ign1 also and for ige1 also......

Try this table.....

Regards,

Rahul

Former Member
0 Kudos

Try this:

SELECT DISTINCT T0.DocNum, T0.PlannedQty, T0.CmpltQty, T1.Dscription, T0.PostDate, (T1.StockPrice*T0.CmpltQty) as 'Actual Product Cost', -sum(T2.TransValue) as 'Actual Component Cost'

FROM OWOR T0

LEFT JOIN IGN1 T1 ON T0.DocNum=T1.BaseRef

INNER JOIN OINM T2 ON T0.DocEntry=T2.AppObjAbs AND OutQTY>0

WHERE T0.PostDate >=[%0\] AND T0.PostDate <=[%1\]

GROUP BY T0.DocNum, T0.PlannedQty, T0.CmpltQty, T1.Dscription, T0.PostDate, (T1.StockPrice*T0.CmpltQty)

Thanks,

Gordon

Former Member
0 Kudos

Thanks Gordon,

I need a separate column for the difference of (T1.StockPrice*T0.CmpltQty) as 'Actual Product Cost' and -sum(T2.TransValue) as 'Actual Component Cost'

Former Member
0 Kudos

Updated to include difference:

SELECT DISTINCT T0.DocNum, T0.PlannedQty, T0.CmpltQty, T1.Dscription, T0.PostDate, (T1.StockPrice*T0.CmpltQty) as 'Actual Product Cost', -sum(T2.TransValue) as 'Actual Component Cost',

(T1.StockPrice*T0.CmpltQty) +sum(T2.TransValue) as Difference

FROM OWOR T0

LEFT JOIN IGN1 T1 ON T0.DocNum=T1.BaseRef

INNER JOIN OINM T2 ON T0.DocEntry=T2.AppObjAbs AND OutQTY>0

WHERE T0.PostDate >=[%0\] AND T0.PostDate <=[%1\]

GROUP BY T0.DocNum, T0.PlannedQty, T0.CmpltQty, T1.Dscription, T0.PostDate, (T1.StockPrice*T0.CmpltQty)

Answers (0)