R47131
Batch UBEEDI Inbound Purchase Order Change Edit/Update — the batch processor that compares staged customer order changes (X12 860) against the open sales order, prints the discrepancy report, and advances or holds the order per its processing options; the change itself is applied in Sales Order Entry (P4210)
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, and it does not update the order lines either: it flags, status-advances, or holds the matched F4201/F4211 order, and a person applies the 860 changes in Sales Order Entry (P4210).
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.
5 parameters not filled: <catalog>, <schema_data>, <KCOO>, <DOCO>, <DCTO>
-- ============================================================
-- Program: R47131 EDI Inbound Purchase Order Change Edit/Update — the batch processor that compares staged customer order changes (X12 860) against the open sales order, prints the discrepancy report, and advances or holds the order per its processing options; the change itself is applied in Sales Order Entry (P4210)
-- Purpose: EDI Inbound Purchase Order Change Edit/Update — the batch processor that compares staged customer order changes (X12 860) against the open sales order, prints the discrepancy report, and advances or holds the order per its processing options; the change itself is applied in Sales Order Entry (P4210) — 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;Tables Used by This Program
How these tables connect — join details in the list below.
R read · W write · R/W read + write