M3 Reference
OIS180
InteractiveCustomer order invoice print — invoices delivered orders into ODHEAD/ODLINE, and where the invoice date and the accounting date part ways in order-to-cash
Tables vs APIs
This program works over the tables below. For analytics at scale, land the raw tables — the SQL further down reads them directly, joined on their keys and CONO. When to land tables vs call MI APIs
Boilerplate SQL
Databricks SQLStarting point for reading the tables behind OIS180 from landed data — the backing tables joined on their keys and CONO. Set your Unity Catalog location, company, and filter values below.
Query parameters
3 parameters not filled: <catalog>, <schema>, <company>
-- ============================================================
-- Program: OIS180 — Customer order invoice print — invoices delivered orders into ODHEAD/ODLINE, and where the invoice date and the accounting date part ways in order-to-cash
-- Purpose: Read the tables behind program OIS180 — auto-generated from program-table-map
-- Grain : ODHEAD × ODLINE — 1:N joins yield one row per line
-- Tables : ODHEAD, ODLINE
-- Notes : Auto-generated skeleton for a prefixed physical M3 schema or a landing schema normalized to the prefixed names in this catalog. Raw Data Lake property names vary with the published object: map them through Data Catalog before running this SQL. Dates are numeric YYYYMMDD (0 = none, mapped to NULL); all curated status values are decoded inline; company-partitioned tables are joined on CONO to prevent cross-company fan-out. Audit columns (RGDT/RGTM/LMDT/CHNO/CHID) omitted — see the quirks guide.
-- ============================================================
SELECT
h.UACONO AS "Company",
h.UAORNO AS "Customer order number",
h.UADLIX AS "Delivery index the invoiced delivery corresponds to",
h.UATEPY AS "Payment terms — part of the key, so one delivery can settle under more than one term",
h.UACUNO AS "Customer the delivery was made to",
h.UACUCD AS "Invoice currency",
o.UBPONR AS "Order line number",
o.UBPOSX AS "Line suffix",
o.UBITNO AS "Item invoiced",
o.UBIVQT AS "Invoiced quantity on this delivery line"
FROM <catalog>.<schema>.ODHEAD h
LEFT JOIN <catalog>.<schema>.ODLINE o
ON o.UBORNO = h.UAORNO
AND o.UBDLIX = h.UADLIX
AND o.UBTEPY = h.UATEPY
AND o.UBCONO = h.UACONO
WHERE
h.UACONO = <company>
ORDER BY h.UAORNO;Backing Tables
How these tables connect — join details in the list below.