Introduction:
Oracle Payables – Version 12.1.3 and later
Information in this document applies to any platform.
Cause of the issue:
Payables Interface program is not creating invoices and it is rejecting invoices with below error code.
ZX_SOURCE_DOC_MISSING
No error code displayed on program output or in log file.
Payables invoice lines exists in AP interface are missing in Source Transaction (AR Invoice), when program tried to create AP invoice it searches for referenced source line and as it was missing in source transaction, it is rejecting invoice with error code.
Use below query to find rejected invoices details
SELECT apr.*
FROM ap_interface_rejections apr,
ap_invoices_interface inv
WHERE apr.parent_id = inv.invoice_id
AND inv.status=’REJECTED’
AND inv.source=’Intercompany’
UNION
SELECT apr.*
FROM ap_interface_rejections apr,
ap_invoices_interface inv,
ap_invoice_lines_interface ln
WHERE apr.parent_id =ln.invoice_line_id
AND ln.invoice_id= inv.invoice_id
AND inv.status=’REJECTED’
AND inv.source=’Intercompany’ ;
How do we solve:
For an Intercompany payables invoice, first the source transaction gets created and respective lines gets interface in AP (AP_INVOICES_INTERFACE, AP_INVOICE_LINES_INTERFACE). Once the lines get interfaced, Run Payables Open Interface Import program to import payables invoices.
AR is the source transaction and the source_trx_id and source_line_id in AP_INVOICE_LINES_INTERFACE are referenced to each payables invoice lines. You can find out the same using below query:
For invoice header,
AP_INVOICES_INTERFACE.REFERENCE_1= RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID
SELECT NVOICE_ID,INVOICE_NUM,INVOICE_AMOUNT,STATUS,SOURCE REFERENCE_1 FROM AP_INVOICES_INTERFACE WHERE INVOICE_NUM=’&invoice_number’;
For invoice Lines,
AP_INVOICE_LINES_INTERFACE.SOURCE_TRX_ID= RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID
AP_INVOICE_LINES_INTERFACE.SOURCE_LINE_ID= RA_CUSTOMER_TRX_LINES_ALL.CUSTOMER_TRX_LINE_ID
SELECT INVOICE_ID ,INVOICE_LINE_ID, LINE_NUMBER, LINE_TYPE_LOOKUP_CODE, AMOUNT, ITEM_DESCRIPTION, TRX_BUSINESS_CATEGORY, SOURCE_APPLICATION_ID, SOURCE_ENTITY_CODE, SOURCE_EVENT_CLASS_CODE, SOURCE_TRX_ID, SOURCE_LINE_ID, SOURCE_TRX_LEVEL_TYPE FROM AP_INVOICE_LINES_INTERFACE WHERE INVOICE_ID = (SELECT INVOICE_ID FROM AP_INVOICES_INTERFACE WHERE INVOICE_NUM=’&invoice_number’);
Every single inter-company payables invoice line is linked or referenced to corresponding AR lines. So while creating transaction if some lines were not created on source side, then, Payables Open Interface Import program will reject invoice with ZX_SOURCE_DOC_MISSING error.
So as to create the AP invoice, source lines(which are referenced) need to be exists AR transaction then run Payables Open Interface Import program to create intercompany AP invoice.
For Example:
AP invoice has 5lines out of which 2lines having the issue, and on AR invoice, there is only 3 invoice lines. Those 2 lines which are giving error in AP invoice creation are missing on AR invoice.
On AP interface, each line is linked to respective source transaction line with source_line_trx_id.
While running Payables interface import program, it validates the lines with respective source lines, if it didn’t find the match then program reject the creation of invoice with ZX_SOURCE_DOC_MISSING error.
Conclusion:
In order to avoid this error, we should create the Intercompany invoices in Correct sequence.
First have to create the Source AR Transactions then have to create the Intercompany AR and AP Invoices.