Hi Harshal ,
Pls find the Sp below...It will work
If @object_type = '22' and @transaction_type in ( 'A','U')
BEGIN
If exists
(Select P.DocEntry , P.DocNum ,P.U_SO , P.NumAtCard , P.Comments From OPOR P Where P.DocEntry=@list_of_cols_val_tab_del and P.U_SO is null )
Select @error = 1,
@error_message = 'Please mention Sales Order Number' end
Regards,
Ramasamy