Make your AI write ABAP that actually activates.
Ready-made rules for Cursor, Claude Code, GitHub Copilot, Windsurf and any AGENTS.md agent, written by an ABAP developer and checked against SAP's own documentation.
The problem: LLMs are confident and wrong in ABAP
Invented objects
Function modules, BAPIs and CDS views that don't exist or aren't released for ABAP Cloud.
Wrong release
INTO TABLE @DATA(...) on 7.40 SP05, += on 7.50, define view instead of view entities.
Silent data bugs
FOR ALL ENTRIES on an empty table reads the whole table. SELECT SINGLE without the full key.
RAP & cloud breakers
COMMIT WORK in behavior pools, sy-datum and WRITE in ABAP Cloud.
What's inside
303 rules across 20 topics + 8 agent skills
Each rule is one short, checkable instruction (a do/don't, a release fact or an obsolete statement with its replacement), not an essay. In English and Portuguese, for every major AI coding tool.
The 20 rule topics
Foundations
- 00-coreCore guardrails also in lite
Pin down release and language version first, never invent SAP objects, Clean ABAP defaults, read-only MCP use. Always on. - 10-release-syntaxSyntax by release also in lite
Which syntax exists where, from 7.40 SP02 to 7.55, so 7.40/7.50 code gets no newer syntax. - 50-clean-abapClean ABAP
High-signal rules from SAP's styleguide that models break most: signatures, booleans, exceptions, tables. - 55-error-handlingError handling
Exception classes with T100 message texts, keepingprevious, RAP messages, application log. - 60-obsoleteObsolete statements also in lite
15 legacy statements an AI must not generate, each with its modern replacement. - 90-llm-pitfallsLLM self-check also in lite
10 checks the agent runs before answering: invented FMs, BAPI RETURN handling, mixed releases. Always on.
Data, performance and transactions
- 20-abap-sqlABAP SQL also in lite
Strict mode and@escaping, the FOR ALL ENTRIES empty-table trap, basic performance patterns. - 25-performancePerformance
Measure first (ST05, SAT), noSELECTor EML in loops, mass changes, table buffer, internal tables. - 46-amdpAMDP and code pushdown
When AMDP is really needed, SQLScript method rules, client handling, ABAP Cloud limits. - 65-luw-locksSAP LUW, locks and update tasks
OneCOMMIT WORKper SAP LUW, update function modules, lock objects, controlled SAP LUW, bgPF. - 67-bapis-apisBAPIs, RFC and released APIs
Released APIs first, BAPI RETURN and commit handling, X flag structures, RFC exceptions.
ABAP Cloud, clean core and security
- 30-abap-cloudABAP Cloud & clean core
Released APIs only, cloud replacements forsy-datum,WRITEand classic FMs, clean core levels A–D. - 35-clean-core-extensibilityClean core extensibility
Key user, developer or side-by-side extensibility, release contracts C0–C4, BAdIs, custom fields. - 27-securitySecurity
AUTHORITY-CHECK(ABAP SQL checks nothing), CDS access control, SQL injection, XSS, no hard-coded secrets.
RAP, CDS and Fiori
- 40-rap-cdsRAP & CDS
View entities, BDEF strict mode, behavior pools withoutCOMMIT WORK, EML done right. - 42-cds-advancedAdvanced CDS
Cardinality, parameters and session variables, amounts and quantities, table functions, custom entities. - 44-odata-fioriOData and Fiori Elements
Service definition and binding, OData V4 vs V2, transportable publishing, metadata extensions, UI annotations.
Testing and S/4HANA
- 70-abap-unitABAP Unit
Test classes, asserts and test doubles that really isolate the database and dependencies. - 80-s4-vs-eccS/4HANA vs ECC
MATDOC, ACDOCA, Business Partner, 40-character MATNR and other data model changes that break code. - 85-s4-migrationECC → S/4HANA code migration
Scoping (SCMON/SUSG), ATC readiness checks, simplification items and their SAP Notes, typical fixes.
The 8 agent skills
- abap-rap-bo
Create a managed RAP business object step by step: CDS view entities, BDEF, behavior pool, projection, service. - abap-cds-view
Create or review a CDS view entity with associations, parameters, semantics, access control and UI metadata. - abap-odata-service
Expose CDS or a RAP BO as an OData service: definition, binding, publishing, Fiori Elements annotations. - abap-refactor-legacy
Refactor a legacy report or function module to Clean ABAP in small, behaviour-preserving steps. - abap-unit-tests
Write ABAP Unit tests with test doubles for the database, CDS and other dependencies. - abap-performance-review
Review code for database and internal table performance, with prioritized findings and fixes. - abap-s4-migration
Plan and fix custom code for an ECC → S/4HANA conversion, from usage scoping and ATC checks to fixes per simplification item. - abap-clean-core-review also in lite
Review code for Clean ABAP, ABAP Cloud readiness and clean core level A–D, with a prioritized findings table.
Also in the box
Every tool, one source
Cursor .mdc rules, Copilot instructions + prompt files, Windsurf rules + workflows and Claude Code skills, each with all 20 topics. AGENTS.md + the abap-rules/ folder for Claude Code, Codex and other agents. Plain prompts for ChatGPT / Joule chat.
Short on purpose
Research shows bloated context files hurt agents. AGENTS.md keeps the 10 core topics inline (about 210 lines) and points to the other 10 in abap-rules/, read on demand. Tool rules load by file type.
Sources included
Each rule maps to the Clean ABAP styleguide, the ABAP Keyword Documentation, SAP cheat sheets or the Cloudification Repository.
Generator included
Add your house rules (prefixes, namespaces, allowed BAPIs) and rebuild every format with one command.
What the 19 € pack catches that lite does not
Three mistakes AI assistants make in ABAP, each covered by a rule that is only in the paid pack. For each: the real rule text, what an assistant typically writes, and what it writes with the rule loaded. The FOR ALL ENTRIES guard is also in the free lite edition. These three are not.
BSEG and ACDOCA instead of released CDS views
- Finance: the Universal Journal
ACDOCAis the line-item source of truth in S/4HANA Finance. Old totals/index tables are compatibility views; do not write to them. - Prefer released CDS views over table access. They abstract these changes and are the clean-core path.
- Data model changes (see the S/4 vs ECC rules):
VBUK/VBUPstatus reads,KONV,BSEGaccess patterns,MKPF/MSEG. Switch to the new tables, compatibility views (read only) or released CDS views as the note says. - No direct reads of SAP tables (
MARA,VBAK, ...). Use released CDS views (typicallyI_*interface views) after confirming they are released.
Illustration, not a quote from the pack. The pack tells the agent to use released CDS views instead of reading BSEG or ACDOCA directly. It does not name I_JournalEntryItem or the 0L ledger: those come from our free guide on replacing BSEG. Check view and field names in your release before you rely on them. Guide: replacing SELECT on BSEG →
Lite does not mention BSEG, ACDOCA or released finance CDS views.
RAP: COMMIT WORK inside a behavior pool
- Never use
COMMIT WORK,ROLLBACK WORK,COMMIT ENTITIESorROLLBACK ENTITIESinside handler or saver methods. RAP owns the LUW. - Behavior pool: implement only the methods the BDEF declares. Report errors via
failed/reportedwith%tky. No COMMIT/ROLLBACK statements. UseREAD ENTITIES ... IN LOCAL MODE.
Illustration, not pack text.
Lite has no RAP or EML rules. COMMIT WORK in a behavior pool is a paid-rule catch.
ABAP SQL without AUTHORITY-CHECK
- ABAP SQL performs no authorization checks. Before reading or changing business data in classic ABAP, check with
AUTHORITY-CHECK OBJECT 'obj' ID 'field' FIELD value ...(up to 10 fields;DUMMYonly for fields you deliberately skip). - Evaluate
sy-subrc: 0 = authorized, 4 = not authorized, 12 = no authorization for the object, 40 = invalid user (withFOR USER). Treat everything except 0 as "deny". - Do not invent authorization objects or field names. Ask for them, or tell the user to look them up (SU21). In ABAP Cloud the object must be given as a literal.
Illustration, not pack text.
Lite has no security topic. ABAP SQL happily returns rows the user is not allowed to see.
A real rule from the pack: 80-s4-vs-ecc
Verbatim from the v1.1.0 pack (S/4HANA vs ECC data model). Paid only, not in lite.
A real agent skill: abap-rap-bo
Verbatim excerpt (steps 3 and 4 and the closing line). One of 8 skills. Lite has only abap-clean-core-review.
What you download: the v1.1.0 ZIP
285 files, English and Portuguese, every tool format, plus the generator and SOURCES.md. Folder and file names are real; tool folders are collapsed.
Pricing
ABAP for Agents Rules Pack
- Version 1.1: 303 rules in all 20 topics
- All 8 agent skills (RAP BO, CDS view, OData service, legacy refactor, ABAP Unit, performance review, S/4HANA migration, clean core review)
- English and Portuguese
- Cursor, Claude Code, Copilot, Windsurf, Codex, AGENTS.md
- Generator for your house rules + SOURCES.md
- Free updates
Use it in unlimited own and client projects. You just can't resell or republish the pack.
Checkout is handled by Lemon Squeezy. You get a VAT invoice. At checkout you can enter your company name and tax ID / NIF so the invoice is valid as a company expense. VAT is added when it applies in your country.
Free lite (MIT)
- 5 of the 20 topics (about 70 rules)
- 1 skill: clean core review
- EN + PT, all tool formats
- Public GitHub repo
Who writes this
These rules are written by an ABAP developer who works on ECC and S/4HANA systems, including custom-code migrations, and on internal APIs and tools. Every rule is checked against SAP's own documentation (ABAP Keyword Documentation, the Clean ABAP styleguide, SAP Help and the Cloudification Repository), and the sources are included in the pack. Independent product, not affiliated with SAP SE. The brand is anonymous on purpose: the work is in the rules, not in a personal profile.
Free lite vs Rules Pack
| Free lite | Rules Pack | |
|---|---|---|
| Rules | about 70 | 303 |
| Topics | 5: core, release syntax, ABAP SQL, obsolete statements, LLM self-check | all 20, adds performance, security, ABAP Cloud & clean core extensibility, RAP, CDS, OData & Fiori, AMDP, error handling, LUW & locks, BAPIs, Clean ABAP, ABAP Unit, S/4HANA vs ECC and migration |
| Agent skills | 1: clean core review | 8: + RAP BO, CDS view, OData service, legacy refactor, ABAP Unit tests, performance review, S/4HANA migration |
| Tool formats | all | all |
| Languages | EN + PT | EN + PT |
| Generator for house rules | – | ✓ |
| Source per rule (SOURCES.md) | – | ✓ |
| License | MIT | unlimited own and client projects |
| Updates | on GitHub | free v1.x updates |
Guides
Practical, source-backed guides on getting AI assistants to write correct ABAP.
ABAP mistakes AI coding assistants make, and how to prevent them
The pillar guide. Nine repeat mistakes, why models make them, and the rule or code pattern that prevents each one.
FOR ALL ENTRIES with an empty table: the trap and the fix
Why an empty driver table reads the whole database table, the one-line guard, the silent duplicate-row trap, and the alternatives.
Cursor rules for SAP ABAP: a setup guide
Project rules in .cursor/rules for ABAP: rule types, glob patterns for abapGit and ADT files, an always-on core rule and a quick test.
Using Claude Code and AGENTS.md with SAP ABAP
One AGENTS.md for every agent, a CLAUDE.md that imports it, an on-demand review skill, and how to check that Claude Code loaded them.
GitHub Copilot custom instructions for ABAP
copilot-instructions.md for the core rules, applyTo-scoped instruction files for ABAP sources, a review prompt file, and where each one works.
SAP's ADT MCP server with Claude Code, GitHub Copilot and Codex
What SAP's ADT MCP server in ABAP development tools for VS Code is, how to connect Claude Code, Copilot and Codex, and a read-only-first setup.
Column totals in a Fiori Elements List Report with RAP and CDS
How to get a totals row in an OData V4 List Report from RAP: the two CDS annotations, currencies and units, the table type, and what to check when the sum doesn't show.
Replacing SELECT on BSEG in S/4HANA: ACDOCA, I_JournalEntryItem and I_OperationalAcctgDocItem
Why the ATC flags reads on BSEG in S/4HANA, what BSEG still holds, when to move to I_JournalEntryItem or I_OperationalAcctgDocItem, the ledger trap and when an exemption is the right answer.
Extracting data from SAP S/4HANA Cloud with released CDS views
How SAP S/4HANA Cloud exposes data for extraction: C1-released CDS views with @Analytics.dataExtraction, the CDS_EXTRACTION route into Datasphere, key views and the A_ OData API limits.
How to check if a CDS view is released and extraction-enabled in your S/4HANA Cloud tenant
How to verify in your own S/4HANA Cloud tenant that a CDS view is C1-released and extraction-enabled: what the Accelerator Hub can tell you, View Browser, I_DataExtractionEnabledView, the allowlist, and the load test.
FAQ
Does this work with SAP Joule?
The rules target Cursor, Claude Code, GitHub Copilot, Windsurf and AGENTS.md agents. For Joule chat, use the included plain prompts. SAP does not document whether Joule reads rule files.
Does it work with ECC, or only S/4HANA and ABAP Cloud?
Both. The core rule makes the agent establish product, release and language version first, and the release table keeps 7.40/7.50 code free of newer syntax.
Can the AI still ignore the rules?
Yes. Rules are guidance, not enforcement. They are designed to cut repeat mistakes, but ATC and ABAP Unit stay your gate, and the rules tell the agent to run them via an MCP server when one is available.
Is it safe to use with the ADT MCP server?
The rules tell agents to use MCP read-only (look up objects, run checks) and never use write tools without your explicit consent.
Can I use it in client projects?
Yes, in unlimited own and client projects. You just can't resell or republish the pack itself.
Is this affiliated with SAP?
No. It's an independent product. SAP, ABAP and S/4HANA are trademarks of SAP SE.