R4981
Batch UBEFreight Update and Report — the batch job that finalizes freight after delivery confirmation: writes freight audit history, books payable freight accruals/vouchers, and adds billable freight charges to the customer's order
Rows written by R4981 carry …PID = 'R4981' in their audit columns — a ready-made marker for isolating the records this program produced. See the audit-columns guide
The freight step that moves transportation costs into the G/L and A/P; writes the F4981 audit history.
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: R4981 Freight Update and Report — the batch job that finalizes freight after delivery confirmation: writes freight audit history, books payable freight accruals/vouchers, and adds billable freight charges to the customer's order
-- Purpose: Freight Update and Report — the batch job that finalizes freight after delivery confirmation: writes freight audit history, books payable freight accruals/vouchers, and adds billable freight charges to the customer's order — auto-generated boilerplate from program-table-map
-- Grain : F4981 × F0411 — 1:N joins yield one row per detail line
-- Tables : F4981, F0411
-- 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.
-- Omitted: F4215, F4211, F0911 are cataloged for this program, but no verified join condition connects them to F4981, so they are left out of this skeleton. Add the join yourself using the key fields on each table's page.
-- ============================================================
SELECT
h.FHUK01 AS "Internal unique key - the physical primary key of this table.",
f04.RPKCO AS "Document company that owns the voucher number sequence",
f04.RPDCT AS "Voucher document type (PV standard voucher, PD debit memo, PL logged, etc.)",
f04.RPSFX AS "Pay item — vouchers split into pay items with independent terms and status",
f04.RPSFXE AS "Pay item extension used by prepayments and multi-tax-rate splits"
FROM <catalog>.<schema_data>.f4981 h
LEFT JOIN <catalog>.<schema_data>.f0411 f04
ON f04.RPDOC = h.FHDOC
ORDER BY h.FHUK01;Tables Used by This Program
How these tables connect — join details in the list below.
Loading relationship diagram…
R read · W write · R/W read + write
Secondary tables
- F0411Accounts payable ledger: one row per voucher pay item with gross, open, discount, and tax amounts, due dates, pay status, and the PO keys behind three-way match.Write accesstransaction
- F0911General ledger transaction detail: every journal entry line with its account, G/L date, amount, batch, subledger, and source-document references.Write accesstransaction
- F4211Sales order detail — current sales lines, including completed lines retained by the site's purge processing optionsWrite 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/write accesstransaction