Skip to Content

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

Blocking of Duplicate Customer Ref Number in AR Invoice

Good Morning Experts,

Just want to know how to block duplicate customer reference number in AR Invoice Entry. System is currently give message that "Customer ref number already exists in this document type..".

My set up for Document Remarks Include in Document Settings is BP Reference Number. Is there any additional set up that needs to be done so that system will block duplicate reference number?

Version SAP 2007A

PL 30

Localisation Australia/New Zealand

Thanks

Sandra

Former Member
replied

Hi

You can try this sp_transaction notification : Copy the given code to store procedure sp_transaction notification where it says --add code here

if (@object_type = '13' or @object_type = '15')

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

begin

declare @venno as varchar(100)

if @object_type = '15'

begin

select @venno = NumAtCard

from opdn

where docentry =@list_of_cols_val_tab_del

if 1 != (select count(docentry) from ODLN with(nolock) where NumAtCard = @venno)

begin

select @error = 1

select @error_message = 'Duplicate Customer ref no in SO Receipts. ! '

end

end

else

if @object_type = '13'

begin

select @venno = NumAtCard

from opch

where docentry =@list_of_cols_val_tab_del

if 1 != (select count(docentry) from OINV with(nolock) where NumAtCard = @venno)

begin

select @error = 2

select @error_message = 'Duplicate vendor ref no in AR Invoices. ! '

end

end

end

This will block the transaction when you have duplicate customer reference . It will let you put same customer reference in Sales order but it will block from delivery

<b>Please test it in test environment </b>

Thank you

Bishal

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question