Search Results ap_invoice_selection_criteria




Overview

APPS.AP_XML_INVOICE2_LEVEL_V is a reporting view in the Oracle E-Business Suite Payables module that exposes invoice-level payment information generated during a payment batch or check run. Its name indicates that it is part of the XML invoice publishing infrastructure, where "XML" refers to Oracle Payments / Payables XML output used to generate payment instructions, remittance advice, and check or electronic payment documents. The "LEVEL" construct typically denotes a nested, repeating row structure across check runs, checks, and invoices.

The view consolidates data from invoice selection criteria, the selected-invoice staging table, the selected-check staging table, and the master invoice table. It returns one row per payable invoice associated with a specific check run and selected check, filtered to invoices and checks flagged as OK to pay. In Oracle EBS 12.1.1 and 12.2.2, this view is used by concurrent programs, Oracle XML Publisher templates, and custom extensions that need a flattened, invoice-level projection of the payment batch contents.

Because it joins staging tables rather than only persistent invoice data, the view reflects the state of the payment batch as of the last selection and formatting process. It is not a historical ledger view; results change as payment batches are built, formatted, and confirmed.

Underlying Base Objects

The ETRM metadata documents four referenced base objects, all accessed through APPS synonyms:

  • AP_INVOICES — the master Payables invoice table holding currency, voucher, tax, and type attributes.
  • AP_INVOICE_SELECTION_CRITERIA — stores criteria and checkrun identifiers used when a payment batch is defined.
  • AP_SELECTED_INVOICES — the staging table capturing invoices selected for payment, including amounts paid, discounts, and pay/print check identifiers.
  • AP_SELECTED_INVOICE_CHECKS — the staging table for checks produced by a run, including checkrun name and the OK to pay flag.

The join keys link the three staging tables on CHECKRUN_NAME, tie AP_SELECTED_INVOICES.PAY_SELECTED_CHECK_ID and PRINT_SELECTED_CHECK_ID to AP_SELECTED_INVOICE_CHECKS.SELECTED_CHECK_ID, and connect AP_SELECTED_INVOICES.INVOICE_ID to AP_INVOICES.INVOICE_ID. Rows are restricted to OK_TO_PAY_FLAG values of 'Y' or 'F' on both the selected invoice and selected check records.

Key Columns

Common Use Cases and Queries

This view is typically queried to reconcile the invoices included in a payment batch, to feed payment or remittance XML, or to build custom reports. A representative query follows:

  • SELECT invoice_num, invoice_amount, amount_paid, amount_remaining, proposed_payment_amount, checkrun_name, payment_num FROM ap_xml_invoice2_level_v WHERE checkrun_name = :p_checkrun_name ORDER BY payment_num;

Additional scenarios include joining to AP_CHECKS_V for check-number detail, or filtering by invoice_date and due_date for aged disbursement reporting. Because the source includes only staged records for current batches, queries should be scoped by CHECKRUN_NAME or CHECKRUN_ID to avoid mixing results from concurrent processes.