Hi
Try This
If @object_type='20' and @transaction_type in ('A','u')
BEGIN
If Exists (select * from PDN1 r inner join opdn r1 on r.docentry=r1.docentry
where isnull(r.Baseref,'') ='' and r1.DocType ='I' and r1.doctotal > 1000 and r1.DocEntry = @list_of_cols_val_tab_del )
BEGIN
Select @error = -1,
@error_message = 'GRPO without PO is not allowed'
End
End
With Regards
Balaji Sampath