cancel
Showing results for 
Search instead for 
Did you mean: 

How are the OWOR/Wor1 and OIGE/IGE1 tables joined?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member205766
Active Contributor
0 Kudos

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


Answers (1)

Answers (1)

former_member212181
Active Contributor
0 Kudos

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

Former Member
0 Kudos

This answer is correct too.  Thank you, Unnikrishnan