Skip to content
JDE Reference

P4105

Interactive

Cost Revisions — maintain item costs by cost method and branch/plant, generating variance journal entries on change

Lineage hook

Rows written by P4105 carry …PID = 'P4105' in their audit columns — a ready-made marker for isolating the records this program produced. See the audit-columns guide →

Boilerplate SQL

Databricks SQL

Starting 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: P4105 Cost Revisions — maintain item costs by cost method and branch/plant, generating variance journal entries on change
-- Purpose: Cost Revisions — maintain item costs by cost method and branch/plant, generating variance journal entries on change — auto-generated boilerplate from program-table-map
-- Grain  : F4105 × F4101, F4102, F0911 — 1:N joins yield one row per detail line
-- Tables : F4105, F4101, F4102, F0911
-- 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.COITM AS "Short internal item number (8-digit numeric key).",
  TRIM(h.COMCU) AS "Branch/plant (business unit); stored right-justified with leading blanks.",
  h.COLOCN AS "Storage location within the branch, formatted per the branch location structure.",
  h.COLOTN AS "Lot or serial number identifying the specific lot of stock.",
  h.COLEDG AS "Cost method code (e.g. 01 last-in, 02 weighted average, 07 standard) selecting which cost applies.",
  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>.f4105 h
LEFT JOIN <catalog>.<schema_data>.f4101 im
  ON im.IMITM = h.COITM
LEFT JOIN <catalog>.<schema_data>.f4102 ib
  ON ib.IBITM = h.COITM
 AND ib.IBMCU = h.COMCU
LEFT JOIN <catalog>.<schema_data>.f0911 f
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
WHERE
  h.COITM = <ITM>
  AND h.COMCU = '<MCU>'
ORDER BY h.COITM;

4 parameters not filled: <catalog>, <schema_data>, <ITM>, <MCU>

Tables Used by This Program

How these tables connect. Nodes are clickable.

Join details

  • F4102F4101foreign key · N:1
    ON f4102.IBITM = f4101.IMITM
  • F4105F4102foreign key · N:1
    ON f4105.COITM = f4102.IBITM