cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate vendor Ref. no By Vendor Wise In SAP B1

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Instead of SP, you can use system function to prevent duplication of vendor reference. Please refer attached screen shot:

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi Nagarajan

You answare  is right But in my case is different

I want this if Vendor101 has Ref.no 100 then system not allow to enter Same ref No.(100) for Vendor101 but system allow to enter 100 for Vendor 102.

I want Vendor wise duplication Ref.no.

Thanks

Praful

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Refer Mr.Prasanna reply

Answers (1)

Answers (1)

former_member184146
Active Contributor
0 Kudos

Hi,

     Check the below Thread

Regards,

Manish