Give it a controlling area (KOKRS) and it returns every cost center underneath with all CSKS columns, plus the names from CSKT. Plain HANA SQL for DB02/ST04 → Diagnostics → SQL Editor; an S/4HANA version and an ECC version are both included.
Verified on an S/4HANA sandbox: controlling area JNC2 (JNC #2 Controlling Area), client 100. Written 2026-08-31.
1. Result — 5 cost centers in JNC2
| Case | Cost centers under controlling area JNC2 (output of the query in section 6) |
|---|
| What it does | The five cost centers of JNC2 with the CSKT name, category, functional area and standard hierarchy node. The full query returns all 84 CSKS columns; the grid below shows the columns that carry the meaning. |
| Result | 5 rows |
Result — 5 rows (KOKRS = JNC2)
KOSTL | KTEXT (CSKT) | KOSAR | FUNC_AREA | KHINR (std hierarchy node)
---------+------------------------+-------+----------------------+---------------------------
JNC21010 | SG&A | 2 | JNCS (SG&A) | JNC210 (SG&A)
JNC27010 | Subcontract | 1 | JNCM (Manufacturing) | JNC22030 (Subcontract)
JNC28010 | Indirect Manufacturing | 3 | JNCM (Manufacturing) | JNC22010 (Indirect Manuf.)
JNC29010 | Direct Manufacturing | 1 | JNCM (Manufacturing) | JNC22020 (DIrect Manuf.)
JNC29020 | Direct Manufacturing | 1 | JNCM (Manufacturing) | JNC22020 (DIrect Manuf.)
2. One record in full — JNC21010 (every column that holds a value)
| Case | All populated columns of cost center JNC21010 |
|---|
| What it does | One row of the section 6 result, turned sideways. Columns that are blank on this system (address, telephone, JVA, templates and so on) are left out; section 4 lists them. |
| Watch out | KTEXT / LTEXT / MCTXT are not CSKS columns — they come from the CSKT join. |
| Result | 24 populated columns |
Result — JNC21010, 24 populated columns
FIELD | VALUE | MEANING | WHAT THE CODE POINTS TO
----------+------------------+--------------------------------+---------------------------------------------------
MANDT | 100 | Client |
KOKRS | JNC2 | Controlling area | JNC #2 Controlling Area (TKA01)
KOSTL | JNC21010 | Cost center |
KTEXT | SG&A | General name | from the CSKT join
LTEXT | SG&A | Description (long name) | from the CSKT join
MCTXT | SG&A | Search term (upper case) | from the CSKT join
DATAB | 2026.01.01 | Valid from |
DATBI | 9999.12.31 | Valid to | key field — change history stacks up as extra rows
BUKRS | JNC2 | Company code | JNC #2 Company Code (T001, Seoul/KRW)
GSBER | JNC2 | Business area | JNC #2 Business Area (TGSBT)
KOSAR | 2 | Cost center category | defined in OKA2 (TKA05)
VERAK | Person Responsib | Person responsible | free text, not a master-data reference
WAERS | KRW | Currency key | South Korean Won (TCURT)
PRCTR | JNC2 | Profit center | JNC #2 Prof. Center (CEPCT)
KHINR | JNC210 | Standard hierarchy area | SG&A (SETHEADERT, set class 0101)
FUNC_AREA | JNCS | Functional area | SG&A (TFKBT)
OBJNR | KSJNC2JNC21010 | Object number | KS + KOKRS + KOSTL
ERSDA | 2026.07.24 | Created on |
USNAM | HUB2146 | Created by |
BKZER | X | Lock: actual revenue postings |
BKZOB | X | Lock: commitment update |
PKZER | X | Lock: plan revenues |
MGEFL | X | Records consumption quantities |
KOMPL | X | Master record complete |
3. Column dictionary — key, organizational assignment, history, locks
| Group | Field | Meaning |
|---|
| Key | MANDT | Client |
| Key | KOKRS | Controlling area |
| Key | KOSTL | Cost center |
| Key | DATBI | Valid to — part of the key, so one cost center can have several rows |
| Period | DATAB | Valid from |
| Org. assignment | BUKRS | Company code |
| Org. assignment | GSBER | Business area |
| Org. assignment | KOSAR | Cost center category |
| Org. assignment | PRCTR | Profit center |
| Org. assignment | WERKS | Plant |
| Org. assignment | FUNC_AREA | Functional area |
| Org. assignment | KHINR | Standard hierarchy area — a node of the cost center group tree |
| Org. assignment | ABTEI | Department |
| Org. assignment | WAERS | Currency key |
| Org. assignment | LAND1 | Country/region key |
| Org. assignment | LOGSYSTEM | Logical system |
| Org. assignment | OBJNR | Object number — the join key to CO line items (COEP and others) |
| Responsible / history | VERAK | Person responsible (free text) |
| Responsible / history | VERAK_USER | User responsible (SAP user ID) |
| Responsible / history | ERSDA | Created on |
| Responsible / history | USNAM | Created by |
| Lock | BKZKP | Lock: actual primary postings |
| Lock | PKZKP | Lock: plan primary costs |
| Lock | BKZKS | Lock: actual secondary costs |
| Lock | PKZKS | Lock: plan secondary costs |
| Lock | BKZER | Lock: actual revenue postings |
| Lock | PKZER | Lock: plan revenues |
| Lock | BKZOB | Lock: commitment update (purchase requisitions / purchase orders) |
4. Column dictionary — control, templates, industry add-ons, texts
| Group | Field | Meaning |
|---|
| Control / calculation | VMETH | Indicator for allowed allocation methods |
| Control / calculation | MGEFL | Records consumption quantities |
| Control / calculation | KALSM | Costing sheet (overhead calculation) |
| Control / calculation | KOSZSCHL | CO-CCA overhead key |
| Control / calculation | KVEWE | Usage of the condition table |
| Control / calculation | KAPPL | Application |
| Control / calculation | TXJCD | Tax jurisdiction |
| Control / calculation | STAKZ | Statistical object indicator |
| Control / calculation | KOMPL | Master record complete |
| Control / calculation | NKOST | Subsequent cost center (follow-on assignment) |
| Control / calculation | CCKEY | Cost collector key |
| Control / calculation | DRNAM | Printer name for cost center reports |
| Control / calculation | FUNKT | Cost center function |
| Control / calculation | AFUNK | Alternative cost center function |
| Template | CPI_TEMPL | Template: activity-independent formula planning |
| Template | CPD_TEMPL | Template: activity-dependent formula planning |
| Template | SCI_TEMPL | Template: activity-independent allocation |
| Template | SCD_TEMPL | Template: activity-dependent allocation |
| Template | SKI_TEMPL | Template: statistical key figures, activity-independent |
| Template | SKD_TEMPL | Template: statistical key figures, activity-dependent |
| Address / contact | ANRED / NAME1~4 / ORT01~02 / STRAS / PFACH / PSTLZ / PSTL2 / REGIO / SPRAS | 14 address fields — all blank on this system |
| Address / contact | TELBX / TELF1~2 / TELFX / TELTX / TELX1 / DATLT | 7 telephone / fax / telecom fields — all blank |
| JVA | VNAME | Joint venture |
| JVA | RECID | Recovery indicator |
| JVA | ETYPE | Equity type |
| JVA | JV_OTYPE | Joint venture object type |
| JVA | JV_JIBCL | JIB/JIBE class |
| JVA | JV_JIBSA | JIB/JIBE subclass A |
| Other | FERC_IND | Regulatory reporting indicator |
| PSM | FUND | Fund — usually absent in ECC |
| PSM | GRANT_ID | Grant — named GRANT_NBR in ECC |
| PSM | FUND_FIX_ASSIGNED | Fund fixed assignment — usually absent in ECC |
| PSM | GRANT_FIX_ASSIGNED | Grant fixed assignment — usually absent in ECC |
| PSM | FUNC_AREA_FIX_ASSIGNED | Functional area fixed assignment — usually absent in ECC |
| S/4HANA only | BUDGET_CARRYING_COST_CTR | Budget-carrying cost center |
| S/4HANA only | AVC_PROFILE | Availability control profile |
| S/4HANA only | AVC_ACTIVE | Availability control active |
| S/4HANA only | EEW_CSKS_PS_DUMMY | Extension field dummy |
| Text (CSKT) | KTEXT | General name, 20 characters — lives in CSKT, not CSKS |
| Text (CSKT) | LTEXT | Description (long name), 40 characters |
| Text (CSKT) | MCTXT | Search term, upper case |
5. Putting a name next to each code — text table mapping
| Code field | Text table | Join key | Text field |
|---|
| KOKRS | TKA01 | MANDT + KOKRS | BEZEI |
| KOSTL | CSKT | MANDT + KOKRS + KOSTL + DATBI + SPRAS | KTEXT / LTEXT / MCTXT |
| BUKRS | T001 | MANDT + BUKRS | BUTXT |
| GSBER | TGSBT | MANDT + GSBER + SPRAS | GTEXT |
| PRCTR | CEPCT | MANDT + KOKRS + PRCTR + DATBI + SPRAS | KTEXT / LTEXT |
| WERKS | T001W | MANDT + WERKS | NAME1 |
| FUNC_AREA | TFKBT | MANDT + FKBER + SPRAS | FKBTX |
| KHINR | SETHEADERT | MANDT + SETCLASS('0101') + SUBCLASS(=KOKRS) + SETNAME + LANGU | DESCRIPT |
| WAERS | TCURT | MANDT + WAERS + SPRAS | LTEXT / KTEXT |
| LAND1 | T005T | MANDT + LAND1 + SPRAS | LANDX |
| KOSAR | (none) | TKA05 has no text column and the domain has no fixed values | visible only in the OKA2 screen |
6. S/4HANA — the query for DB02/ST04
| Case | All 84 CSKS columns + 12 names next to the codes (10 text tables joined) |
|---|
| What it does | A code value alone tells you little, so every code field that has a text table gets its name in the next column through a LEFT JOIN (aliases like KOKRS_TXT, BUKRS_TXT). The remaining columns without a text follow underneath, five per line. |
| Watch out | The HANA SQL editor does not filter by client. MANDT has to be in the WHERE clause and in every join condition. |
| Watch out | Text tables multiply rows by the number of languages unless SPRAS/LANGU is restricted. For Korean names replace 'E' with '3' — the SAP language code for Korean is '3', not 'K'. |
| Watch out | CSKT has the validity period in its key, so it is joined on k.DATBI. CEPCT is pinned to the currently valid entry with DATBI = '99991231'. |
| Result | 5 rows for JNC2 — see section 1 |
SELECT
k.MANDT,
k.KOKRS, ka.BEZEI AS KOKRS_TXT,
k.KOSTL, t.KTEXT AS KOSTL_TXT,
t.LTEXT AS KOSTL_LTXT,
t.MCTXT AS KOSTL_MCTXT,
k.DATAB, k.DATBI,
k.BUKRS, bu.BUTXT AS BUKRS_TXT,
k.GSBER, gs.GTEXT AS GSBER_TXT,
k.PRCTR, pc.KTEXT AS PRCTR_TXT,
k.WERKS, wk.NAME1 AS WERKS_TXT,
k.FUNC_AREA, fa.FKBTX AS FUNC_AREA_TXT,
k.KHINR, sh.DESCRIPT AS KHINR_TXT,
k.WAERS, cu.LTEXT AS WAERS_TXT,
k.LAND1, ct.LANDX AS LAND1_TXT,
k.KOSAR, k.VERAK, k.VERAK_USER, k.ABTEI, k.NKOST,
k.ERSDA, k.USNAM, k.LOGSYSTEM, k.OBJNR, k.KOMPL,
k.BKZKP, k.PKZKP, k.BKZKS, k.PKZKS, k.BKZER,
k.PKZER, k.BKZOB, k.VMETH, k.MGEFL, k.KALSM,
k.KOSZSCHL, k.KVEWE, k.KAPPL, k.TXJCD, k.STAKZ,
k.CCKEY, k.DRNAM, k.FUNKT, k.AFUNK, k.CPI_TEMPL,
k.CPD_TEMPL, k.SCI_TEMPL, k.SCD_TEMPL, k.SKI_TEMPL, k.SKD_TEMPL,
k.ANRED, k.NAME1, k.NAME2, k.NAME3, k.NAME4,
k.ORT01, k.ORT02, k.STRAS, k.PFACH, k.PSTLZ,
k.PSTL2, k.REGIO, k.SPRAS, k.TELBX, k.TELF1,
k.TELF2, k.TELFX, k.TELTX, k.TELX1, k.DATLT,
k.VNAME, k.RECID, k.ETYPE, k.JV_OTYPE, k.JV_JIBCL,
k.JV_JIBSA, k.FERC_IND,
k.EEW_CSKS_PS_DUMMY, k.BUDGET_CARRYING_COST_CTR,
k.AVC_PROFILE, k.AVC_ACTIVE, k.FUND, k.GRANT_ID,
k.FUND_FIX_ASSIGNED, k.GRANT_FIX_ASSIGNED,
k.FUNC_AREA_FIX_ASSIGNED
FROM CSKS k
LEFT JOIN CSKT t ON t.MANDT = k.MANDT
AND t.KOKRS = k.KOKRS
AND t.KOSTL = k.KOSTL
AND t.DATBI = k.DATBI
AND t.SPRAS = 'E'
LEFT JOIN TKA01 ka ON ka.MANDT = k.MANDT
AND ka.KOKRS = k.KOKRS
LEFT JOIN T001 bu ON bu.MANDT = k.MANDT
AND bu.BUKRS = k.BUKRS
LEFT JOIN TGSBT gs ON gs.MANDT = k.MANDT
AND gs.GSBER = k.GSBER
AND gs.SPRAS = 'E'
LEFT JOIN CEPCT pc ON pc.MANDT = k.MANDT
AND pc.KOKRS = k.KOKRS
AND pc.PRCTR = k.PRCTR
AND pc.DATBI = '99991231'
AND pc.SPRAS = 'E'
LEFT JOIN T001W wk ON wk.MANDT = k.MANDT
AND wk.WERKS = k.WERKS
LEFT JOIN TFKBT fa ON fa.MANDT = k.MANDT
AND fa.FKBER = k.FUNC_AREA
AND fa.SPRAS = 'E'
LEFT JOIN SETHEADERT sh ON sh.MANDT = k.MANDT
AND sh.SETCLASS = '0101'
AND sh.SUBCLASS = k.KOKRS
AND sh.SETNAME = k.KHINR
AND sh.LANGU = 'E'
LEFT JOIN TCURT cu ON cu.MANDT = k.MANDT
AND cu.WAERS = k.WAERS
AND cu.SPRAS = 'E'
LEFT JOIN T005T ct ON ct.MANDT = k.MANDT
AND ct.LAND1 = k.LAND1
AND ct.SPRAS = 'E'
WHERE k.MANDT = '100'
AND k.KOKRS = 'JNC2'
ORDER BY k.KOSTL, k.DATBI DESC;
7. ECC — the query for DB02/ST04
| Case | The same query without the 9 columns that do not exist in ECC (75 CSKS columns + 12 names) |
|---|
| What it does | CSKS/CSKT and the 10 text tables have almost the same structure in ECC and S/4HANA, so the join syntax carries over unchanged. Pasting the S/4HANA query into ECC fails with column-not-found, because 9 columns exist only in S/4HANA or with an add-on: EEW_CSKS_PS_DUMMY, BUDGET_CARRYING_COST_CTR, AVC_PROFILE, AVC_ACTIVE, FUND, GRANT_ID, FUND_FIX_ASSIGNED, GRANT_FIX_ASSIGNED, FUNC_AREA_FIX_ASSIGNED. This version drops those 9. |
| Watch out | If it still fails, remove the 6 JVA (joint venture) columns VNAME / RECID / ETYPE / JV_OTYPE / JV_JIBCL / JV_JIBSA and FERC_IND and run again — these are industry add-on columns and may be missing depending on the system. |
| Result | No result set recorded in the source (the query differs from the S/4HANA version only by the dropped columns). |
SELECT
k.MANDT,
k.KOKRS, ka.BEZEI AS KOKRS_TXT,
k.KOSTL, t.KTEXT AS KOSTL_TXT,
t.LTEXT AS KOSTL_LTXT,
t.MCTXT AS KOSTL_MCTXT,
k.DATAB, k.DATBI,
k.BUKRS, bu.BUTXT AS BUKRS_TXT,
k.GSBER, gs.GTEXT AS GSBER_TXT,
k.PRCTR, pc.KTEXT AS PRCTR_TXT,
k.WERKS, wk.NAME1 AS WERKS_TXT,
k.FUNC_AREA, fa.FKBTX AS FUNC_AREA_TXT,
k.KHINR, sh.DESCRIPT AS KHINR_TXT,
k.WAERS, cu.LTEXT AS WAERS_TXT,
k.LAND1, ct.LANDX AS LAND1_TXT,
k.KOSAR, k.VERAK, k.VERAK_USER, k.ABTEI, k.NKOST,
k.ERSDA, k.USNAM, k.LOGSYSTEM, k.OBJNR, k.KOMPL,
k.BKZKP, k.PKZKP, k.BKZKS, k.PKZKS, k.BKZER,
k.PKZER, k.BKZOB, k.VMETH, k.MGEFL, k.KALSM,
k.KOSZSCHL, k.KVEWE, k.KAPPL, k.TXJCD, k.STAKZ,
k.CCKEY, k.DRNAM, k.FUNKT, k.AFUNK, k.CPI_TEMPL,
k.CPD_TEMPL, k.SCI_TEMPL, k.SCD_TEMPL, k.SKI_TEMPL, k.SKD_TEMPL,
k.ANRED, k.NAME1, k.NAME2, k.NAME3, k.NAME4,
k.ORT01, k.ORT02, k.STRAS, k.PFACH, k.PSTLZ,
k.PSTL2, k.REGIO, k.SPRAS, k.TELBX, k.TELF1,
k.TELF2, k.TELFX, k.TELTX, k.TELX1, k.DATLT,
k.VNAME, k.RECID, k.ETYPE, k.JV_OTYPE, k.JV_JIBCL,
k.JV_JIBSA, k.FERC_IND
FROM CSKS k
LEFT JOIN CSKT t ON t.MANDT = k.MANDT
AND t.KOKRS = k.KOKRS
AND t.KOSTL = k.KOSTL
AND t.DATBI = k.DATBI
AND t.SPRAS = 'E'
LEFT JOIN TKA01 ka ON ka.MANDT = k.MANDT
AND ka.KOKRS = k.KOKRS
LEFT JOIN T001 bu ON bu.MANDT = k.MANDT
AND bu.BUKRS = k.BUKRS
LEFT JOIN TGSBT gs ON gs.MANDT = k.MANDT
AND gs.GSBER = k.GSBER
AND gs.SPRAS = 'E'
LEFT JOIN CEPCT pc ON pc.MANDT = k.MANDT
AND pc.KOKRS = k.KOKRS
AND pc.PRCTR = k.PRCTR
AND pc.DATBI = '99991231'
AND pc.SPRAS = 'E'
LEFT JOIN T001W wk ON wk.MANDT = k.MANDT
AND wk.WERKS = k.WERKS
LEFT JOIN TFKBT fa ON fa.MANDT = k.MANDT
AND fa.FKBER = k.FUNC_AREA
AND fa.SPRAS = 'E'
LEFT JOIN SETHEADERT sh ON sh.MANDT = k.MANDT
AND sh.SETCLASS = '0101'
AND sh.SUBCLASS = k.KOKRS
AND sh.SETNAME = k.KHINR
AND sh.LANGU = 'E'
LEFT JOIN TCURT cu ON cu.MANDT = k.MANDT
AND cu.WAERS = k.WAERS
AND cu.SPRAS = 'E'
LEFT JOIN T005T ct ON ct.MANDT = k.MANDT
AND ct.LAND1 = k.LAND1
AND ct.SPRAS = 'E'
WHERE k.MANDT = '100'
AND k.KOKRS = 'JNC2'
ORDER BY k.KOSTL, k.DATBI DESC;
| Case | Still failing — list the real columns of CSKS on your system first |
|---|
| What it does | If either query reports a missing column, read the actual column list of CSKS from the dictionary (DD03L). Copy the FIELDNAME values into the SELECT list and the query will run. POSITION is the physical column order. |
| Watch out | DD03L is client-independent — there is no MANDT column, so a MANDT condition added out of habit causes an error. |
| Watch out | AS4LOCAL = 'A' restricts to the active version; FIELDNAME NOT LIKE '.%' removes the .INCLUDE rows that are not real columns. |
| Result | One row per CSKS column, in POSITION order |
SELECT
TABNAME, FIELDNAME, POSITION, KEYFLAG, ROLLNAME,
DATATYPE, LENG
FROM DD03L
WHERE TABNAME = 'CSKS'
AND AS4LOCAL = 'A'
AND FIELDNAME NOT LIKE '.%'
ORDER BY POSITION;
Comments
Post a Comment