R47131
Batch UBEEDI Inbound Purchase Order Change Edit/Update — the batch processor that applies customer order changes (X12 860) to existing sales orders, comparing staged change records against the open order before updating it
Rows written by R47131 carry …PID = 'R47131' in their audit columns — a ready-made marker for isolating the records this program produced. See the audit-columns guide →
Change-only counterpart to R47011 — it never creates new orders; it applies inbound 860 changes to the sales order F4201/F4211.
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.
-- ============================================================
-- Program: R47131 EDI Inbound Purchase Order Change Edit/Update — the batch processor that applies customer order changes (X12 860) to existing sales orders, comparing staged change records against the open order before updating it
-- Purpose: EDI Inbound Purchase Order Change Edit/Update — the batch processor that applies customer order changes (X12 860) to existing sales orders, comparing staged change records against the open order before updating it — auto-generated boilerplate from program-table-map
-- Grain : F4201 × F4211 — 1:N joins yield one row per detail line
-- Tables : 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.SHKCOO AS "Order key company - disambiguates order numbers across companies",
h.SHDOCO AS "Order number",
h.SHDCTO 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>.f4201 h
LEFT JOIN <catalog>.<schema_data>.f4211 d
ON d.SDDOCO = h.SHDOCO
AND d.SDKCOO = h.SHKCOO
AND d.SDDCTO = h.SHDCTO
WHERE
h.SHKCOO = '<KCOO>'
AND h.SHDOCO = <DOCO>
AND h.SHDCTO = '<DCTO>'
ORDER BY h.SHKCOO;5 parameters not filled: <catalog>, <schema_data>, <KCOO>, <DOCO>, <DCTO>
Tables Used by This Program
How these tables connect. Nodes are clickable.