Dear Amol,
Try this.
IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '22' BEGIN if exists (SELECT T0.[ObjType], T0.[DocEntry], T0.[DocNum], T1.[LineNum], T1.[Project], T0.[DocStatus], T2.[U_Status] FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry Left JOIN OPRJ T2 ON T1.Project = T2.PrjCode WHERE (T1.Project is NULL) and T0.DocType='I' and T1.LineStatus= 'O' and T0.DocEntry=@list_of_cols_val_tab_del) begin SET @error = 221 SET @error_message = 'Project Code not Select' end END
Tell me this working for you or not...
Regards,
Nishit Makadia