$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
SAPintermediateNew

SAP CO Cost Center

Share

Create cost centers, cost center groups, and cost allocations

Works with OpenClaude

You are an SAP CO (Controlling) consultant. The user wants to create cost centers, cost center groups, and set up cost allocations in SAP.

What to check first

  • Run transaction OX02 to verify the controlling area and company code assignment exists
  • Check transaction KS01 to see if any cost centers already exist in your controlling area
  • Verify user has authorization object K_CCTR (Cost Center) with activity 01 (Create)

Steps

  1. Open transaction KS01 (Create Cost Center) and select the controlling area
  2. Enter the cost center key (e.g., "CC-SALES-01") and assign it to a cost center category (e.g., "F" for Functional area)
  3. Set the valid-from date and responsible person/cost center manager
  4. Populate the cost center attributes: name, description, department, location
  5. Assign the cost center to a cost center group in the "Group Assignment" section using transaction KSH1
  6. Create cost center groups via KSH1 to organize cost centers hierarchically (e.g., "SALES-GROUP" containing all sales cost centers)
  7. Configure cost allocations using transaction KA01 to define sender and receiver cost centers with allocation percentages
  8. Run the cost allocation batch via transaction KSUB or manually execute via KA02 (Execute Cost Allocation)

Code

*&---------------------------------------------------------------------*
*& Program: ZCOS_CENTER_SETUP
*& Description: Create cost centers, groups, and allocations in SAP CO
*&---------------------------------------------------------------------*
REPORT zcos_center_setup.

PARAMETERS:
  p_carea  TYPE cobrb-kokrs DEFAULT '1000',
  p_cctr   TYPE csks-kostl DEFAULT 'CC-SALES-01',
  p_ccname TYPE csks-ktext DEFAULT 'Sales Cost Center',
  p_group  TYPE csks-grpkost DEFAULT 'SALES-GROUP'.

DATA: ls_csks TYPE csks,
      ls_csgh TYPE csgh,
      lt_cskh TYPE TABLE OF cskh,
      lv_msgty TYPE bapi_mtype.

START-OF-SELECTION.

  " Create cost center
  ls_csks-kokrs = p_carea.
  ls_csks-kostl = p_cctr.
  ls_csks-ktext = p_ccname.
  ls_csks-grpkost = p_group.
  ls_csks-datab = sy-datum.
  ls_csks-datbi = '99991231'.
  ls_csks-verak = 'USER01'.

  INSERT INTO csks VALUES ls_csks.

  IF sy-subrc = 0.
    WRITE: / 'Cost Center', p_cctr, 'created successfully.'.
  ELSE.
    WRITE: / 'Error

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategorySAP
Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
sapcocost-center

Install command:

curl -o ~/.claude/skills/sap-co-cost-center.md https://clskills.in/skills/sap/sap-co-cost-center.md

Related SAP Skills

Other Claude Code skills in the same category — free to download.

Want a SAP skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.