Skip to Content

SP for Production order

Hi Team,

When user create the production order, child item has automatically display from BOM. Here the user can ADD or EDIT the OWOR details. I need a SP to restrict the users to change the WOR1 details. I have use the below SP, but it's not allow to change the production status also.

IF @transaction_type IN ('A', 'U')AND @object_type in ('202')

BEGIN

If exists (SELECT Distinct T0.DocEntry,T1.ItemCode FROM OWOR T0

inner join ITT1 T2 on T2.Father = T0.Itemcode

Inner Join WOR1 T1 on T1.DocEntry=T0.DocEntry

where T0.DocEntry =20 AND T2.code not in

(SELECT T1.itemcode FROM WOR1 T1 where T0.Docentry = T1.DocEntry)OR T1.ItemCode not in

(Select Code From ITT1))

Begin

SET @error = '202'

SET @error_message = N'order can not be added if not match with BOM.'

End

END



Cheers!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers