I want to create new SP to block all users except manager userid from Close the production order in SAP B1. But my code below seems wrong cause even other users want to changed the status to Released still cannot. I want all users cannot changed the production order status to Closed only not Planned or Released. Can someone help me?
IF @object_type='202' AND @transaction_type IN ('A','U')
IF EXISTS (
Select DocEntry From OWOR T0
where T0."UserSign2"<>1 and t0.Status='R' and T0.DocEntry = @list_of_cols_val_tab_del)
Set @error = -1
SET @error_message = 'You are not authorized to Closed this Production Order'