Skip to content
SAP Reference

AFKO

transaction S/4HANA status: Active

Order Header Data PP Orders

Identity
What the badges mean
S/4HANA status: Active
Active and unchanged in S/4HANA.
S/4HANA status: Deprecated
Still readable today, but no longer SAP's strategic path — plan around it.
S/4HANA status: Replaced
Replaced by a new persistence in S/4HANA; the classic name may still answer reads (see read mechanism).
S/4HANA status: Migrating to IBP
Planning scope is moving from APO toward IBP.
S/4HANA status: Active (StRM) · Replaced (EWM)
Path-dependent: active with SAP Stock Room Management, replaced where EWM is the warehouse path.
S/4HANA status: Replaced · Compat View
Compatibility view: the classic table name is redirected to a view over the new persistence — see how the physical model moved.
S/4HANA status: Active · Proxy View
Proxy view: reads route through NSDM proxy/CDS views — see how the physical model moved.
master
Data class: what the table holds — master data, transaction documents, org structure, config, or texts (one row per language — see the quirks guide).
Linked type codes

CLNT the client key; filter it explicitly and carry it through every join.

NUMC fixed-width numeric text; keep it a string and keep the leading zeros.

DATS, TIMS character date (YYYYMMDD) and time (HHMMSS), zero-filled when initial.

CURR, CUKY, QUAN, UNIT amounts and quantities, meaningful only beside the currency key or unit that qualifies them.

LANG a language key in a text table — one row per language.

In field listings, K marks a primary-key field, and linked type codes in the Type column jump to the matching quirks-guide section.
Used in the library

Fields

27 fields · 2 key

27 fields.

Table fields: key flag, field name, description, data type (linked to the data quirks guide where the type carries a known trap), length, and check-table references. 27 fields.
KeyFieldDescriptionTypeLengthReferences
Primary keyMANDTClientCLNT3T000
Primary keyAUFNROrder NumberCHAR12AUFK
AUFPLRouting Number of Operations in the OrderNUMC10
STLNRBill of MaterialCHAR8
STLBEZBOM Material NumberCHAR18
PLNTYTask List TypeCHAR1
PLNNRKey for Task List GroupCHAR8
PLNALGroup CounterCHAR2
PLNMETask List Unit of MeasureUNIT3T006
STLALAlternative BOMCHAR2
STLANBOM UsageCHAR1
RSNUMNumber of Reservation/Dependent RequirementsNUMC10
GLTRPScheduled Finish (Basic)DATS8
GSTRPScheduled Start (Basic)DATS8
GLTRSScheduled Finish (Scheduled)DATS8
GSTRSScheduled Start (Scheduled)DATS8
GLTRIActual Finish (Confirmed)DATS8
GSTRIActual Start (Confirmed)DATS8
FHORIScheduling Margin KeyCHAR3
GAMNGTotal Order QuantityQUAN13,3
GMEINUnit of Measure for Total Order QuantityUNIT3T006
IGMNGConfirmed YieldQUAN13,3
PLSVBTo Lot SizeQUAN13,3
PLNBEZMaterial NumberCHAR18MARA
CY_SEQNRSequence Number Counter for Repetitive ManufacturingNUMC14
LEAD_AUFNRLead Order NumberCHAR12
FEVORProduction SupervisorCHAR3

Linked type codes in the Type column jump to the matching section of the SAP data quirks guide.

Field provenance: hand-curated.

Boilerplate SQL

Starting point for reading AFKO on Databricks. 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>, <AUFNR>

-- ============================================================
-- Table  : AFKO Order Header Data PP Orders
-- Purpose: Column-selected read of AFKO — auto-generated from field metadata
-- Grain  : One row per AUFNR
-- Notes  : Auto-generated skeleton. For multi-table transaction query patterns, see the linked t-codes on this page. Set catalog/schema to your Unity Catalog location; fill remaining placeholders (<...>) for your tenant.
-- ============================================================
SELECT
  h.MANDT      AS "Client",
  h.AUFNR      AS "Order Number",
  h.AUFPL      AS "Routing Number of Operations in the Order",
  h.STLNR      AS "Bill of Material",
  h.STLBEZ     AS "BOM Material Number",
  h.PLNTY      AS "Task List Type",
  h.PLNNR      AS "Key for Task List Group",
  h.PLNAL      AS "Group Counter",
  h.PLNME      AS "Task List Unit of Measure",
  h.STLAL      AS "Alternative BOM",
  h.STLAN      AS "BOM Usage",
  h.RSNUM      AS "Number of Reservation/Dependent Requirements",
  h.GLTRP      AS "Scheduled Finish (Basic)",
  h.GSTRP      AS "Scheduled Start (Basic)",
  h.GLTRS      AS "Scheduled Finish (Scheduled)",
  h.GSTRS      AS "Scheduled Start (Scheduled)",
  h.GLTRI      AS "Actual Finish (Confirmed)",
  h.GSTRI      AS "Actual Start (Confirmed)",
  h.FHORI      AS "Scheduling Margin Key",
  h.GAMNG      AS "Total Order Quantity",
  h.GMEIN      AS "Unit of Measure for Total Order Quantity",
  h.IGMNG      AS "Confirmed Yield",
  h.PLSVB      AS "To Lot Size",
  h.PLNBEZ     AS "Material Number",
  h.CY_SEQNR   AS "Sequence Number Counter for Repetitive Manufacturing",
  h.LEAD_AUFNR AS "Lead Order Number",
  h.FEVOR      AS "Production Supervisor"
FROM <catalog>.<schema>.afko h
WHERE
  h.MANDT = '<MANDT>'
  -- AND h.AUFNR = '<AUFNR>'
ORDER BY h.AUFNR;

Verified August 2026

More query patterns: CO01 CO02 CO03

Released CDS views over this table

Released SAP standard VDM views that read over AFKO. Prefer these over classic-table reads on S/4HANA where available.

Relationships

Diagram of 1-hop neighbors — join details below.

Join details

  • AFKOAFPOheader item · 1:N
    ON afko.AUFNR = afpo.AUFNR
  • AFKOAUFKforeign key · N:1
    ON afko.AUFNR = aufk.AUFNR
  • AFKOAFVCheader item · 1:N
    ON afko.AUFPL = afvc.AUFPL

Transaction Codes That Use This Table

More Production Planning tables