Skip to Content
0
Feb 17, 2016 at 12:00 PM

Query for Production order reference.

27 Views

Greetings from India,

Have created the following query to link the production order row level item to the latest GRPO number for its identification and traceability.

SELECT distinct T0.[DocNum], T0.[ItemCode], T0.[PostDate], T0.[PlannedQty], T0.[CmpltQty], T0.[CloseDate], T1.[ItemCode], T3.[DocNum] FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry inner join PDN1 T2 on T2.ItemCode = T1.ItemCode INNER JOIN OPDN T3 ON T2.DocEntry = T3.DocEntry WHERE (T0.[ItemCode] like '0CF%%' or T0.[ItemCode] like '0HF%%') and T0.[Status] ='L' ORDER BY T0.[CloseDate]

But the results are having multiple GRN values for the input material in Production order as the material has been inwarded a lot of times.

Can anyone help?

Regards.