ABAP Naming Convention Template
A naming standard keeps custom code searchable and reviewable, and it saves hours in code reviews and transports. This template generates a ready-to-adopt ABAP naming convention document with your namespace, area codes and owner, which you can export to Word or PDF.
Fill in
Z or Y, or a registered namespace such as /ACME/.
ABAP Naming Convention Template
ABAP Development Naming Standard
Company: Acme Precision Ltd Owner: Head of SAP Development Effective: 2026-10-20
Purpose: give every custom object a predictable name so that developers can find, review and transport it. Names use the prefix Z and an area code such as SD. Example package: ZSD_ORDERS.
1. Repository objects
| Object | Pattern | Example | Max length |
|---|---|---|---|
| Package | Z<AREA>_<TOPIC> | ZSD_ORDERS | 30 |
| Report program | ZR_<AREA>_<PURPOSE> | ZR_SD_OPEN_ORDERS | 40 |
| Class | ZCL_<AREA>_<PURPOSE> | ZCL_SD_PRICING | 30 |
| Interface | ZIF_<AREA>_<PURPOSE> | ZIF_SD_PRICING | 30 |
| Exception class | ZCX_<AREA>_<PURPOSE> | ZCX_SD_NO_PRICE | 30 |
| Function group | ZFG_<AREA>_<TOPIC> | ZFG_SD_UTILS | 26 |
| Function module | Z<AREA>_<ACTION> | ZSD_GET_PRICE | 30 |
| Transaction code | Z<AREA><NN> | ZSD01 | 20 |
2. Dictionary objects
| Object | Pattern | Example | Max length |
|---|---|---|---|
| Database table | ZT<AREA>_<NAME> | ZTSD_ORDER_EXT | 16 |
| Structure | ZS<AREA>_<NAME> | ZSSD_ORDER_LINE | 30 |
| Table type | ZTT_<AREA>_<NAME> | ZTT_SD_ORDER_LINE | 30 |
| Data element | ZDE_<AREA>_<NAME> | ZDE_SD_PRIORITY | 30 |
| Domain | ZDO_<AREA>_<NAME> | ZDO_SD_PRIORITY | 30 |
| CDS basic view | ZI_<Name> | ZI_SalesOrder | 30 |
| CDS consumption view | ZC_<Name> | ZC_SalesOrderList | 30 |
| Message class | Z<AREA> | ZSD | 20 |
3. Variables and parameters
| Kind | Prefix | Example |
|---|---|---|
| Local variable | lv_ | lv_matnr |
| Local structure | ls_ | ls_header |
| Local internal table | lt_ | lt_items |
| Local object reference | lo_ | lo_alv |
| Local data reference | lr_ | lr_data |
| Local constant | lc_ | lc_status_open |
| Global variable, structure, table | gv_, gs_, gt_ | gt_data |
| Class attribute (instance) | mv_, ms_, mt_, mo_ | mv_plant |
| Class attribute (static) | sv_, ss_, st_, so_ | sv_counter |
| Importing parameter | iv_, is_, it_, io_ | iv_matnr |
| Exporting parameter | ev_, es_, et_, eo_ | es_result |
| Changing parameter | cv_, cs_, ct_, co_ | ct_items |
| Returning parameter | rv_, rs_, rt_, ro_ | rv_valid |
| Field symbol | <lv_>, <ls_>, <lt_> | <ls_item> |
| Local type | ty_, ts_, tt_ | ty_item |
| Selection screen parameter | p_ | p_werks |
| Select-options | s_ | s_matnr |
4. Rules
1. Names are in English and describe the business meaning, not the technology. 2. Use meaningful names, avoid single letters except for loop counters. 3. Do not reuse standard SAP names or the SAP namespace. 4. One class has one purpose. Prefer classes and interfaces to new function groups. 5. Every custom object belongs to a package and a transport request. 6. Exceptions to this standard need approval by Head of SAP Development.
Approvals
This is a starting point, adapt it to your landscape and to any existing SAP-delivered or partner namespace rules. Length limits shown are the usual DDIC and repository limits, check them in your release. Prefix schemes such as lv_ and ls_ are a team choice, newer clean ABAP guidance suggests dropping some prefixes, so agree the rule once and apply it consistently.
Custom code clean-up review
Planning a move to S/4HANA? We can discuss reviewing your Z code base with you, as an optional follow-up.
Optional. The tool and every export work without this. No spam.
How to use the template
Enter your company name, the namespace prefix you use, an example area code and the owner of the standard. The tables update with your values. Review each row with your team and change patterns that conflict with your existing objects, because a standard that contradicts the system you already run will be ignored. Export it, attach it to your development guidelines and cite it in code review comments.
What a good ABAP naming standard covers
It covers three things: repository objects such as packages, programs and classes, dictionary objects such as tables, data elements and CDS views, and the prefixes inside the code itself. Length limits matter because database table names are limited to 16 characters, classes and function modules to 30, and programs to 40, so patterns must leave room for a meaningful name. Reserve the Z or Y namespace, or a registered namespace, to avoid collisions with SAP objects.
- Package and transport rules so objects are always assigned
- Class, interface and exception class patterns
- Variable, parameter and type prefixes inside code
Prefixes or no prefixes
Hungarian-style prefixes such as lv_ and ls_ are widespread in SAP projects and remain acceptable. Clean ABAP guidance suggests avoiding encodings that add little, and favours good descriptive names and small methods. Either choice works if it is consistent. What does not work is a mixed codebase where each developer picks their own. Decide, document and enforce it with ABAP Test Cockpit checks where possible.
Common mistakes
Teams write a long standard nobody reads, keep it outside the repository, or forget to set rules for CDS views, enhancement implementations and test classes. Others forget the 16 character table limit and find their pattern produces names that do not fit. Keep the document short, version it, and review it once a year when your release level changes.
Frequently Asked Questions
Should custom objects start with Z or Y?
Both are reserved for customers. Many companies use Z for production objects and Y for temporary or sandbox ones. A registered namespace in slashes is the alternative, used by partners and software vendors who deliver add-ons.
Are lv_ and ls_ prefixes still recommended?
They are still common and widely understood, but the Clean ABAP style guide sees them as optional. The key is to be consistent inside your organisation and to name by business meaning.
What are the length limits for custom objects?
Typical limits are 16 characters for transparent table names, 30 for data elements, structures, classes and function modules, 26 for function groups, and 40 for programs. Confirm them for your release when you define patterns.
How do I enforce the standard?
Use ABAP Test Cockpit checks for naming conventions, add the document to your code review checklist, and reject transports that break it. Manual review alone fades quickly as the team grows.
If you are standardising a large custom code base before an S/4HANA move, we can discuss how AI-assisted analysis could help you find and classify what is worth keeping.
Related Tools
ABAP Code Review Checklist
A practical review checklist for ABAP changes: database access, security, error handling, structure and S/4HANA compatibility.
SAPABAP CDS View Skeleton Generator
Fill in table, fields, aliases and one association to get CDS view DDL in both the classic DDIC-based and the view entity syntax.
SAPABAP Internal Table Declaration Generator
Choose table kind, key and line type and get the DATA declaration, a local TYPES version and the common table operations.
SAPSAP System Fields Reference (SY-SUBRC, SY-DATUM and more)
A searchable list of the ABAP system fields in structure SYST with data type, meaning and a typical use in code.
More SAP tools
See all- SAP Sales Document Types Reference
- SAP Pricing Procedure Design Worksheet
- SAP Item Category Determination Reference
- SAP Delivery Block Reasons Template
- SAP Credit Management Checklist
- SAP Output Determination Checklist
- SAP Billing Types Reference
- SAP Incompletion Log Checklist
- SAP SD Tables Reference (VBAK, VBAP, LIKP, VBRK and More)