TransNotif block duplicate vendor ref

Hi experts,
Im using this TransNotif to block duplicate Vendor Ref in the sales order but i only want it for doc series 1 and 6, how can i achieve this.
if @object_type = '17' and (@transaction_type in ('A' ,'U'))
begin
declare @RefNo as varchar (100)
declare @CardCode as varchar (100)
declare @Series smallint
     if (@object_type = '17')
          begin
             select @RefNo = NumAtCard, @CardCode = CardCode from ORDR T0 where docentry = @list_of_cols_Val_tab_del
             begin
               if (@RefNo is not null)
                 begin
                   if 1!= (select count (docentry) from ORDR  where (NumatCard = @RefNo) and (cardcode = @CardCode))
                     begin
                        select @error = 10
                        select @error_message = 'Conduce Duplicado'
                     End
                   End
               End
          End
End

Hi Leonardo E. Martinez
Try This you can include the series in the where condition
If @object_type = '17' and (@transaction_type in ('A' ,'U'))
begin
declare @RefNo as varchar (100)
declare @CardCode as varchar (100)
declare @Series smallint
     if (@object_type = '17')
          begin
             select @RefNo = NumAtCard, @CardCode = CardCode from ORDR T0
                    where docentry = @list_of_cols_Val_tab_del and T0.Series IN (1,6)
             begin
               if (@RefNo is not null)
                 begin
                   if 1!= (select count (docentry) from ORDR  where (NumatCard = @RefNo) and (cardcode = @CardCode))
                     begin
                        select @error = 10
                        select @error_message = 'Conduce Duplicado'
                     End
                   End
               End
          End
End
Hope Helpful
Regards
Kennedy

