AI Agents for SAP S/4HANA: Respecting Clean Core Without ABAP Development
- Public Edition opens only published APIs. Journal entries post through the Journal Entry Post SOAP service in scenario SAP_COM_0002. BAPIs such as BAPI_ACC_DOCUMENT_POST are classic APIs for Private Edition and on premise only.
- Reads come from released CDS views and published read APIs. SAP marks ACDOCA, BKPF and BSEG as not to be released, so reading or writing the tables is not clean core.
- SAP's API Policy of April 27, 2026 restricts AI agents that choose their own API calls to SAP endorsed routes, such as the MCP Gateway in SAP Integration Suite.
- Posting rules are checked before anything is sent, and nothing is sent until a named person approves it.
SAP S/4HANA enforces financial controls, document integrity and authorization hierarchies at the interface, so an AI system has to work through them or create an audit problem.
Clean core does not mean no ABAP. SAP's clean core levels put extensions on publicly released, stable interfaces (Level A) or on SAP's classic APIs (Level B), and class modifications and write access to SAP tables as Level D, not recommended. For an AI agent the practical rule is short: use the interfaces SAP publishes for the edition you run, and nothing else.
ChatFin reads through released CDS views and published read APIs, prepares journal entries, invoices and clearing proposals, checks them against your posting rules, and writes nothing until a named person approves. The write then goes through the published posting interface for your edition.
Which SAP S/4HANA APIs an AI Agent Can Use
The answer depends on the edition, and most vendor pages skip that step.
Cloud Public Edition accepts only published APIs, each enabled through a communication arrangement with its own communication user. For finance the main ones are the journal entry services in communication scenario SAP_COM_0002, Finance Posting Integration, which are SOAP services with synchronous and asynchronous variants (SAP describes them in its guidelines for the Journal Entry Post API); the Supplier Invoice API, API_SUPPLIERINVOICE_PROCESS_SRV, over OData; the open item read service API_OPLACCTGDOCITEMCUBE_SRV; and the bank statement service BANKSTATEMENTPOST_IN. The same guidelines note that the journal entry API does not post customer or supplier payments and does not clear open items, which is what the separate clearing service is for.
Private Edition and on premise run the same published APIs once the customer activates them, plus SAP's classic APIs. SAP's Cloudification Repository lists BAPI_ACC_DOCUMENT_POST and BAPI_INCOMINGINVOICE_CREATE1 as classic, remote enabled APIs, and names the RAP business objects I_JournalEntryTP and I_SupplierInvoiceTP as their released successors.
Reads come from released CDS views such as I_JournalEntryItem and I_GLAccountLineItem, or from published read APIs. The same repository marks ACDOCA, BKPF and BSEG as not to be released, and RFC_READ_TABLE as no API. An agent that reads the tables directly sits outside the contract that keeps it working through an upgrade.
AI traffic has its own rule since April 27, 2026. SAP's API Policy bars API use for AI systems that "plan, select, or execute sequences of API calls" except through SAP endorsed architectures, and SAP's reference architecture for third party MCP access points to the MCP Gateway in SAP Integration Suite. Our step by step guide to connecting Claude to SAP S/4HANA covers the setup.
Built for machines to read
SAP's clean core rules push integrations onto released APIs and away from custom ABAP. That same discipline is what makes S/4HANA data dependable for an agent.
I think they'll have tables that are very AI friendly for AI to manipulate and to pull data out of.
Dave Sackett, on the AgentCFO podcast
Build agents only on released APIs and standard authorizations, so every SAP upgrade leaves them working.
The Authorization Object Problem
Every action in SAP S/4HANA is governed by authorization objects, the permission structures that determine what a user can read, post, change, or display across every module. SAP uses them to enforce financial governance at the transaction level.
When an AI agent operates in SAP without respecting authorization objects, it creates a compliance gap that is invisible in normal operation but catastrophic at audit time. An AI running as an SAP superuser, or under a technical user with unrestricted access, is not operating within the control framework the company's auditors are reviewing. It is operating outside it, generating transactions that cannot be traced back to an authorized human action within the defined control perimeter.
The authorization objects that matter most for FI/CO AI operations are:
ChatFin does not create new authorization objects and does not ask for a superuser. On Private Edition and on premise it runs under its own technical user with a PFCG role limited to the company codes and activities you approve, display only where it only reads. On Cloud Public Edition the calls run under the communication user of the arrangement. In both cases the named person who approved each entry is recorded in ChatFin against it.
"An AI running as SAP superuser is not finance automation. It is a compliance liability dressed as productivity."
ChatFin's Pre-Posting Validation Engine
The most consequential difference between a compliant SAP AI integration and a non-compliant one is what happens before the posting is attempted. SAP's BAPI layer will catch many structural errors, but it will not catch every business-rule violation that your FI configuration expects. Pre-posting validation at the AI layer is the control that closes that gap.
ChatFin runs four checks before any posting call, whether that call is the Journal Entry Post service on Public Edition or BAPI_ACC_DOCUMENT_POST on Private Edition and on premise:
Stage 1: Company code check. The company code on the proposed document is validated against the agent user's F_BKPF_BUK scope and against the active company code configuration in the SAP system. Inactive company codes, blocked company codes, and company codes outside the user's authorization scope are rejected before the BAPI is called.
Stage 2: Posting period check. ChatFin checks whether the proposed posting date falls in an open posting period for the company code before it prepares the entry, so an agent cannot create a backdated entry in a closed period.
Stage 3: Document type and posting key rules. Every document type in SAP carries configuration rules: which account types are permitted, which number ranges apply, whether a reference document is required, whether net posting is allowed. ChatFin validates the proposed document type against these rules before constructing the BAPI payload. This prevents document type mismatches that SAP would reject at posting time, and document type assignments that SAP would accept but that break the company's internal control policies.
Stage 4: Account determination check. For entries that rely on automatic account determination, such as tax postings, intercompany clearing accounts and GR/IR clearing, ChatFin evaluates the account determination before the posting call, so the document it sends is complete.
Only after all four checks pass does the entry go to a named person for approval, and only after approval is the posting call made. SAP then runs its own checks as it does for any posting, and rejects anything your configuration does not allow.
Six SAP S/4HANA Finance Workflows
Six workflows where an agent does the preparation and a person approves. Which interface each one uses depends on the edition, and each note says where Public Edition differs.
FI Journal Entry through the Published Posting Interface
AI agents prepare and check FI journal entries, and post them after approval through the Journal Entry Post service on Public Edition or BAPI_ACC_DOCUMENT_POST on Private Edition and on premise. Document types, posting keys, GL account assignments, cost center derivations and profit center assignments are checked against the live SAP configuration. Entries that fail are returned to the finance team with the reason, not posted with an error that has to be reversed later.
Period Close Sequence: FI to CO to KSU5 to KE28 to FAGLGVTR
ChatFin tracks the period close sequence: FI close, cost center actual settlement (KSU5), profitability analysis transfer (KE28) and balance carryforward (FAGLGVTR). It checks status between steps and flags anything run out of order. On Private Edition and on premise some steps can be triggered over RFC under the agent user's authorizations; on Public Edition they run in SAP's own close tools and ChatFin reports their status. Every step keeps its parameters and return status in the audit trail.
AP Automation through the Supplier Invoice API
AI agents extract invoice data, match it to the purchase order and goods receipt, and prepare the supplier invoice with tax code, payment terms and withholding tax where applicable. After approval the invoice goes in through the Supplier Invoice API (API_SUPPLIERINVOICE_PROCESS_SRV) on Public Edition, or BAPI_INCOMINGINVOICE_CREATE1 or BAPI_INCOMINGINVOICE_PARK on Private Edition and on premise. Invoices that fail the three way match go to AP reviewers with the exception detail.
CO Variance Analysis via RFC Query Engine
ChatFin reads cost center actuals, plan values and variances from released CDS views and, on Private Edition and on premise, from RFC enabled function modules. Cost centers, profit centers, internal orders and WBS elements are first class query objects. Variance reports cross reference CO line items with FI document detail and procurement history to name the cause as well as the amount, and controllers get a written explanation alongside the table.
Electronic Bank Statement Reconciliation
Electronic bank statements come in through SAP's bank statement import; on Public Edition that is the BANKSTATEMENTPOST_IN service, which SAP notes carries opening and closing balances but not interim ones (KBA 3675114). ChatFin matches statement lines against open items and prepares clearing proposals. A named person approves them before clearing is posted, through the Journal Entry Clearing service on Public Edition or a clearing BAPI on Private Edition and on premise. Unmatched lines are grouped by exception type and routed to treasury with context.
Asset Accounting Depreciation Run Review
Depreciation runs stay in SAP. ChatFin checks the parameters before the run (fiscal year, posting period, company code and depreciation areas) and reviews the result afterwards with asset level detail for finance, flagging fully depreciated assets still in service, assets near impairment thresholds and depreciation key mismatches that affect the run.
What SAP S/4HANA Teams Should Expect
No figures here, because a close time or an error rate depends on your estate, not on the tool. What you can check is how the integration behaves.
"The companies winning with SAP AI are not the ones who broke clean core. They are the ones who never needed to."
SAP's Clean Core Mandate and AI Are Aligned, Not in Conflict
SAP's clean core mandate exists for a reason. It protects upgrade paths, reduces integration debt, and enforces the discipline that makes enterprise ERP sustainable at scale. AI systems that go around clean core, through modifications, direct table writes or technical users with unrestricted access, create technical debt and compliance gaps that compound over time and become expensive to remediate.
The right AI for SAP S/4HANA does not need to break clean core. Published APIs, released CDS views and, on Private Edition and on premise, classic BAPIs cover the FI and CO workflows on this page, when they run with a scoped user, checks before posting, approval by a named person and an audit trail that satisfies internal controls and external audit.
That is what ChatFin built. Not a workaround for SAP's architecture. A finance AI that respects it.
If your team is evaluating AI for SAP S/4HANA, ask whether your AI vendor understands clean core well enough to respect it.
See ChatFin for SAP S/4HANA →What Clean Core Means for an AI Agent
Clean core is SAP's rule for keeping customer changes out of the standard system so that upgrades do not break them. For an AI agent that rule has a plain meaning: the agent is one more consumer of SAP's published interfaces, the same as any other integration. It does not need custom ABAP inside S/4HANA, and it does not read or write the underlying tables.
The agent's own logic sits outside the ERP. Posting checks, the approval step and the record of who approved what live in the agent layer, and SAP receives the same kind of call a posting from a person would produce. Which interface that call uses depends on whether you run Cloud Public Edition or Private Edition and on premise. SAP's own checks then run on the document as they always do.
Finance Situations Where Clean Core Shapes the Choice
Each case below is a day-to-day SAP task and what the clean core rule decides about how an agent takes part.
- A reviewer asks for last quarter's open vendor items. The agent answers from a released CDS view or a published read API, so the question touches no table and the answer is still available after the next upgrade.
- A recurring accrual needs posting. The agent prepares the entry, checks the company code and open period, and holds it. After a person approves it, the post goes through the interface SAP publishes for your edition.
- A closing-week entry looks wrong. An agent-prepared entry lands on the reviewer's desk with a surprising balance. The reviewer opens the proposal, finds the source, and corrects it before anything reaches the ledger.
- A team asks IT for a custom ABAP report. Instead of a Z-program in the core, the request becomes a read on a released view, with the layout kept outside S/4HANA. An upgrade is less likely to disturb it.
- Auditors ask who made an entry. The posting runs under a defined communication user or technical user, and ChatFin records the person who approved each entry, so the answer is a name.
Chris Ortega, a fractional CFO and CEO of Fresh FP&A, on a month-end entry made by an agent.
“End of the month and you're like, why is depreciation $10 million? It's because you have this agent that did it. ... You have to have that human element.”
Teddy Collins, EVP of Finance at SeatGeek, on using AI as a tool in finance work.
“Ultimately this is an amazing augmentation tool for folks, but ultimately you're accountable for the results and you need to know the numbers. ... Think of it as a tool and you still have to learn how to write, know what's the right answer, have the judgment, and also be accountable for the results.”
Quick Answers on SAP S/4HANA AI Agents
What is clean core in SAP S/4HANA?
Clean core is SAP's approach of keeping extensions on released, stable interfaces instead of modifying the standard system, so upgrades go through without rework. Writing to SAP tables sits at the bottom of SAP's levels as not recommended.
Can an AI agent work in SAP S/4HANA without ABAP development?
Yes. The agent calls published APIs and reads released CDS views from outside the system, so no custom ABAP is needed. Which APIs you can use depends on your edition.
Do AI agents for SAP S/4HANA need a superuser?
No. On Private Edition and on premise the agent uses a technical user with a role limited to approved company codes and activities. On Cloud Public Edition it runs under the communication user of the arrangement.
Which SAP S/4HANA APIs can an AI agent use for journal entries?
On Cloud Public Edition, the Journal Entry Post service in scenario SAP_COM_0002. On Private Edition and on premise, the same published APIs once activated, plus classic APIs such as BAPI_ACC_DOCUMENT_POST.
Can I connect Claude to S/4HANA under SAP's API policy?
SAP's policy of April 27, 2026 limits AI systems that choose their own sequences of API calls to SAP endorsed routes, such as the MCP Gateway in SAP Integration Suite.
Why not read ACDOCA or BKPF directly for an AI agent?
SAP marks these tables as not to be released. Reading them puts the agent outside the contract that keeps it working through an upgrade, so use released CDS views or published read APIs.
Related Reading
More on finance operations and SAP integration: