# AI for ABAP Development: A Private Code LLM That Knows Your Z Objects

> Source: https://netray.co/erp-ai/sap-abap-ai-code-assistant-private-llm
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: AI for ERP

## Short answer

An LLM can help ABAP developers explain legacy Z programs, draft SELECT statements and BAPI calls, write unit tests and fix ATC findings. SAP's own ABAP AI capabilities target ABAP Cloud and recent releases; for classic ABAP on ECC or on-prem S/4HANA, a private code model with retrieval over your own custom code and data dictionary does the same work without sending source code outside your network.

## Kind

use-case

## Erp Family

sap

## Erp Products

- SAP ECC 6.0
- SAP S/4HANA
- SAP NetWeaver AS ABAP

## Industries

- Manufacturing
- Aerospace
- Defense
- Electronics

## Region

Global

## Persona

SAP Development Lead

## Eyebrow

ABAP + private LLM

## Intro

Most SAP shops carry thousands of custom objects: Z reports written in 2006, user exits nobody dares touch, enhancement implementations stacked three deep, and function modules whose only documentation is the transport description. The developers who wrote them have moved on, and every change request starts with an afternoon of reading code in SE80 or ADT to work out what it actually does.

General chat tools can write plausible ABAP, but they do not know your tables, your naming conventions or the fact that your company code logic lives in a Z function group. They also invite developers to paste proprietary source into a public service, which many security teams have already banned. The useful version of AI for ABAP is grounded: it retrieves your own DDIC definitions, custom code and coding guidelines before it answers.

SAP is investing heavily here. Joule for developers and the ABAP AI capabilities in ABAP Development Tools target ABAP Cloud and SAP BTP, ABAP environment, and SAP Build Code adds generative AI for CAP applications. If you develop mostly in ABAP Cloud on a supported release and your licences cover it, start there. The gap is the large estate of classic ABAP on ECC 6.0 and on-prem S/4HANA, where those features are limited or unavailable.

This page explains how a private code assistant for ABAP works, which jobs it handles well, where it still needs a senior developer, and how to keep its output inside your normal transport and code review process.

## Pain Points

### Legacy Z code nobody understands

**Detail:** Custom reports, user exits and BAdI implementations accumulate for decades. Before any change, a developer must reverse-engineer the logic, often across includes and function groups, which turns a two-hour fix into a two-day investigation.

### Public chat tools are banned for source code

**Detail:** Pasting ABAP into a public assistant exposes pricing logic, customer-specific rules and table structures. Many SAP security policies prohibit it, so developers either ignore the rule or get no help at all.

### Generic models do not know your data dictionary

**Detail:** An unaided model guesses field names, invents tables and writes SELECT statements that do not compile against your system. Without retrieval over DD03L, DD02L and your Z tables, its output costs more time than it saves.

### ATC and S/4HANA readiness findings pile up

**Detail:** Custom code checks for S/4HANA produce long lists of findings: obsolete tables, field length extensions, simplification items. Each needs a small, careful fix, and the volume overwhelms a small team.

### Documentation and unit tests are always last

**Detail:** ABAP Unit coverage in most custom estates is close to zero and technical documentation lags behind the code. Both are tedious to write by hand and are the first things cut under deadline pressure.

## Use Cases

### Explain a legacy program

**Description:** The developer points the assistant at a Z report or function module. It reads the source, its includes and the tables it touches, and writes a plain explanation of inputs, logic, side effects and risky statements.

**Erp Objects:** Z programs, includes, function groups (TFDIR, TADIR), DDIC tables (DD02L, DD03L)

**Outcome:** Investigation time on unfamiliar objects drops from hours to a short review of a generated summary.

### Draft SELECTs and BAPI calls against real tables

**Description:** Ask for open purchase order items for a plant or a goods movement posting. The assistant retrieves the actual table and BAPI signatures from your system and drafts code with correct field names and commit handling.

**Erp Objects:** EKKO, EKPO, EKET, MSEG/MATDOC, BAPI_GOODSMVT_CREATE, BAPI_TRANSACTION_COMMIT

**Outcome:** First drafts compile far more often because field names come from your DDIC, not from memory.

### Fix S/4HANA custom code findings

**Description:** Feed ATC results from the S/4HANA readiness checks. The assistant groups similar findings, proposes the fix pattern for each group and drafts the change for a developer to review.

**Erp Objects:** ATC check runs, simplification items, MATDOC vs MKPF/MSEG, ACDOCA vs BSEG, field length extension for MATNR

**Outcome:** Repetitive remediation moves faster; developers spend their time on the findings that need judgement.

