SAPFree templatePDF, Excel, Word exportSAP ECC / S/4HANA

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/.

Live preview
Download:

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

ObjectPatternExampleMax length
PackageZ<AREA>_<TOPIC>ZSD_ORDERS30
Report programZR_<AREA>_<PURPOSE>ZR_SD_OPEN_ORDERS40
ClassZCL_<AREA>_<PURPOSE>ZCL_SD_PRICING30
InterfaceZIF_<AREA>_<PURPOSE>ZIF_SD_PRICING30
Exception classZCX_<AREA>_<PURPOSE>ZCX_SD_NO_PRICE30
Function groupZFG_<AREA>_<TOPIC>ZFG_SD_UTILS26
Function moduleZ<AREA>_<ACTION>ZSD_GET_PRICE30
Transaction codeZ<AREA><NN>ZSD0120

2. Dictionary objects

ObjectPatternExampleMax length
Database tableZT<AREA>_<NAME>ZTSD_ORDER_EXT16
StructureZS<AREA>_<NAME>ZSSD_ORDER_LINE30
Table typeZTT_<AREA>_<NAME>ZTT_SD_ORDER_LINE30
Data elementZDE_<AREA>_<NAME>ZDE_SD_PRIORITY30
DomainZDO_<AREA>_<NAME>ZDO_SD_PRIORITY30
CDS basic viewZI_<Name>ZI_SalesOrder30
CDS consumption viewZC_<Name>ZC_SalesOrderList30
Message classZ<AREA>ZSD20

3. Variables and parameters

KindPrefixExample
Local variablelv_lv_matnr
Local structurels_ls_header
Local internal tablelt_lt_items
Local object referencelo_lo_alv
Local data referencelr_lr_data
Local constantlc_lc_status_open
Global variable, structure, tablegv_, gs_, gt_gt_data
Class attribute (instance)mv_, ms_, mt_, mo_mv_plant
Class attribute (static)sv_, ss_, st_, so_sv_counter
Importing parameteriv_, is_, it_, io_iv_matnr
Exporting parameterev_, es_, et_, eo_es_result
Changing parametercv_, cs_, ct_, co_ct_items
Returning parameterrv_, rs_, rt_, ro_rv_valid
Field symbol<lv_>, <ls_>, <lt_><ls_item>
Local typety_, ts_, tt_ty_item
Selection screen parameterp_p_werks
Select-optionss_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

Prepared by / Date
SAP development lead / Date
SAP architect / Date

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.