Hi
Try this
If @object_type = '18' and @transaction_type in ('U')
begin
if exists (SELECT T0.[DocEntry] FROM OPCH T0 INNER JOIN ODRF T1 ON T0.[draftKey] = T1.[DocEntry] WHERE T0.[docEntry]= @list_of_cols_val_tab_del and T1.[DocStatus] ='C')
begin
set @error = 2100
set @error_message = ('A/P Invoice is Approved can not Update!')
end
End