I want to restrict the multiple production order based on Sales Order Items.
Suppose i am having SO say 1001 which contains four items(finished goods) say I1, I2, I4, I5.
Now i raised Production Order by selecting the SO 1001 and i have taken only one item(finished goods) I2.
Then in second time if i select same Item for same SO it should not allow me to add production order.
i have written below query but unable to map it.
Select Distinct T0.Series, T2.Series, T0.DocNum, T2.DocNum, T0.OriginNum, T0.ItemCode from OWOR T0 inner join WOR1 T1 on T1.DocEntry = T0.DocEntry
inner join ORDR T2 on T2.DocNum = T0.OriginNum and T2.CardCode = T0.CardCode
inner join RDR1 T3 on T3.DocEntry = T2.DocEntry and T3.ItemCode = T0.ItemCode
Where T0.OriginNum = '67'
and T0.ItemCode = 'P10001'