Hi Praful,
Try below Code.
IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '22' BEGIN if exists (select OPOR.DocEntry from OPOR INNER JOIN POR1 ON POR1.DocEntry = OPOR.DocEntry INNER JOIN OITM ON OITM.ItemCode = POR1.ItemCode where OITM.CardCode <> OPOR.CardCode AND OPOR.DocEntry = @list_of_cols_val_tab_del) begin SET @error = 221 SET @error_message = 'Not allowd !' end END
It works fine for me.
Regards,
Nishit Makadia