Hi,
Since you are not getting answer,please remove correct answer and open for further discussion.
Try this:
IF @object_type ='22' and @transaction_type in ('A','U')
begin
IF exists (SELECT T0.docentry FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode WHERE T2.[ItmsGrpCod] = '101' and T0.[UserSign] <> '5' and T0.DocEntry = @list_of_cols_val_tab_del )
select @error=N'001'
select @error_message = 'Not allowed to add PO for Raw material Group'
End
End
Let me know the result.
Thanks & Regards,
Nagarajan