SAP Reference
MR8M
Change S/4HANA status: ActiveCancel Invoice Document
Notes
Mapped here to BKPF/BSEG (the reversal accounting document) and EKBE (the PO history entry it reverses). The invoice document itself (header RBKP, item RSEG) is not in this catalog.
Boilerplate SQL
Databricks SQLStarting point for querying the tables behind this transaction. Set your Unity Catalog location and filter values below — they’re substituted into the SQL and the copy button.
Query parameters
6 parameters not filled: <catalog>, <schema>, <MANDT>, <BUKRS>, <BELNR>, <GJAHR>
-- ============================================================
-- T-Code : MR8M Cancel Invoice Document
-- Purpose: Cancel Invoice Document — auto-generated boilerplate from tcode-table-map
-- Grain : One row per BKPF joined to BSEG, EKBE
-- Tables : BKPF, BSEG, EKBE
-- Notes : Auto-generated skeleton. Add MAKT/T001W/LFA1/KNA1 enrichment joins as needed for the business question. Set catalog/schema to your Unity Catalog location; fill remaining placeholders (<...>) for your tenant.
-- ============================================================
SELECT
h.MANDT AS "Client",
h.BUKRS AS "Company Code",
h.BELNR AS "Accounting Document Number",
h.GJAHR AS "Fiscal Year",
l.BUZEI AS "Number of Line Item Within Accounting Document",
e.EBELN AS "Purchasing Document Number",
e.EBELP AS "Item Number of Purchasing Document",
e.ZEKKN AS "Sequential Number of Account Assignment",
e.VGABE AS "Transaction/Event Type",
e.BUZEI AS "Item in Material Document"
FROM <catalog>.<schema>.bkpf h
LEFT JOIN <catalog>.<schema>.bseg l
ON l.MANDT = h.MANDT
AND l.BELNR = h.BELNR
AND l.BUKRS = h.BUKRS
AND l.GJAHR = h.GJAHR
LEFT JOIN <catalog>.<schema>.ekbe e
ON e.MANDT = h.MANDT
AND e.GJAHR = h.GJAHR
AND e.BELNR = h.BELNR
WHERE
h.MANDT = '<MANDT>'
AND h.BUKRS = '<BUKRS>'
AND h.BELNR = '<BELNR>'
AND h.GJAHR = <GJAHR>
ORDER BY h.BUKRS;Tables Used by This Transaction
How these tables connect. Nodes are clickable.