### Generate ABAP Unit tests

**Description:** For a method or function module, the assistant drafts ABAP Unit test classes with test doubles for database access, covering the main paths and edge cases it finds in the code.

**Erp Objects:** ABAP Unit, test seams, CL_OSQL_TEST_ENVIRONMENT, local test classes

**Outcome:** Teams start building coverage on the objects they change most, instead of none at all.

### Write technical documentation from code

**Description:** Generate a technical specification for an existing enhancement, including the user exit or BAdI, triggering transaction, tables read and written, and authorisation checks performed.

**Erp Objects:** Enhancement implementations, BAdIs, customer exits (CMOD/SMOD), AUTHORITY-CHECK statements

**Outcome:** Documentation exists for the objects that matter, generated in minutes and corrected by the owner.

### Review transports before release

**Description:** Before a transport is released, the assistant summarises what changed, flags risky patterns such as SELECT without WHERE, missing AUTHORITY-CHECK or hard-coded company codes, and links them to your guidelines.

**Erp Objects:** Transport requests (E070, E071), version management, code inspector variants

**Outcome:** Reviewers get a structured first pass, so human review focuses on logic rather than style.

### Answer how-do-we-do-this questions

**Description:** A new developer asks how the company handles output determination or pricing exits. The assistant searches your custom code and internal guidelines and points to the existing implementations.

**Erp Objects:** Custom code base, naming conventions, internal development standards documents

**Outcome:** Onboarding time shortens because institutional patterns are searchable.

## Architecture

**Overview:** The assistant runs an open-weight code model on your own GPUs and retrieves context from an index built from your custom code, DDIC metadata and development guidelines. It integrates with the developer's IDE and never writes to the SAP system directly.

**Layers:**

#### Code and metadata extraction

**Detail:** A scheduled job exports custom objects (TADIR entries in the customer namespace), source via standard read function modules or abapGit, and DDIC definitions for tables, structures and BAPI interfaces.

#### Code-aware index

**Detail:** Source is chunked by method, form and function module rather than by character count, with metadata for package, object type and last transport, so retrieval returns whole logical units.

#### Private code model

**Detail:** An open-weight coding model in the Qwen Coder or similar class, served with vLLM on on-prem GPUs. A mid-size model is usually sufficient for ABAP drafting when retrieval supplies the right context.

#### IDE integration

**Detail:** Developers work in ADT (Eclipse) or VS Code with an extension that calls the private endpoint. Suggestions appear as drafts; nothing is activated or transported automatically.

#### Governance and logging

**Detail:** Every prompt and response is logged with user and object, and generated code passes through ATC and your normal peer review before any transport is released.

## Deployment Options

### On-prem GPU server

**Fit:** Defense, aerospace and regulated manufacturers where source code is controlled information.

**Detail:** One or two data center GPUs serve a development team comfortably. Source code and prompts never leave the network.

### Private cloud tenancy

**Fit:** Companies already running SAP in a hyperscaler under their own account.

**Detail:** The model runs in your own VPC next to the SAP landscape, with private endpoints and no shared multi-tenant inference service.

### SAP-native first, private for the rest

**Fit:** Teams with significant ABAP Cloud development on current releases.

**Detail:** Use SAP's ABAP AI features where licensed and supported, and the private assistant for classic ABAP on ECC and older S/4HANA systems.

## Compliance

### When custom code embeds controlled technical data or customer program logic, keeping inference on-prem avoids exporting it to a third-party service. The customer remains responsible for its own export control determinations.

**Framework:** ITAR / EAR

### Generated code follows the same transport path, approvals and segregation of duties as hand-written code. The assistant has no transport or activation rights.

**Framework:** SOX change management

### Access to the assistant uses existing identity, prompts are logged, and the index lives inside the controlled environment, which supports the customer's own CUI handling obligations.

**Framework:** NIST SP 800-171 / CMMC

### A private endpoint gives developers a sanctioned tool, which is usually more effective than a ban on public chat tools that people work around.

**Framework:** Internal source code policy

## Integration Notes

- Extract custom objects by package or namespace (Z*, Y*, /yourns/) using TADIR, and refresh nightly or on transport import.
- abapGit serialisation is a practical way to export source and DDIC objects in a text format the indexer can read.
- Include BAPI and function module interfaces (FUPARAREF) so the model sees real parameter names when drafting calls.
- Index your development guidelines, naming conventions and code inspector variants so suggestions match house style.
- Run generated code through ATC with your standard check variant before review; treat AI output as untrusted input.
- Keep the assistant read-only against SAP: it reads exported code and metadata, it never logs on to activate or transport.

