My Oracle Support Banner

R12: AP: Error "ORA-00001: unique constraint (AP.AP_INVOICE_DISTRIBUTIONS_U2) violated" While Trying to Create New Invoice Matched to a Receipt. (Doc ID 3066142.1)

Last updated on MARCH 24, 2025

Applies to:

Oracle Payables - Version 12.1.3 and later
Information in this document applies to any platform.

Symptoms

Unable to create new invoice matched to a Receipt.

The following error raises upon selecting the PO Receipt and matching:

APP-SQLAP-10000: ORA-00001: unique constraint
(AP.AP_INVOICE_DISTRIBUTIONS_U2) violated occurred in
Insert_Invoice_Distributions <-
with parameters (Batch_Id = , Invoice_id = 724590, Invoice
Line Number = 1, Dist_num = 1, Allow_PA_Override = ,
Transfer_Desc_Flag = Y)
while performing the following operation:
Insert Invoice Distribution

FND Debug Log of the issue reproduced shows the following:

MODULE                                                        MESSAGE_TEXT
------------------------------------------------------------- ------------------------------------------------------------------------------------------------
...
... 
per.resource.HRKPI.hr_kpi_extlib.event                        #event_name#WHEN-VALIDATE-RECORD*formname*APXINWKB
per.resource.HRKPI.hr_kpi_extlib.event                        end
AP.PLSQL.AP_ACCOUNTING_EVENT_PKG.update_invoice_events_status Begin of procedure update_invoice_events_status
fnd.resource.FNDSQF.FND_FUNCTION.EXECUTE.start                "Executing function: AP_APXRMTCH open_flag: Y session_flag: Y other_params: 
                                                              INVOICE_ID=""724584"" QUICK_PO_ID=""644008"" INVWKB_FORM_ID=""3"" ALLOW_DIST_MATCH_FLAG=""Y""
                                                              APXINWKB_ORG_ID=""84"" activate_flag: ACTIVATE browser_target: "
fnd.src.osd.affile.affcuspath.start                           Constructing filepath. Appl=SQLAP, name=APXRMTCH, type_name=FORM, write_flag=0
fnd.src.osd.affile.affcuspath.end                             /u01/install/APPS/apps/apps_st/appl/ap/12.0.0/forms/US/APXRMTCH.fmx
fnd.plsql.MO_GLOBAL.INIT.begin                                Calling PL/SQL procedure MO_GLOBAL.INIT
...
...
per.resource.HRKPI.hr_kpi_extlib.event                        #event_name#WHEN-VALIDATE-RECORD*formname*APXRMTCH
per.resource.HRKPI.hr_kpi_extlib.event                        end
AP.PLSQL.AP_RECT_MATCH_PKG.Base_Credit_RCV_Match              AP_RECT_MATCH_PKG.Base_Credit_Rcv_Match(+)
AP.PLSQL.AP_RECT_MATCH_PKG.Base_Credit_RCV_Match              Get Invoice and System Options information
AP.PLSQL.AP_RECT_MATCH_PKG.Get_Info                           AP_RECT_MATCH_PKG.Get_Info(+)
AP.PLSQL.AP_RECT_MATCH_PKG.Get_Info                           select period for accounting date
AP.PLSQL.AP_UTILITIES_PKGGet_Current_Gl_Date                  Begining of Function
AP.PLSQL.AP_UTILITIES_PKGGet_Current_Gl_Date                  Index Value: 25-NOV-2024-84
AP.PLSQL.AP_UTILITIES_PKGGet_Current_Gl_Date                  Period Name from existing plsql table for index not found: NOV-24
po.plsql.PO_LOG.REFRESH_LOG_FLAGS.END                         End of subprogram.
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.BEGIN   p_api_version = 1
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.BEGIN   p_line_location_id_tbl.COUNT = 1
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.BEGIN   p_line_location_id_tbl(1) = 756840
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.BEGIN   p_line_loc_match_amt_tbl.COUNT = 1
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.BEGIN   p_line_loc_match_amt_tbl(1) = 11938.08
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.END     x_return_status = S
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.END     x_amount_to_retain_tbl.COUNT = 1
po.plsql.PO_AP_INVOICE_MATCH_GRP.GET_AMOUNT_TO_RETAIN.END     x_amount_to_retain_tbl(1) is null
AP.PLSQL.AP_RECT_MATCH_PKG.Base_Credit_RCV_Match              Get PO information
AP.PLSQL.AP_ETAX_UTILITY_PKG.Get_PO_Info                      AP_ETAX_UTILITY_PKG.Get_PO_Info<-AP_MATCHING_PKG.base_credit_rcv_match<-APXRMTCH
AP.PLSQL.AP_ETAX_UTILITY_PKG.Get_PO_Info                      Step 1: Get PO additional info
AP.PLSQL.AP_ETAX_UTILITY_PKG.Get_PO_Info                      Step 1.1: PO additional info 84 & 63840 & 644008 &3.775 & & PC
AP.PLSQL.AP_ETAX_UTILITY_PKG.Get_PO_Info                      Step 2: Product Org Id 89
AP.PLSQL.AP_ETAX_UTILITY_PKG.Get_PO_Info                      Step 3: l_doc_type PO
...
...
AP.PLSQL.AP_RECT_MATCH_PKG.Base_Credit_RCV_Match              Create Matched Invoice Line
AP.PLSQL.AP_RECT_MATCH_PKG.Insert_Invoice_line                Inserting Item Line Matched to a RCV
AP.PLSQL.AP_RECT_MATCH_PKG.Base_Credit_RCV_Match              Create Matched Invoice Distributions
AP.PLSQL.AP_RECT_MATCH_PKG.Insert Invoice Distributions       Insert Invoice Distributions
fnd.plsql.APP_EXCEPTION.RAISE_EXCEPTION.dict_auto_log         "APP-SQLAP-10000: ORA-00001: unique constraint (AP.AP_INVOICE_DISTRIBUTIONS_U2) violated occurred in
                                                              Insert_Invoice_Distributions <-
                                                              with parameters (Batch_Id = , Invoice_id = 724584, Invoice Line Number = 1, Dist_num = 1, Allow_PA_Override = , Transfer_Desc_Flag = Y)
                                                              while performing the following operation:
                                                              Insert Invoice Distributions"
...
...


Steps to reproduce:

  1. Navigate to Payables Responsibility
  2. Open the Invoice Workbench
    (N) Invoices > Entry > Invoice
  3. Create invoice with Matching to Receipt
  4. You get the error when selecting the Receipt to match to.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.