on 06-22-2015 11:19 PM
I am trying to join these tables so that I can extract the Total document costs from the OIGE table for my work order completed query. I cannot get it to work. I realize there could be several Issues for Production (OIGE) for a single work order but I'm still not getting the query to join correctly.
thanks
Tony
Hi Tony
Try the below joins
OIGE T0 INNER JOIN IGE1 T1 ON T0.DocEntry = T1.DocEntry inner join owor t2 on t2.docnum = t1.baseentry left join ign1 t3 on t3.baseentry = t2.docnum left join oign t4 on t4.docentry = t3.docentry
With Regards
Balaji Sampath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tony,
Receipt from Production document lines (IGE1) are related to production Order lines.
IGE1.BaseType = 202-- 202 is poduction orders object type
and IGE1.BaseEntry = WOR1.DocEntry
and IGE1.BaseLine = WOR1.LineNum
Please try below sample query also
-----
Select T3.DocNum,Sum(T1.LineTotal)[Cost]
from OIGE T0
Inner Join IGE1 T1 on T0.DocEntry = T1.DocEntry
Inner Join WOR1 T2 on T1.BaseType =202 and T1.BaseEntry = T2.DocEntry and T1.BaseLine = T2.LineNum
Inner Join OWOR T3 on T2.DocEntry = T3.DocEntry
Where T3.DocNum =[%0]
group By T3.DocNum
---------
Thanks
Unnikrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.