## Product Fit

### Custom build

**Why:** ABAP assistance is a bespoke build: code extraction, a code-aware index and IDE integration tuned to your custom estate and guidelines.

### ERPray

**Why:** Where developers also need to check live data while coding, ERPray answers read-only questions against the SAP system with the query shown.

## Engagement

### Code estate assessment

**Duration:** 1-2 weeks

**Deliverables:**

- Custom object inventory by package and age
- Developer interviews on top time sinks
- Security and source code policy review

### Index and model setup

**Duration:** 2-3 weeks

**Deliverables:**

- Extraction pipeline for code and DDIC
- Code-aware index with metadata
- Private model endpoint on your GPUs

### Pilot with one team

**Duration:** 3-4 weeks

**Deliverables:**

- IDE integration for pilot developers
- Prompt patterns for explain, draft, test and remediate
- Measured comparison on real change requests

### Rollout and governance

**Duration:** 2-4 weeks

**Deliverables:**

- Logging and review workflow
- ATC gating for generated code
- Training and usage guidelines

## Buyer Questions

- Does the assistant retrieve our actual DDIC definitions, or does it rely on the model's memory of standard SAP?
- Where does our source code go, and is any of it used to train a shared model?
- How does it handle classic ABAP on ECC 6.0 as well as ABAP Cloud?
- Can it ever activate, transport or execute code in our system?
- How is generated code checked before it reaches a transport?
- Which of these features does SAP already include in our licences, and what does a private assistant add beyond them?
- What GPU capacity does a team of our size need?

## Faq

### Can ChatGPT write ABAP?

**Answer:** General models write plausible ABAP and know common standard tables and BAPIs. The problems are that they guess field names in your custom tables, do not know your Z function groups or conventions, and require pasting proprietary code into an external service. For occasional syntax questions that is acceptable to some teams. For real work on your custom estate, an assistant grounded in your own DDIC and code produces drafts that compile more often and keeps source inside your network.

### What does SAP offer for AI in ABAP development?

**Answer:** SAP offers Joule for developers and ABAP AI capabilities in ABAP Development Tools, aimed at ABAP Cloud on SAP BTP and recent S/4HANA releases, plus generative AI in SAP Build Code for CAP and full-stack apps. Availability depends on release, edition and licence, so check with SAP. If your development is mostly ABAP Cloud on a supported release, SAP's tooling is the natural first choice. Classic ABAP on ECC is where a private assistant fills the gap.

### Which model is good enough for ABAP?

**Answer:** ABAP is a smaller language in public training data than Java or Python, so retrieval matters more than raw model size. Current open-weight coding models in the 14B to 32B parameter range handle ABAP drafting well when given your table definitions and similar existing code. Larger models help with long explanations of complex legacy programs. The practical approach is to pilot two candidates on your own change requests and measure compile rate and review effort.

### Will it help with S/4HANA custom code migration?

**Answer:** Yes, this is one of the strongest uses. ATC with S/4HANA readiness checks produces many repetitive findings, such as direct reads of replaced tables, MATNR length issues and obsolete transactions. The assistant can cluster findings, propose a fix pattern per cluster and draft changes. A developer still reviews each change, and functional decisions about whether to keep, retire or rebuild custom code remain human.

### Is generated ABAP safe to transport?

**Answer:** Only after the same checks as any other code: ATC with your check variant, peer review, unit tests where practical and testing in QA. The assistant should have no ability to activate or release transports. Treat its output as a draft from a capable but unreliable junior developer: often right, sometimes confidently wrong, especially around commit handling, authorisation checks and performance on large tables.

### How do you get our code out of SAP for indexing?

**Answer:** Common options are abapGit serialisation by package, standard read function modules for source and DDIC metadata, or an export job that writes source to a file share. The extraction runs under a technical user with read-only development authorisation and refreshes nightly or after transport imports. The index stays inside your environment alongside the model.

### What does it cost to run?

**Answer:** For a development team of five to thirty people, a single server with one or two data center GPUs is usually enough, since coding assistance has bursty, modest concurrency. The bigger cost is the initial build: extraction, indexing, IDE integration and tuning prompts to your conventions. Compare that against developer time spent reverse-engineering legacy code and remediating S/4HANA findings.

## Search terms

ai for abap programming, sap abap llm, chatgpt sap abap, abap ai code assistant, llm for abap development, private llm abap, ai abap code generation, abap unit test generation ai, sap custom code migration ai, sap build code ai, joule for developers abap, on-prem ai abap

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
