JDE Reference
R31804
Batch UBEVariance Journal Entries — the batch job that books manufacturing variances (engineering, planned, actual, other) to the G/L when work orders close.
Lineage hook
Rows written by R31804 carry …PID = 'R31804' 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: R31804 Variance Journal Entries — the batch job that books manufacturing variances (engineering, planned, actual, other) to the G/L when work orders close.
-- Purpose: Variance Journal Entries — the batch job that books manufacturing variances (engineering, planned, actual, other) to the G/L when work orders close. — auto-generated boilerplate from program-table-map
-- Grain : F3102 × F0911, F4801 — 1:N joins yield one row per detail line
-- Tables : F3102, F0911, F4801
-- 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.IGDOCO AS "Work order number the cost row belongs to.",
h.IGITM AS "Short item number the costs apply to — the parent on parent rows, the component on child rows.",
h.IGCOST AS "Cost component code (A1 material, B1 labor, C-range overheads, etc.) that this row's buckets belong to.",
h.IGPART AS "Parent/child flag separating the ordered item's cost rows from its components' rows.",
TRIM(h.IGMCU) AS "Work center (business unit) the cost row is attributed to; part of the unique key.",
f.GLDCT AS "Document type of the journal entry (JE, PV, RI, etc.).",
f.GLDOC AS "Document number of the journal entry.",
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.)."
FROM <catalog>.<schema_data>.f3102 h
LEFT JOIN <catalog>.<schema_data>.f0911 f
ON 1 = 1 -- TODO: define join condition (no shared aliases detected)
LEFT JOIN <catalog>.<schema_data>.f4801 f4
ON f4.WADOCO = h.IGDOCO
WHERE
h.IGDOCO = <DOCO>
AND h.IGITM = <ITM>
AND h.IGMCU = '<MCU>'
ORDER BY h.IGDOCO;5 parameters not filled: <catalog>, <schema_data>, <DOCO>, <ITM>, <MCU>
Tables Used by This Program
How these tables connect. Nodes are clickable.
Primary tables
- F0911General ledger transaction detail: every journal entry line with its account, G/L date, amount, batch, subledger, and source-document references.Write accesstransaction
- F3102One row per cost bucket on a work order — keyed by order, item, cost component, parent/child flag, and work center — holding standard, current, planned, actual, completed, and scrapped units and amounts used for manufacturing variance analysis.Read/write accesstransaction