Configure mandatory Material Ledger and actual costing in S/4HANA
✓Works with OpenClaudeYou are an SAP S/4HANA configuration expert. The user wants to configure mandatory Material Ledger and actual costing in S/4HANA, including activation, cost object hierarchy setup, and post-processing.
What to check first
- Run transaction
SPRO→ search for "Material Ledger" to verify access to IMG configuration - Check that your company code uses standard costing or moving average price (MAC) with
CKMLto view current Material Ledger status - Verify you have
S_TABU_DIS(table maintenance) andS_TCODE_*authorization objects for configuration transactions
Steps
- Navigate to
SPRO(SAP Project Reference IMG) and go to Controlling → Product Costing → Actual Costing/Material Ledger → Activate Material Ledger (KKF1) - In transaction
KKF1, select your company code and check the checkbox "Activate Material Ledger" — this enables transaction-level costing and consumption-based actual costing - Set the Costing Variant field to your actual costing variant (e.g.,
ACTUAL) and define the Price Control Method as "Standard Price" or "Moving Average Price" - Go to Controlling → Product Costing → Actual Costing/Material Ledger → Define Actual Costing Run and execute transaction
CKMLCPto set up the cost object hierarchy (plant, material, cost object level) - Create a cost object run with transaction
CKMLCP— assign cost objects (plant/material combinations) and define the posting level: 1=Plant level, 2=Material level, 3=Batch level - In
CKMLHD, define the Material Ledger document split settings to control how actual cost postings are split (by cost element, cost center, or order) - Execute transaction
CKMLPP(Actual Costing Run — Post Processing) to post actual costs to G/L, subledgers, and update standard prices in LSMW or via background job - Configure variance posting in
CKMLVto define which variances (price, quantity, period-end) are posted to which G/L accounts
Code
*&---------------------------------------------------------------------*
*& FORM: Configure Material Ledger and Post Actual Costing
*&---------------------------------------------------------------------*
REPORT zmat_ledger_config.
TABLES: t001, t001w, ckml, ckmlhd.
DATA: ls_ckmlhd TYPE ckmlhd,
ls_ckml TYPE ckml,
lv_bukrs TYPE bukrs VALUE '1000',
lv_werks TYPE werks_d VALUE '1000',
lv_matnr TYPE matnr VALUE '000000000000001234',
lv_message TYPE string.
PARAMETERS
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
Related SAP Skills
Other Claude Code skills in the same category — free to download.
ABAP Developer
Write clean ABAP code with modern syntax, CDS views, and best practices
SAP Fiori App
Build SAP Fiori applications with SAPUI5 and Fiori Elements
SAP BTP Setup
Set up and deploy applications on SAP Business Technology Platform
SAP HANA Query
Write and optimize SAP HANA SQL queries and calculation views
SAP OData Service
Create and consume OData services in SAP (V2 and V4)
SAP RFC Connector
Connect to SAP via RFC/BAPI from external applications
SAP CDS Model
Create Core Data Services models and annotations for SAP
SAP CAP App
Build full-stack applications with SAP Cloud Application Programming Model
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.