Skip to content
SAP Reference

CR01

CreateS/4 · Active

Create Work Center

Boilerplate SQL

Databricks SQL

Starting point for querying the tables behind this transaction. Adjust the WHERE clause for your scenario.

-- ============================================================
-- T-Code : CR01 Create Work Center
-- Purpose: Create work center with capacity and standard-value keys
-- Grain  : One row per work center / plant / valid-period
-- Tables : CRHD, CRTX, CRCA, T001W
-- Notes  : CRTX provides the work-center description and must be filtered by SPRAS. CRCA carries capacity assignments (one row per work-center × capacity category).
-- ============================================================
SELECT
  -- Keys
  wc.MANDT  AS "Client",
  wc.OBJID  AS "Internal Object ID",
  wc.ARBPL  AS "Work Center",
  wc.WERKS  AS "Plant",

  -- Descriptive text
  ct.KTEXT  AS "Work Center Description",
  ct.LTEXT  AS "Work Center Long Text",

  -- Dates
  wc.BEGDA  AS "Valid From",
  wc.ENDDA  AS "Valid To",
  wc.ERSDA  AS "Created On",
  wc.AEDAT  AS "Last Changed On",

  -- Status / indicators
  wc.LOANZ  AS "Number of People",
  wc.PLANV  AS "Planner Group",
  wc.VGWTS  AS "Standard-Value Key",
  wc.STAND  AS "Standard Value Key",

  -- Org fields
  pt.NAME1  AS "Plant Name",
  wc.VERWE  AS "Work Center Category",
  wc.KOSTL  AS "Cost Center",

  -- Master data enrichment
  wc.AUTOR  AS "Person Responsible",
  ca.KAPID  AS "Capacity ID",
  ca.KAPAR  AS "Capacity Category",
  wc.ERNAM  AS "Created By"
FROM crhd wc
LEFT JOIN crtx ct
  ON  ct.MANDT = wc.MANDT
  AND ct.OBJTY = wc.OBJTY
  AND ct.OBJID = wc.OBJID
  AND ct.SPRAS = 'E'
LEFT JOIN crca ca
  ON  ca.MANDT = wc.MANDT
  AND ca.OBJTY = wc.OBJTY
  AND ca.OBJID = wc.OBJID
LEFT JOIN t001w pt
  ON  pt.MANDT = wc.MANDT
  AND pt.WERKS = wc.WERKS
WHERE
  wc.MANDT = '100'
  AND wc.WERKS = '<WERKS>'
  -- AND wc.ARBPL = '<ARBPL>'
ORDER BY wc.WERKS, wc.ARBPL;

Tables Used by This Transaction