Skip to content
JDE Reference

R47011

Batch UBE

EDI Inbound Purchase Order Edit/Create — the batch processor that turns customer purchase orders (X12 850) staged in the EDI interface tables into sales orders, with an audit report and Work Center errors for failed documents

Lineage hook

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

Notes

Sets the EDI Successfully Processed flag (EDSP) so staged documents are not reprocessed.

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: R47011 EDI Inbound Purchase Order Edit/Create — the batch processor that turns customer purchase orders (X12 850) staged in the EDI interface tables into sales orders, with an audit report and Work Center errors for failed documents
-- Purpose: EDI Inbound Purchase Order Edit/Create — the batch processor that turns customer purchase orders (X12 850) staged in the EDI interface tables into sales orders, with an audit report and Work Center errors for failed documents — auto-generated boilerplate from program-table-map
-- Grain  : F47011 × F47012, F4201, F4211 — 1:N joins yield one row per detail line
-- Tables : F47011, F47012, F4201, F4211
-- 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.SYEKCO AS "Key company that scopes the EDI document number; part of the staging primary key.",
  h.SYEDOC AS "EDI document number assigned when the transaction is staged; the primary handle for one staged EDI document.",
  h.SYEDCT AS "EDI document type qualifier; pairs with document number and key company to complete the staging key.",
  f.SZEDLN / POWER(10, 3) AS "EDI line number within the document; three implied decimals, so line 1.000 is stored as 1000.",  -- implied decimals: 3 (verify in F9210)
  f4.SHKCOO AS "Order key company - disambiguates order numbers across companies",
  f4.SHDOCO AS "Order number",
  f4.SHDCTO AS "Order type code (SO, ST, CO, ...)",
  d.SDKCOO AS "Order key company - disambiguates order numbers across companies",
  d.SDDOCO AS "Order number",
  d.SDDCTO AS "Order type code (SO, ST, CO, ...)",
  d.SDLNID / POWER(10, 3) AS "Order line number, stored x1000 (3 implied decimals)"  -- implied decimals: 3 (verify in F9210)
FROM <catalog>.<schema_data>.f47011 h
LEFT JOIN <catalog>.<schema_data>.f47012 f
  ON f.SZEDOC = h.SYEDOC
 AND f.SZEKCO = h.SYEKCO
 AND f.SZEDCT = h.SYEDCT
LEFT JOIN <catalog>.<schema_data>.f4201 f4
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
LEFT JOIN <catalog>.<schema_data>.f4211 d
  ON 1 = 1  -- TODO: define join condition (no shared aliases detected)
ORDER BY h.SYEKCO;

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

Tables Used by This Program

How these tables connect. Nodes are clickable.

Join details

  • F4201F4211header detail · 1:N
    ON f4201.SHDOCO = f4211.SDDOCO
  • F47011F47012header detail · 1:N
    ON f47011.SYEDOC = f47012.SZEDOC
  • F47012F4211foreign key · N:1
    ON f47012.SZDOCO = f4211.SDDOCO