Skip to Content

Store procedure

Hello There!

I have created a store procedure but it is not working fine

here's the code of it

IF @transaction_type in (N'U',N'A') and @object_type = '202' Begin declare @batchfg nvarchar(MAX) select @batchfg = a.U_productcode from OWOR a where a.ItemCode like 'WIP%' and a.Status like '[r,p,c]%' --select @batchfg declare @a nvarchar(max) SELECT @a = a.Status FROM owor a if exists (select * from OWOR a where a.U_productcode = @batchfg and a.ItemCode like 'fg%' and a.Status not like 'l%' and a.DocEntry = @list_of_cols_val_tab_del) Begin SET @error = 202 SET @error_message = ' This WIP Items must be close before this FG item Closed'

End

End

I actually want a store procedure that if WIP production order of Same Batch is not closed then FG Production order should not be Closed.

But the from the above store procedure I just my FG production order is restricted and can not be planned or released until my WIP Production order is not Closed.

Is there anyone can help me with this code

Thank you

Javed Iqbal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers