JDE Reference
P4314
InteractiveVoucher Match — match supplier invoices to purchase order receipts (two- or three-way match) to create A/P vouchers
Lineage hook
Rows written by P4314 carry …PID = 'P4314' in their audit columns — a ready-made marker for isolating the records this program produced. See the audit-columns guide →
Boilerplate SQL
Databricks SQLStarting point for querying the tables behind this program. Set your Unity Catalog location and filter values below — they’re substituted into the SQL and the copy button.
Query parameters
-- ============================================================
-- Program: P4314 Voucher Match — match supplier invoices to purchase order receipts (two- or three-way match) to create A/P vouchers
-- Purpose: Voucher Match — match supplier invoices to purchase order receipts (two- or three-way match) to create A/P vouchers — auto-generated boilerplate from program-table-map
-- Grain : F43121 × F4311, F0911, F0401 — 1:N joins yield one row per detail line
-- Tables : F43121, F4311, F0911, F0401
-- Notes : Auto-generated skeleton. Julian dates are converted to DATE and implied-decimal amounts are scaled (verify decimals in F9210). Audit columns (…USER/…PID/…UPMJ) are omitted — see the quirks guide. Set catalog/schema to your Unity Catalog location; fill remaining placeholders (<...>) for your tenant.
-- ============================================================
SELECT
h.PRMATC AS "Match record type - separates receipt rows from voucher-match rows",
h.PRDOCO AS "Order number",
h.PRDCTO AS "Order document type (e.g. OP purchase order, SO sales order)",
h.PRKCOO AS "Company that owns the order-number sequence; part of the composite order key",
h.PRSFXO AS "Order suffix distinguishing multiple documents under one order number",
h.PRLNID / POWER(10, 3) AS "Order line number (3 implied decimals, e.g. 1.000)", -- implied decimals: 3 (verify in F9210)
h.PRNLIN AS "Sequence number of this receipt/match event against the PO line",
h.PRDOC AS "Voucher document number created by the match",
f.GLDCT AS "Document type of the journal entry (JE, PV, RI, etc.).",
f.GLKCO AS "Company that assigned the document number (key company).",
CASE WHEN f.GLDGJ IS NULL OR f.GLDGJ = 0 THEN NULL ELSE DATE_ADD(MAKE_DATE(1900 + CAST(f.GLDGJ AS INT) DIV 1000, 1, 1), CAST(f.GLDGJ AS INT) % 1000 - 1) END AS "G/L date driving the fiscal period the line posts to.", -- CYYDDD Julian → DATE
f.GLJELN AS "Line number within the journal entry.",
f.GLEXTL AS "Line extension code completing the unique key.",
f.GLLT AS "Ledger type the line belongs to (AA actual, CA foreign currency, etc.).",
f0.A6AN8 AS "Supplier address book number - joins to F0101"
FROM <catalog>.<schema_data>.f43121 h
LEFT JOIN <catalog>.<schema_data>.f4311 d
ON d.PDDOCO = h.PRDOCO
AND d.PDKCOO = h.PRKCOO
AND d.PDDCTO = h.PRDCTO
AND d.PDSFXO = h.PRSFXO
AND d.PDLNID = h.PRLNID
LEFT JOIN <catalog>.<schema_data>.f0911 f
ON f.GLDOC = h.PRDOC
LEFT JOIN <catalog>.<schema_data>.f0401 f0
ON 1 = 1 -- TODO: define join condition (no shared aliases detected)
WHERE
h.PRDOCO = <DOCO>
AND h.PRDCTO = '<DCTO>'
AND h.PRKCOO = '<KCOO>'
ORDER BY h.PRDOCO;5 parameters not filled: <catalog>, <schema_data>, <DOCO>, <DCTO>, <KCOO>
Tables Used by This Program
How these tables connect. Nodes are clickable.
Secondary tables
- F0401Supplier master - A/P defaults, payment controls, and purchasing settings for each supplier address numberRead accessmaster
- F0911General ledger transaction detail: every journal entry line with its account, G/L date, amount, batch, subledger, and source-document references.Write accesstransaction
- F4311Purchase order detail - one row per PO line with item, branch, quantities, unit/extended costs, and the status flowRead/write accesstransaction