Skip to content
SAP Reference

ME31L

Create S/4HANA status: Active

Create Scheduling Agreement

Boilerplate SQL

Databricks SQL

Starting 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

4 parameters not filled: <catalog>, <schema>, <MANDT>, <EBELN>

-- ============================================================
-- T-Code : ME31L Create Scheduling Agreement
-- Purpose: Create Scheduling Agreement — auto-generated boilerplate from tcode-table-map
-- Grain  : One row per EKKO joined to EKPO, EKET, T161
-- Tables : EKKO, EKPO, EKET, T161
-- 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.EBELN       AS "Purchasing Document Number",
  h.DESCRIPTION AS "Description",
  l.EBELP       AS "Item Number of Purchasing Document",
  e.EBELP       AS "Item Number of Purchasing Document",
  e.ETENR       AS "Delivery Schedule Line Counter",
  t.BSTYP       AS "Purchasing Document Category"
FROM <catalog>.<schema>.ekko h
LEFT JOIN <catalog>.<schema>.ekpo l
  ON l.MANDT = h.MANDT
 AND l.EBELN = h.EBELN
LEFT JOIN <catalog>.<schema>.eket e
  ON e.MANDT = h.MANDT
 AND e.EBELN = h.EBELN
LEFT JOIN <catalog>.<schema>.t161 t
  ON t.MANDT = h.MANDT
 AND t.BSART = h.BSART
WHERE
  h.MANDT = '<MANDT>'
  AND h.EBELN = '<EBELN>'
ORDER BY h.EBELN;

Tables Used by This Transaction

How these tables connect. Nodes are clickable.

Join details

  • EKKOEKPOheader item · 1:N
    ON ekko.EBELN = ekpo.EBELN
  • EKKOT161check table · N:1
    ON ekko.BSART = t161.BSART

More Materials Management t-codes