Hi Gopi
Try This
IF @transaction_type IN ('A','U') and @Object_type = 30
BEGIN
IF EXISTS (SELECT T0.TransId FROM dbo.JDT1 T0
WHERE ((T0.ProfitCode ='' OR T0.ProfitCode IS NULL) and (T0.[OcrCode2]='' OR T0.[OcrCode2] IS NULL) and (T0.[OcrCode3]='' OR T0.[OcrCode3] IS NULL) and
(T0.[OcrCode4]='' OR T0.[OcrCode4] IS NULL) and (T0.[OcrCode5]='' OR T0.[OcrCode5] IS NULL)) AND T0.TransId = @list_of_cols_val_tab_del)
Begin
SET @Error = 1111
SET @error_message = 'At least one cost center is mandatory!'
End
End
With Regards
Balaji Sampath