AP_INVOICE_LINES_ALL
Schema: APtransactionOU-striped (ORG_ID)Supplier invoice lines — the R12-new layer between header and distributions, carrying line type, amount, and the purchase-order and receipt matching references
ITEM, TAX, FREIGHT, and MISC lines share the table — filter LINE_TYPE_LOOKUP_CODE before summing spend, and exclude discarded/cancelled lines
New in R12 — 11i had only distributions, a release delta worth knowing when comparing old extracts. No surrogate line id: the key is INVOICE_ID + LINE_NUMBER, and children reference the line by that pair.
What the badges mean
- master
- Data class: what the table holds — master data, transaction documents, control/configuration, interface/staging, or an APPS-schema view.
Header & line
AP_INVOICE_LINES_ALL lines join back to their header AP_INVOICES_ALL — and the org column — so a line never fans out.
Fields
18 fields · 2 key
| # | Field | Description | Type | Flags |
|---|---|---|---|---|
| 1 | INVOICE_ID | The invoice — key together with the line number; no surrogate line id exists | NUMBER | Key |
| 2 | LINE_NUMBER | Line number within the invoice — part of the key | NUMBER | Key |
| 3 | ORG_ID | Operating unit | NUMBER | |
| 4 | LINE_TYPE_LOOKUP_CODE | Item, tax, freight, or miscellaneous line — a lookup code, undecoded; filter before summing spend | VARCHAR2 | |
| 5 | AMOUNT | Line amount | NUMBER | |
| 6 | BASE_AMOUNT | Line amount in the ledger currency | NUMBER | |
| 7 | QUANTITY_INVOICED | Quantity invoiced | NUMBER | |
| 8 | UNIT_PRICE | Unit price | NUMBER | |
| 9 | INVENTORY_ITEM_ID | The item, for item-matched lines | NUMBER | |
| 10 | ITEM_DESCRIPTION | Item description on the line | VARCHAR2 | |
| 11 | PO_HEADER_ID | The matched purchase order | NUMBER | |
| 12 | PO_LINE_ID | The matched PO line | NUMBER | |
| 13 | PO_LINE_LOCATION_ID | The matched PO shipment schedule | NUMBER | |
| 14 | PO_DISTRIBUTION_ID | The matched PO distribution | NUMBER | |
| 15 | RCV_TRANSACTION_ID | The matched receiving transaction — the three-way-match thread | NUMBER | |
| 16 | ACCOUNTING_DATE | The accounting date — the primary analysis date | DATE | Filter date |
| 17 | DISCARDED_FLAG | Y when the line was discarded — exclude from spend | VARCHAR2 | |
| 18 | CANCELLED_FLAG | Y when the line was cancelled | VARCHAR2 |
Field provenance: hand-curated. 2 key fields.
Boilerplate SQL
Starting point for reading AP_INVOICE_LINES_ALLon Databricks — real DATE columns need no conversion, and the org anchor and the LAST_UPDATE_DATE watermark are already in place. Set your Unity Catalog location, schema, and org values below; they’re substituted into the SQL and the copy button.
-- ============================================================
-- Table : AP_INVOICE_LINES_ALL — Supplier invoice lines — the R12-new layer between header and distributions, carrying line type, amount, and the purchase-order and receipt matching references
-- Purpose: Column-selected read of AP_INVOICE_LINES_ALL — auto-generated from field metadata
-- Grain : One row per operating unit (ORG_ID) + INVOICE_ID + LINE_NUMBER
-- Caution: ITEM, TAX, FREIGHT, and MISC lines share the table — filter LINE_TYPE_LOOKUP_CODE before summing spend, and exclude discarded/cancelled lines
-- Notes : Auto-generated skeleton for Oracle EBS R12 data landed in your lakehouse. Dates are real DATE/TIMESTAMP columns — no conversion needed. WHO audit columns omitted (see the quirks guide); the optional LAST_UPDATE_DATE watermark filter supports incremental extracts.
-- ============================================================
SELECT
t.INVOICE_ID AS "The invoice — key together with the line number; no surrogate line id exists",
t.LINE_NUMBER AS "Line number within the invoice — part of the key",
t.ORG_ID AS "Operating unit",
t.LINE_TYPE_LOOKUP_CODE AS "Item, tax, freight, or miscellaneous line — a lookup code, undecoded; filter before summing spend",
t.AMOUNT AS "Line amount",
t.BASE_AMOUNT AS "Line amount in the ledger currency",
t.QUANTITY_INVOICED AS "Quantity invoiced",
t.UNIT_PRICE AS "Unit price",
t.INVENTORY_ITEM_ID AS "The item, for item-matched lines",
t.ITEM_DESCRIPTION AS "Item description on the line",
t.PO_HEADER_ID AS "The matched purchase order",
t.PO_LINE_ID AS "The matched PO line",
t.PO_LINE_LOCATION_ID AS "The matched PO shipment schedule",
t.PO_DISTRIBUTION_ID AS "The matched PO distribution",
t.RCV_TRANSACTION_ID AS "The matched receiving transaction — the three-way-match thread",
t.ACCOUNTING_DATE AS "The accounting date — the primary analysis date",
t.DISCARDED_FLAG AS "Y when the line was discarded — exclude from spend",
t.CANCELLED_FLAG AS "Y when the line was cancelled"
FROM <catalog>.<schema>.AP_INVOICE_LINES_ALL t
WHERE
t.ORG_ID = <operating_unit_id> -- operating unit (MOAC does not filter extracts)
-- AND t.INVOICE_ID = <INVOICE_ID>
-- AND t.LINE_NUMBER = <LINE_NUMBER>
-- AND t.ACCOUNTING_DATE >= DATE '<DATE_FROM>'
-- AND t.ACCOUNTING_DATE <= DATE '<DATE_TO>'
-- AND t.LAST_UPDATE_DATE >= TIMESTAMP '<watermark>' -- WHO watermark, bulk-stamped by batch jobs; see quirks guide #who-columns
ORDER BY t.INVOICE_ID;8 parameters not filled: <catalog>, <schema>, <operating_unit_id>, <INVOICE_ID>, <LINE_NUMBER>, <DATE_FROM>, <DATE_TO>, <watermark>
Relationships
1-hop neighbors — click a table to navigate there. FND lookup decode and translation edges are highlighted; they’re the joins newcomers most often get wrong.
Join details
ON AP_INVOICES_ALL.INVOICE_ID = AP_INVOICE_LINES_ALL.INVOICE_ID AND AP_INVOICES_ALL.ORG_ID = AP_INVOICE_LINES_ALL.ORG_IDON AP_INVOICE_LINES_ALL.PO_HEADER_ID = PO_HEADERS_ALL.PO_HEADER_ID AND AP_INVOICE_LINES_ALL.ORG_ID = PO_HEADERS_ALL.ORG_IDON AP_INVOICE_LINES_ALL.PO_LINE_LOCATION_ID = PO_LINE_LOCATIONS_ALL.LINE_LOCATION_ID AND AP_INVOICE_LINES_ALL.ORG_ID = PO_LINE_LOCATIONS_ALL.ORG_IDON AP_INVOICE_LINES_ALL.RCV_TRANSACTION_ID = RCV_TRANSACTIONS.TRANSACTION_IDON AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_ID = AP_INVOICE_LINES_ALL.INVOICE_ID AND AP_INVOICE_DISTRIBUTIONS_ALL.INVOICE_LINE_NUMBER = AP_INVOICE_LINES_ALL.LINE_NUMBER AND AP_INVOICE_DISTRIBUTIONS_ALL.ORG_ID = AP_INVOICE_LINES_ALL.ORG_ID