Skip to Content
0
May 25 at 03:19 AM

SP for Block Close of Production Order

223 Views

Hi all,

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')

BEGIN
IF EXISTS (

Select DocEntry From OWOR T0
where T0."UserSign2"<>1 and t0.Status='R' and T0.DocEntry = @list_of_cols_val_tab_del)

BEGIN
Set @error = -1
SET @error_message = 'You are not authorized to Closed this Production Order'
END
END