How to add AI agents to SAP ECC 6.0
Short answer
Put a thin tool layer between the agent and ECC, built on released BAPIs, RFC-enabled function modules and read-only table access, and keep every posting behind a human approval step. The model can run on your own GPUs, so nothing about your plant data has to leave the network. You do not need to wait for S/4HANA to start.
Most ECC 6.0 plants have a decade or more of custom Z-programs, user exits and Business Workflow built around MM, PP, SD and QM. The people who understand them are busy, and the clock on mainstream maintenance (currently end of 2027, with a paid extension to 2030, check your own contract) is pushing a migration that many plants cannot finish quickly. In the meantime, planners still spend their day in MD04, ME2N, CO02 and MB51 chasing exceptions.
An AI agent in this context is not a chatbot. It is a worker that takes a goal such as "clear this week's MRP exceptions for the machining plant", calls a fixed set of tools against ECC, reasons about what it finds, and proposes actions for a person to approve. The agent never needs a new ERP. It needs a well-scoped way to read ECC and a controlled way to ask for changes.
Because ECC is on-prem in most shops and often sits behind strict network zones, the integration pattern matters more than the model. Get the tool layer, the authorizations and the approval step right and the model becomes a swappable component.
What teams use it for
MRP exception triage
The agent pulls stock/requirements data (the data behind MD04 and MD07) for flagged materials, groups exceptions like reschedule-in, reschedule-out and cancel, checks open POs and planned orders, and drafts a prioritized worklist for the planner.
PO expediting
For purchase orders past their confirmed delivery date (EKKO, EKPO, EKET), the agent reads confirmation history, drafts the supplier email, and queues a change proposal for the buyer instead of editing the PO itself.
Production order shortage chasing
It reads released production orders (AFKO, AFPO, RESB), finds missing components, looks for alternative stock in other storage locations, and suggests a goods movement or a substitution for the supervisor to approve.
Quality notification drafting
From an inspection lot rejection (QALS, QAVE), the agent collects usage decision data, batch history and vendor, and drafts a QM notification with the defect description for the quality engineer to review.
Order promise checking
For a rush sales order, it calls an ATP check, reviews open production capacity and component availability, and proposes a realistic date to the customer service rep rather than quoting the standard lead time.
Master data hygiene
Scans material masters (MARA, MARC) for missing MRP types, zero lead times or inconsistent units of measure and raises cleaned-up change requests that go through your normal master data approval.
SAP ECC 6.0 integration surface
- BAPIs and RFC-enabled function modules, called through SAP NetWeaver RFC SDK wrappers (for example PyRFC or node-rfc). Examples vary by support package, so confirm in SE37: BAPI_MATERIAL_AVAILABILITY, BAPI_PO_GETDETAIL, BAPI_PRODORD_GET_DETAIL, BAPI_SALESORDER_GETLIST.
- A generic read function such as RFC_READ_TABLE is often discouraged by Basis teams (row width limits and broad table access). Prefer a custom Z function module or released BAPI with its own authorization check.
- IDocs (for example ORDERS05, MATMAS) with partner profiles in WE20 and monitoring in WE02/BD87, useful for event-style triggers and for asynchronous write requests.
- SAP Gateway OData services built in SEGW (embedded on newer NetWeaver 7.40+ stacks, hub add-on on older ones), or SOAP services published through SOAMANAGER, if you want an HTTP surface instead of RFC.
- SAP Process Integration/Orchestration (PI/PO) if you already run it as your integration bus, which gives you routing, mapping and audit you do not have to rebuild.
- Authorization objects such as S_RFC, S_TCODE and the business objects behind each BAPI, assigned to a dedicated technical user of type System or Service via SU01 and PFCG.
How it works
- 1
Pick two or three read-only jobs first
Start with MRP exception summaries and open PO status. These touch a handful of tables and give planners immediate value without any write risk.
- 2
Build the tool layer as functions, not free SQL
Each tool is one named function with typed inputs, for example get_open_pos(vendor, date_range). It calls a BAPI or Z function module and returns a trimmed JSON result. The agent never composes ABAP or table queries on its own.
- 3
Create a dedicated technical user
Use a separate SU01 user with a PFCG role limited to the exact function modules and plants needed. Never reuse a dialog user's credentials.
- 4
Add a proposal queue for writes
When the agent wants a change (reschedule a PO line, create a QM notification), it writes a proposal record to your queue or an approval tool. A person approves, and a separate, narrowly scoped function posts it into ECC.
- 5
Choose the model location
For regulated plants, serve an open-weight model with vLLM or Ollama on your own GPU server. For lower sensitivity work you can call a cloud API from a network zone that is already allowed to reach it.
- 6
Log every tool call
Store the agent goal, each tool call with parameters, the returned row counts and the final proposal. This is your audit trail and your debugging tool when the agent misreads something.
- 7
Run in shadow mode
For two to four weeks, let the agent produce worklists that planners compare against their own decisions. Tune the tools and prompts before turning on any write path.
Example flows
Morning MRP exception sweep
Trigger: Scheduled at 06:00 after the nightly MRP run finishes (watch job status in SM37).
- Agent calls a tool that lists materials with exception messages for the plant and MRP controller.
- For each high-value material it fetches stock/requirements lines and open PO and production order supply.
- It classifies each as expedite, push out, cancel or ignore, with a one-line reason.
- It posts a ranked list to the planner's queue with links back to MD04 transaction parameters.
Result: Planners start the day with a short prioritized list instead of scrolling several hundred exception lines.
Late supplier PO follow-up
Trigger: A PO line is more than three days past its latest confirmed delivery date.
- Agent reads the PO line, vendor, confirmation history and linked production order demand.
- It estimates the production impact based on the earliest requirement date.
- It drafts a supplier email and a proposed new delivery date.
- The buyer approves or edits, then the approved change is posted through a controlled function.
Result: Chasing is consistent and documented, and buyers only touch the cases that matter.
Keeping data on-prem
ECC usually lives in a protected network segment, so the cleanest design keeps everything inside it. Run the agent runtime and an open-weight model (Llama, Qwen, Mistral or gpt-oss class) on a GPU server in the same zone or an adjacent one, and open only the RFC gateway port from the tool layer to the application server, with SNC encryption enabled if your Basis team supports it. Retrieval over SAP notes, work instructions and your own documents can sit in a local vector store. No ECC data crosses the firewall, which makes it easier for defense, aerospace and regulated electronics shops to align with their own data-handling obligations. The cost is that you own GPU capacity and model updates, which is a reasonable trade for plants with strict controls.
Security checklist
- Use a dedicated system user with a PFCG role restricted to named function modules, plants and company codes; review it with your SAP security team.
- Keep the first release read-only and send all write intent through a human approval step with a recorded approver.
- Enable SNC for RFC where possible and restrict gateway access with secinfo and reginfo files.
- Mask or exclude sensitive fields such as pricing conditions or HR data in the tool output, not in the prompt.
- Log tool calls and keep them for the same retention period as your other ERP change records.
Ways to get it done
Vendor tooling (SAP Joule, BTP services)
Effort: Low to medium, plus subscription cost and a Cloud Connector setup.
Better suited if you are already moving to S/4HANA or have a BTP subscription; ECC 6.0 coverage is limited and mostly relies on a connector.
Build in-house
Effort: Several weeks for a first read-only agent; ongoing prompt and tool maintenance.
Works when you have ABAP developers and a Python or Node team who can own the tool layer and the approval flow.
Work with a partner such as Netray
Effort: A scoped pilot of a few weeks, then extension job by job.
Useful when you want on-prem models, tool design and approval flow built together, with your SAP team reviewing authorizations.
Pitfalls
- !Letting the agent hit RFC_READ_TABLE on arbitrary tables. It is slow, brittle on wide tables and a security review headache.
- !Forgetting that custom Z fields and enhancements change what a standard BAPI returns; test against real plant data, not a sandbox client.
- !Giving write authority too early. A wrongly rescheduled PO or goods movement is much harder to unwind than a wrong summary.
- !Ignoring client and plant scoping, so one plant's agent sees another plant's costs.
- !Running heavy queries during MRP or month-end windows and slowing dialog users on the same application server.
Frequently asked questions
Can an AI agent write to SAP ECC safely?
Yes, if writes are narrow and approved. Expose specific functions for one action each, require a named approver, and log the request and result. Start read-only, then enable one low-risk write such as creating a notification before touching anything financial.
Do we need S/4HANA before adding AI agents?
No. BAPIs, RFC, IDocs and OData on a Gateway work on ECC 6.0 today. Building the tool layer around business functions rather than ECC internals also makes it easier to repoint at S/4HANA later.
Which language models work best?
For structured tool calling, current open-weight models of the Llama, Qwen, Mistral and gpt-oss families work well when served with vLLM. The quality of the tool design and the tests usually matters more than the specific model.
How is this different from SAP Joule?
Joule is tied to SAP's cloud portfolio and has limited reach into ECC. A custom agent layer talks to ECC directly, can run on-prem and covers your own Z-transactions, but you maintain it or work with a partner.
What does Basis need to do?
Create the technical user and role, open the RFC gateway path, confirm SNC if used, and monitor load from the integration. It is usually a few days of effort once the tool list is agreed.
Want AI agents working on your SAP ECC 6.0?
A free 30 minute assessment: we map the integration path for your version and setup, and where it should run.
Get a free assessment