Similar Messages

  • Duplicate Vendor ref no in A/P Invoice

    Dear Experts,
    Kindly suggest the SP Notification to block the duplicate Vendor ref no in A/P Invoice for a Vendor Specific.
    SAP has this setting to Block duplicate Vendor ref no in Document setting, but it is for all vendor for same ref no. and not  vendor specific. 
    Regards,
    Datta kharat

    Hi Datta...........
    Please try this........
    IF (@object_type = '18' AND @transaction_type IN ('A','U'))
    BEGIN
    DECLARE @VendorRefNo AS VarChar (20)
    DECLARE @BPCode AS VarChar (20)
    SELECT @VendorRefNo = NumAtCard FROM dbo.OPCH
         WHERE DocEntry = @list_of_cols_val_tab_del
    SELECT @BPCode = CardCode FROM dbo.OPCH
         WHERE DocEntry = @list_of_cols_val_tab_del
    IF 1 != (SELECT COUNT(DocEntry) FROM OPCH WITH(NOLOCK) WHERE NumAtCard = @VendorRefNo AND CardCode = @BPCode) AND (@VendorRefNo IS NOT NULL OR @VendorRefNo <> '')
    BEGIN
    SELECT @ERROR = 1
    SELECT @ERROR_MESSAGE = 'Vendor Reference No. Already Exist'
    END
    end
    Or check this.....
    Blocking A/P Invoice
    Regards,
    Rahul

  • Duplicate Vendor Ref. No.

    Dear Experts,
    Is there a way restrict the "Vendor Ref. No." field on the A/P Invoice screen so that the same invoice number from a vendor is not duplicated?
    In other words, we want to keep from paying a duplicate invoice.
    Any suggestiions?
    Also,  if any of you have a client with heavy B1 A/P processing, please let me know.  I would like to speak with you, especially if you moved a client off batch processing.
    Thanks.
    John

    Dear Jane,
    Try this modified Stored Procedure for A/P Invoice in Test Database and then Proceed,
    I checked in my database, found working well.
    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, @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
    Regards,
    Bala
    Edited by: Balakumar Viswa on Sep 16, 2009 1:03 PM
    Edited by: Balakumar Viswa on Sep 21, 2009 10:07 AM

  • 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

    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

  • Duplicate vendor creation blocking in XK01 Transaction

    Hi all,
    I want to block the duplicate vendor creation in the vendor creation transaction
    XK01.If any solution kindly reply to this message.
    Jyoti

    hI
    So u can use the exit EXIT_SAPMF02D_001, here insert the code you need to check the duplicate vendor.
    Perhaps the problem you can have is this exit is triggered at the end only.
    U can try to use the BTE 1360 (it's to check the account group), but I believe here those fields are not filled yet.
    Max

  • How do i check ensure that SAP checks for duplicate vendor invoice numbers?

    Hi Experts -
    How do I verify that SAP checks for duplicate vendor invoice numbers and blocks duplicate invoices from being paid?
    Thanks!

    Hi
    Pls chek the settigs by following the path
    IMG>Materials Management>Logistics Invoice Verification>Incoming Invoice>Set Check for Duplicate Invoice.
    Here you make the settings for creating a duplicate invoice check.
    Moreever, in the vendor master, you need to tick the check box for duplicate invoice check.
    I suggest you search the Forums before posting a query. There are lots of postings on this issue.
    Thanks & regards
    Sanil K Bhandari

  • I want to remove duplicate vendor number

    I want to remove duplicate vendor number,  should I put deletion flag or block them ?
    Also in some cases there are some dependancies (open PO, pending invoice, payment due), can somebody suggest safe way ?

    I would recommend to set both indicators.
    Block will restrict the usage, while deletion indicator makes the vendor going to the archive file/removing it from the table with the next archiving run.
    You have to decide what you want to do with the open business cases.
    You either convert them to the correct vendor directly, or you finish it during the next month with standard business process.
    Blocking of vendor master may have some impact to open business cases.

  • SP Transaction on the Vendor Ref. No. of AP Invoice

    please give me a stored procedure code which will block an empty Vendor Ref. No field while posting an AP Invoice.
    Thanx.
    Antony

    Try this one:
    IF @transaction_type IN ('A','U') AND @object_type = '18'
    BEGIN
    IF EXISTS (SELECT DocNum FROM OPCH T0 WHERE T0.NumAtCard is Null AND T0.DOCENTRY = @list_of_cols_val_tab_del)
    BEGIN
    SELECT @Error = 1, @error_message = 'Vendor Ref. No. can not be empty'
    END
    END
    Thanks,
    Gordon

  • Duplicate vendor reference no - GRPO

    Hi all,
    This is issue with client, when they try to add grpo with vendor reference no
    it shows error message  "duplicate vendor reference number" eventhough
    vendor reference number is same with created grpo, grpo that was added
    for a different vendor,grpo no and date.
    In document settings we checked the option blocked when duplicate
    vendor reference number occurs.
    How to solve this problem ?
    Thanks,
    With regards,
    A.Jeyakanthan

    Hello,
    I tried to use same vendor reference no. to different vendor and it works well in SAP B1 2005A SP 01 PL 34. What version do you use ? in my SAP B1, I can't see the check box
    blocked when duplicate vendor reference number. try to use this query :
    select t0.cardcode, t0.numatcard from OPOR t0 inner join OPDN t1 on t1.docentry = t0.docentry
    If problem still persists, you could look for sap notes and/or escalate it to SAP support
    Rgds,
    JM

  • Aging Report with Customer/Vendor Ref. No. should allow backdate

    Aging Reports for Suppliers and Customers.
    The current printing of the aging reports using Sales Document tab or the Purchase Document tab does not tie with the GL balances when the dates are backdated. It is important that the detail aging report to show the customer/ vendor ref. no.
    There are times when urgent outgoing/ incoming payment are entered into the system for the current period when the vendor detail aging reports or the customer statement with the customer/ vendor ref. no is not ready to be printed for the previous period.
    By allow backdating, it gives the users much needed flexibility in creating the transactions into SAP Business One without having to wait till all the previous month financial reporting is finalized. This is especially important during the financial year end.
    Current Workaround: None.

    Hello,
    Thank you for your input. The limitation is solved in 2007 A / 2007 B version as a part of new Internal Reconciliation concept.
    Regards,
    Peter Dominik
    Solution Manager
    B1 Product Definition Team

  • Vendor ref. no. not appearing in print preview of vendor aging report

    Dear all,
    Vendor reference number is not appearing in print preview of vendor ageing report,we have
    customized template AGE3 collection report,we have taken print outs before a month,vendor
    reference number get printed in report,now it is not appearing
    What could be problem ?
    Any one faces this issue ?
    We are using SAP Business One 2005 B (7.40.252)  SP: 00  PL: 41.
    Latest patch upgrade to PL:46 will solve the issue ?
    Jeyakanthan

    hi all,
    Thru a workaround i brought up vendor reference number in print preview/print,
    Applied formatted search in  journal remarks of ap invoice thru query
    SELECT $[OPCH.NumAtCard]
    ,this will populate vendor ref. no in journal remarks
    which can be displayed in details in aging report.
    Is there any solution other than above to bring vendor reference number in print ?
    Jeyakanthan

  • Validation Check - Duplicate vendor Invoices

    Hi,
    We have a situation where the Duplicate Vendor Invoices have been entered by the users, bearing the same date and reference nos. as the original ones. When we checked we observed that, the system gives the warning message, but the same is ignored by the users. To prevent the same from happening again, we want to convert the warning message into the error message.
    Could any one guide as to how can we set up the validation checks, such that the system would throw an error message. In the vendor masters, we have set up the check for Duplicate Invoices.
    Thanks in advance.
    Best Regards,

    Hi,
    If you already know the message number, then go to T.code:OBA5 or
    T.code:SE91 (if its an custom message class) and change the message from waring to Error.
    If you are not aware of Message, and try to post a duplicate invoice & when the warning message comes, double click on the same, it will give you the message number.
    This will resolve your issue.
    Please let me know the result of the same
    Thanks
    Kalyan

  • Error when blocking a vendor in source list

    We are trying to block a vendor from the Source list (Tcode ME01), however this vendor was created in a different system and imported into our current system.
    The error message we receive states "Source list record created in a different system".  We are unable to save the change, so it is not a warning message, but an error.
    Any help would be appreciated.
    Thank you

    your source list records get created in a central system. if you delete an entry you create inconsistencies to your central system (and you may get this record back soon undeleted).
    Contact the guys who create the source list in this different system and let they maintain the block and distribute it to your system again with ALE.

  • Vendor Ref. Number from A/P Invoice & Credit Memo in the Check PLD Form

    Hi Guys,
    We have standard PLD layout form for the Check Document. In our case the Check Document based on the outgoing payment and outgoing payment referenced on A/P Invoice and Credit Memo documents.
    Is there someone who knows how to get "Vendor Ref. Number" (NumAtCard) field from A/P Invoice and Credit Memo in the Cheque form?
    Any ideas will be appreciated.
    Thanks so much,
    Sergey

    Hi Nagarajan,
    Thanks a lot for your answer! Yes, you are absolutely right, the variable number for this field was #100.
    Unfortunately, this solution worked partially for us. In our case, we also needed to specify a "Document Date" (Tax Date) for the ref. document and there was a problem, because we could not find SAP variable number for this (I don't know if this exists?)
    In the final, I just related "OJDT" to "VPM2" table and after that I have got my "TaxDate" field.
    So we are good now.
    In addition, maybe you know where can I get a variable numbers catalogue or something like that?
    Thanks,
    Sergey

  • A/P Invoice Vendor Ref Number Field updating after adding the Invoice Copy

    Hi All,
                  I am able to change the Vendor Reference number in A/P Invoice Document after adding the Document.  I want to restrict this to happen. Plzz help how to do this????
    Regards,
    Sree.

    1.The Modify Posted A/P Documents authorization refers to some fields only, e.g. the Due Date or Pay to address.
    2. Additional authorization can be defined only for full forms, not for fields.
    3. The SP Joseph suggests will refuse those modifications when the Vendor ref is empty.
    To avoid modifying the Vendor ref you can use this code:
    IF @Object_type = N'18' and @transaction_type = N'U'
    BEGIN
    declare @li int
    set @li=
    (select max(t.LogInstanc)
       from ADOC t
       where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del)
    IF
       (select isnull(t.NumAtCard,'')
        from ADOC t
        where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del
          and t.LogInstanc=@li-1)
    !=(select isnull(t.NumAtCard,'')
       from OPCH t
       where t.DocEntry=@list_of_cols_val_tab_del)
    begin
      Set @error = 10
      Set @error_message = N'Vendor refernce not modifiable !'
    end
    END
    Or if you want to allow modifying an unfilled reference, then this:
    IF @Object_type = N'18' and @transaction_type = N'U'
    BEGIN
    declare @li int
    declare @pref nvarchar(100)
    set @li=
    (select max(t.LogInstanc)
       from ADOC t
       where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del)
    set @pref=
    (select isnull(t.NumAtCard,'')
        from ADOC t
        where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del
          and t.LogInstanc=@li-1)
    If @pref !='' and @pref !=
    (select isnull(t.NumAtCard,'')
       from OPCH t
       where t.DocEntry=@list_of_cols_val_tab_del)
    begin
      Set @error = 10
      Set @error_message = N'Filled vendor refernce not modifiable !'
    end
    END

Maybe you are looking for