R47032
Batch UBEEDI Advance Ship Notice Extraction — the batch job that extracts confirmed shipment data into the outbound 856 staging tables, writing one header row per shipment at the top hierarchy break plus the hierarchy lines beneath it
Rows written by R47032 carry …PID = 'R47032' in their audit columns — a ready-made marker for isolating the records this program produced. See the audit-columns guide
Writes the F47036 header and F47037 hierarchy lines; its processing options control the shipment-order-pack-item hierarchy the 856 carries.
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.
2 parameters not filled: <catalog>, <schema_data>
-- ============================================================
-- Program: R47032 EDI Advance Ship Notice Extraction — the batch job that extracts confirmed shipment data into the outbound 856 staging tables, writing one header row per shipment at the top hierarchy break plus the hierarchy lines beneath it
-- Purpose: EDI Advance Ship Notice Extraction — the batch job that extracts confirmed shipment data into the outbound 856 staging tables, writing one header row per shipment at the top hierarchy break plus the hierarchy lines beneath it — auto-generated boilerplate from program-table-map
-- Grain : F47036 × F47037, F4215, F4211 — 1:N joins yield one row per detail line
-- Tables : F47036, F47037, F4215, 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.XHSHPN AS "Shipment number - the system-assigned key that groups order lines for transport; the same value lands on F4211.SDSHPN.",
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>.f47036 h
LEFT JOIN <catalog>.<schema_data>.f47037 f
ON f.SZEDOC = h.SYEDOC
AND f.SZEKCO = h.SYEKCO
AND f.SZEDCT = h.SYEDCT
LEFT JOIN <catalog>.<schema_data>.f4215 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;Tables Used by This Program
How these tables connect — join details in the list below.
R read · W write · R/W read + write
Primary tables
- F47036One row per outbound advance ship notice (X12 856) at the shipment level, written by the R47032 extraction at the top hierarchy break.Write accesstransaction
- F47037One row per hierarchy line of an outbound 856 (order, pack, or item level) under a shipment header; sales-order lines plus SSCC/UPC pack identifiers.Write accesstransaction
Secondary tables
- F4211Sales order detail — one row per order line; the core sales transaction tableRead accesstransaction
- F4215One row per shipment - the anchor record Transportation Management creates when order lines are grouped for delivery; despite the F42xx name it belongs to system 49. Carries status, mode, geography, weight, value, and promised dates.Read accesstransaction