Skip to content
JDE Reference

P4112

Interactive

Inventory Issues — remove inventory from stock (for example to scrap or expense) with matching journal entries

Lineage hook

Rows written by P4112 carry …PID = 'P4112' 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: P4112 Inventory Issues — remove inventory from stock (for example to scrap or expense) with matching journal entries
-- Purpose: Inventory Issues — remove inventory from stock (for example to scrap or expense) with matching journal entries — auto-generated boilerplate from program-table-map
-- Grain  : F4111 × F41021, F0911, F4102, F4105 — 1:N joins yield one row per detail line
-- Tables : F4111, F41021, F0911, F4102, F4105
-- 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
  il.ILUKID AS "Unique key ID - the system-assigned surrogate key",
  loc.LIITM AS "Short item number - the internal numeric item key",
  TRIM(loc.LIMCU) AS "Business unit / branch plant (right-justified, space-padded to 12)",
  loc.LILOCN AS "Storage location within the branch plant",
  loc.LILOTN AS "Lot or serial number",
  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.).",
  ib.IBITM AS "Short item number - the internal numeric item key",
  TRIM(ib.IBMCU) AS "Business unit / branch plant (right-justified, space-padded to 12)",
  f4.COITM AS "Short internal item number (8-digit numeric key).",
  TRIM(f4.COMCU) AS "Branch/plant (business unit); stored right-justified with leading blanks.",
  f4.COLOCN AS "Storage location within the branch, formatted per the branch location structure.",
  f4.COLOTN AS "Lot or serial number identifying the specific lot of stock.",
  f4.COLEDG AS "Cost method code (e.g. 01 last-in, 02 weighted average, 07 standard) selecting which cost applies."
FROM <catalog>.<schema_data>.f4111 il
LEFT JOIN <catalog>.<schema_data>.f41021 loc
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
LEFT JOIN <catalog>.<schema_data>.f0911 f
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
LEFT JOIN <catalog>.<schema_data>.f4102 ib
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
LEFT JOIN <catalog>.<schema_data>.f4105 f4
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
ORDER BY il.ILUKID;

2 parameters not filled: <catalog>, <schema_data>

Tables Used by This Program

How these tables connect. Nodes are clickable.

Join details

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