Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

System Message 6909 - Another process has already added the item


Symptoms

While releasing an Accounts Receivable invoice batch, the batch suspends with system message 6909. The ardebug will give the following error message:
Violation of PRIMARY KEY constraint 'HistDocSlsTax0'. Cannot insert duplicate key in object 'HistDocSlsTax'.

↑ Back to the top


Cause

There is another invoice in the ardoc table with the same reference number as one of the invoices in this batch. The result is that Solomon is trying to insert a duplicate record in the HistDocSlsTax table.

↑ Back to the top


Workaround

To work around this problem, follow these steps:
  1. Find the duplicated records. To do this, run the following SQL statement:
    select refnbr, doctype, batnbr, * from ardoc tablea 
    where doctype='IN' and refnbr IN
    (select refnbr from ardoc tableb where doctype='IN' and tablea.refnbr=tableb.refnbr
    and tablea.tstamp<>tableb.tstamp and (tablea.batnbr='<XXXXXX>' OR tableb.batnbr='<XXXXXX>'))
    order by refnbr, batnbr
    Note <XXXXXX> is a placeholder for the suspended batch number.

    This script will return the ardoc record of the two (or more) invoices with the same reference number.
  2. Update the invoice in the suspended batch to something slightly different, such as by adding an "A" to the end. Here is an example of the necessary update statements:
    update ardoc set refnbr='01013A' where refnbr='010130' and batnbr='<XXXXXX>'
    update artran set refnbr='01013A' where refnbr='010130' and batnbr='<XXXXXX>'

↑ Back to the top


More Information

When you select a new reference number, make sure that the new reference number has not been already used. Also try to keep the invoice number the same length as the other reference numbers.

↑ Back to the top


Keywords: kbmbspartner, kbexpertisebeginner, kbtshoot, kbmbsmigrate, kbprb, kbexpertiseinter, kb

↑ Back to the top

Article Info
Article ID : 891323
Revision : 4
Created on : 6/21/2017
Published on : 6/21/2017
Exists online : False
Views : 125