Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Duplicate vendor Ref. no By Vendor Wise In SAP B1

Hi ALL

How to Prevent to duplicate vendor Ref.no by vendor wise By SP Notification in sap B1. (FOR AP Invoice )

For Example

Vendor Code    Ref,no

VEN1001         100

VEN1002          100

So SP should work like this.

my SP as following

if @object_type = '18'

and (@transaction_type = 'A' or @transaction_type = 'U')

Begin

declare @venno as varchar (100)

declare @vennam as varchar (100)

if (@object_type = '18')

Begin

select @venno = NumAtCard from OPCH T0 where docentry = @list_of_cols_Val_tab_del

select @vennam = CardCode from OPCH T0 where docentry = @list_of_cols_Val_tab_del

Begin

if (@venno is not null)

Begin

if 1!= (select count (docentry) from OPCH with (nolock)where (NumatCard = @venno) and (cardcode = @vennam))

Begin

select @error = 2

select @error_message = 'Duplicate Vendor Ref Number!'

End

End

End

End

End

Thanks

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question