Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 06, 2015 at 12:08 AM

    Hi,

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

    Thanks & Regards,

    Nagarajan


    12.PNG (9.6 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 05, 2015 at 08:06 PM

    Hi,

         Check the below Thread

    Regards,

    Manish

    Add comment
    10|10000 characters needed characters exceeded