ABAP Naming Conventions

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 13

ABAP NAMING CONVENTIONS

Version 2.0 Release date 26-Feb-2017

Revision history
Version Date Description Author
2.0 26-Feb-2017 Separate document for naming conventions for easy Vasan Linga Durai.C
document maintenance purpose. This initial version
created from information contained in “ABAP
Development standards and naming conventions”
document Version 1.0.

Review history
Version Date Reviewer comments Reviewed by

Approval history
Version Date Approver comments Approved by

Page 1 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

Contents
SCOPE.................................................................................................................................................................................................4

SHORT FORMS AND FORMATTING NOTATIONS...................................................................................................................4

1. ABAP WORKBENCH OBJECT NAMING CONVENTIONS.............................................................................................5


 DEVELOPMENT CLASS (PACKAGE)...........................................................................................................................................5
 TEST PROGRAMS.......................................................................................................................................................................5
 REPORT PROGRAMS..................................................................................................................................................................5
 INTERFACE PROGRAMS.............................................................................................................................................................5
 CONVERSION PROGRAMS..........................................................................................................................................................5
 INCLUDE PROGRAMS.................................................................................................................................................................5
 SUBROUTINE POOL PROGRAMS.................................................................................................................................................5
 MODULE POOL PROGRAMS.......................................................................................................................................................5
 FUNCTION GROUPS...................................................................................................................................................................5
 FUNCTION MODULES & ITS INTERFACE COMPONENTS.............................................................................................................6
 FORM PRINT PROGRAMS...........................................................................................................................................................6
 FORM – SAPSCRIPT & SMARTFORM.......................................................................................................................................6
 FORM – STYLE & SMARTSTYLE...............................................................................................................................................6
 STANDARD TEXTS.....................................................................................................................................................................6
 PROGRAM VARIANTS................................................................................................................................................................6
 ALV LAYOUT VARIANTS...........................................................................................................................................................6
 COPIES OF STANDARD PROGRAMS OR FORMS...........................................................................................................................6
 TRANSACTION CODES...............................................................................................................................................................6
 MESSAGE CLASS AND MESSAGE NUMBERS...............................................................................................................................6
2. ABAP DICTIONARY OBJECT NAMING CONVENTIONS..............................................................................................7
 DOMAIN....................................................................................................................................................................................7
 DATA ELEMENT.........................................................................................................................................................................7
 STRUCTURES AND TABLE TYPES..............................................................................................................................................7
 TRANSPARENT TABLES..............................................................................................................................................................7
 DATABASE VIEWS.....................................................................................................................................................................7
 HELP VIEWS (SEARCH HELP)....................................................................................................................................................7
 POOL TABLES AND CLUSTER TABLES.......................................................................................................................................7
 LOGICAL DATABASE.................................................................................................................................................................7
 FIELDS IN STRUCTURE/TABLE TYPE/TRANSPARENT TABLE.....................................................................................................7
 LOCK OBJECTS..........................................................................................................................................................................7
 DATABASE TABLE SECONDARY INDEX......................................................................................................................................7
 APPEND STRUCTURES...............................................................................................................................................................7
3. ABAP OTHER MISCELLEANEOUS OBJECT NAMING CONVENTIONS...................................................................8
 AREA MENU..............................................................................................................................................................................8
 SAP MEMORY PARAMETERS (SPA/GPA)..................................................................................................................................8
 NUMBER RANGE OBJECT..........................................................................................................................................................8
 CHANGE DOCUMENT................................................................................................................................................................8
 ENHANCEMENT – SMOD/CMOD PROJECT.............................................................................................................................8
 ENHANCEMENT – BADI DEFINITION - IMPLEMENTATION........................................................................................................8
 BUSINESS OBJECTS AND COMPONENTS.....................................................................................................................................8
 CLASSES...................................................................................................................................................................................8
 METHODS.................................................................................................................................................................................8
 BASIC IDOC TYPE....................................................................................................................................................................8
 IDOC TYPE...............................................................................................................................................................................8
 IDOC SEGMENT TYPE..............................................................................................................................................................8
 BAPI........................................................................................................................................................................................8
 QUERY INFOSET.......................................................................................................................................................................8
 QUERY USER GROUP................................................................................................................................................................9
 QUERY......................................................................................................................................................................................9
 AUTHORIZATION OBJECT CLASS...............................................................................................................................................9

Page 2 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

 AUTHORIZATION OBJECT..........................................................................................................................................................9
 TRANSPORT REQUEST DESCRIPTION.........................................................................................................................................9
 LSMW, SXDA/SXDB PROJECTS/SUBPROJECTS.....................................................................................................................9
 APPLICATION SERVER FILENAMES............................................................................................................................................9
 BDC SESSION...........................................................................................................................................................................9
4. PROGRAM HEADER DOCUMENTATION BLOCK........................................................................................................10

5. SAMPLE PROGRAM DOCUMENTATION BLOCK.........................................................................................................11

6. ABAP PROGRAM DATA NAMING CONVENTIONS.......................................................................................................12

Page 3 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

Scope

Scope of this document is to describe naming conventions for ABAP developments and its components.

Short forms and formatting notations


Client Identifier
<CA> C-clss initial,A-client initial

Application area
Materials management MM
Production planning and control PP
Quality management QM
Sales and distribution SD
Finance FI
Controlling CO
Asset management AM
Investment management IM
Treasury TR
Plant maintenance PM
Project system PS
Human resource HR
Personnel time management PT
Cross applications CA
Basis BA
Customer relationship CR
Customer service CS
Defence forces & public security DF
Enterprise portal EP
Industry specific component IS
Net-Weaver component NW
Public sector management PB
Product life-cycle management PL
Supply chain management SC
Supplier relationship management SR
General (Common across modules) GN

Development type
Forms, Form components and texts F
Reports R
Interfaces I
Conversions C
Enhancements E
Module pool M
Function group and Function module U
Data dictionary objects D
ALE, EDI and IDOC components A
Test developments T

 Naming conventions in this document contains following formatting conventions…


o Symbol enclosed in triangular bracket <> refers to one of acronyms and shall be replaced with appropriate
value or short form.

Page 4 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

o Symbol enclosed in square bracket [] refers to optional part of the naming convention and shall be
replaced with appropriate value or short form when decided to opt. Such optional parts when adopted
shall be consistent throughout the implementation.

Page 5 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

1. ABAP Workbench Object naming conventions

 Development class (Package)

Z<CA><Application area>[_Development type]

Note: SAP provided development class $TMP shall not be used for any kind of developments.
 Test programs

Z<CA><Developer ID>_<Text to represent use>_nn


Where nn is sequential number between 01 to 99

Note: All test developments shall be included in proper transport request with description as “Test – Not to be
transported”.
 Report programs

Z<CA><Application area>R_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Interface programs

Z<CA><Application area>I_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Conversion programs

Z<CA><Application area>C_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Include programs

Z<CA><Application area>N_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Subroutine pool programs

Z<CA><Application area>S_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Module pool programs

Main program: SAPMZ<CA><Application area>T_<Text to represent use>_nn


Where nn is sequential number between 01 to 99

Include for data declaration: Z<CA><Application area>N_<Text to represent use>_TOPnn


Where nn is sequential number between 01 to 99

Include for PBO modules: Z<CA><Application area>N_<Text to represent use>_Onn


Where nn is sequential number between 01 to 99

Include for PAI modules: Z<CA><Application area>N_<Text to represent use>_Inn


Where nn is sequential number between 01 to 99

Include for form routines: Z<CA><Application area>N_<Text to represent use>_Fnn


Where nn is sequential number between 01 to 99

Screen numbers: Between 9000 to 9999


Screen GUI status: 4 digit number same as the screen number
Screen GUI title: Last 3 digits of the screen number
 Function groups

Page 6 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

Z<CA><Application area>_<Text to represent use>


 Function modules & its interface components

Function module: Z<CA><Application area>_<Text to represent use>


Import parameters: I_<Name of the parameter>
Export parameters: E_<Name of the parameter>
Table parameters: T_<Name of the parameter>
Exceptions: <Name to represent use>
 Form print programs

Z<CA><Application area>F_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Form – SAPScript & SmartForm

Z<CA><Application area>F_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Form – Style & SmartStyle

Z<CA><Application area>F_<Text to represent use>_nn


Where nn is sequential number between 01 to 99
 Standard texts

Z<CA><Application area>TX[_<Text to represent use>]_nnnn


Where nn is sequential number between 0001 to 9999

Exception: Custom naming conventions for building Logo library to allow dynamic logo selection.
 Program Variants

<Text to represent use>


 ALV Layout variants

/<Text to represent use>


 Copies of standard programs or forms

Z<CA><Name of the standard program or form>

Note: If name built this way doesn’t fit the length, first character from the standard name shall be removed.
 Transaction codes

Z<CA><Application area><Text to represent the use>


 Message class and message numbers

Message Class: Z<CA><Application area>_<Text to represent the use>


Message number: Between 001 and 999.

Page 7 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

2. ABAP Dictionary Object naming conventions

 Domain (DO)

Z<CA><Text to represent use>


 Data element (DE)

Z<CA><Text to represent use>


 Structures and Table types (ST And T)

Z<CA><Application area>_<Text to represent use>


 Transparent tables (T)

Z<CA><Application area>_<Text to represent use>


 Database views (DB)

Z<CA><Application area>_<Text to represent use>


 Help views (Search help) (HV)

Z<CA><Table name>_<Text to represent use>


 Pool tables and Cluster tables (T)

Z<CA><Application area>_<Text to represent use>


 Logical database (LD)

Z<CA><Application area>_<Text to represent use>


 Fields in Structure/Table type/Transparent table

- Maximum possible, use standard SAP field names if referenced data element is standard SAP data element.
- For fields referencing to custom data element, ZZ<CA><Text to represent use>
 Lock objects

EZ<CA><Table name>
 Database table secondary index

2 digit sequential number


 Append structures

Ideally should use SAP proposed name while creating append structure.
If for any reason the same could not be used, use following convention…
Z<CA><Table name>nn
Where nn is sequential number between 01 to 99

Page 8 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

3. ABAP Other Miscellaneous object naming conventions

 Area menu

Z<CA><Text to represent use>


 SAP memory parameters (SPA/GPA)

Z<CA><Text to represent use>


 Number range object (NR)

Z<CA><Application area>_<Text to represent use>


 Change document

Z<CA><Application area>_<Text to represent use>


 Enhancement – SMOD/CMOD Project

Z<CA><Application area>_<Text to represent use>


 Enhancement – BADI Definition - Implementation

Definition:
Z<CA><Application area>_<Text to represent use>

Implementation:
Z_<Definition name>
 Business objects and components

Business object:
Z<CA><Text to represent use>

BOR Super_type:
Z<CA><Text to represent use>

BOR Subtype with delegation:


Z<CA><Super_type name>

BOR Subtype without delegation:


ZY<Super_type name>
 Classes

Z<CA><Application area>_<Text to represent use>


 Methods

Z<CA><Text to represent use>


 Basic IDOC type

Z<CA><Application area>_<Text to represent use>


 IDOC type

Z<CA><Application area>_<Text to represent use>


 IDOC Segment type

Z<CA><Text to represent use>


 BAPI

Z<CA>_BAPI_<Text to represent use>


 Query Info-Set

Page 9 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

Z<CA><Application area>_<Text to represent use>


 Query User group

<Text to represent use>


 Query

Z<CA><Application area>_<Text to represent use>


 Authorization Object class

Z<CA><Application area>X
Where X is single character, appropriately to be replaced by value ranging between A to Z
 Authorization object

Z<CA>< Text to represent use>


 Transport request description

<Application area>_<Object ID>_Object description


 LSMW, SXDA/SXDB Projects/Sub_projects

<Application area>_<Text to represent use>


 Application server filenames

<Application area>_<Object ID>_<Text to represent use>_<Time Stamp>


 BDC Session

<Object ID>_<Text to represent use>

Page 10 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

4. Program header documentation block

*----------------------------------------------------------------------*
* Author : <Name of the author/Developer user ID>
* Creation Date : <DD-MMM-YYYY>
* Transaction : <Transaction code if attached>
* Technical design: <Technical design document name>
* Description : <Short description of the functionality of the
* program>
*----------------------------------------------------------------------*
* Modification Information
*----------------------------------------------------------------------*
* Date : <DD-MMM-YYYY>
* Author : <Name of the programmer/Programmer user ID>
* Change request : <Change request number>
* Transport number: <Transport number>
* Description : <Short description of changes>
← *----------------------------------------------------------------------*

Information and recommended way of usage: SAP allows maintenance of “Pattern”. It is recommended to
maintain one single pattern to store above mentioned program header block to maintain consistency across all
programs developed in a project.

To maintain a patter, open any custom program in change mode in SE38 and follow the path…
Utilities -> More utilities -> Edit pattern -> Create pattern

Recommended name for the pattern: Z_PROGRAM_HEADER

Whenever new program is created….


 First include this pattern through SE38 by clicking on “Pattern” button from Application toolbar, select “Other
pattern” radio button in the pop-up, enter pattern name “Z_PROGRAM_HEADER” and press “Enter”.
 Update necessary information in the included program header pattern.
 Leaving one blank line after the program header pattern, then the actual code should start.

Whenever modifications are being made to already released custom program….


 Modification Information block should be maintained with appropriate information.

Page 11 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

5. Sample program documentation block

<<Program Header Documentation Block>>


<<Program declaration statement (if applicable)>>

************************************************************************
* Selection screen definition
************************************************************************
<<Remove this header if not applicable>>

************************************************************************
* Data declaration
************************************************************************
* Types

* Internal tables

* Work areas

* Variables

* Constants

<<Add/Remove components to/from this data declaration header as required>>

************************************************************************
* Load of program processes
************************************************************************
<<Remove this header if not applicable>>

************************************************************************
* Initialization processes
************************************************************************
<<Remove this header if not applicable>>

************************************************************************
* AT-SELECTION SCREEN processes
************************************************************************
<<Remove this header if not applicable>>

************************************************************************
* START OF SELECTION processes
************************************************************************
<<Remove this header if not applicable>>

************************************************************************
* END OF SELECTION processes
************************************************************************
<<Remove this header if not applicable>>
.
.
<<Add more header(s) as necessary if additional events are being used>>
.
.
<<Create subroutines using forward navigation and immediately use “Pretty printer” option to
automatically create FORM header.>>

Recommended name for the pattern: Z_PROG_DOCU_BLOCK

Page 12 of 13
ABAP NAMING CONVENTIONS
Version 2.0 Release date 26-Feb-2017

6. ABAP Program data naming conventions

Program data type Conventions for Global data Conventions for Local data
Types TY_<Name> LT_<Name>
Internal tables – Standard GT_<Name> LT_<Name>
Internal tables – Sorted GIS_<Name> LIS_<Name>
Internal tables – Hash GIH_<Name> LIH_<Name>
Work areas GS_<Name> LS_<Name>
Variables GV_<Name> LV_<Name>
Constants GC_<Name> LC_<Name>
Ranges GR_<Name> LR_<Name>
Field symbols FS_<Name> LFS_<Name>
Table controls TC_<Name> LTC_<Name>

Parameters P_<Name> --
Select options S_<Name> --

Forms Z_<Name>nn(Order of Forms) --


Formal parameters FP_<Name> --

Class CL_<Name> --
Class interface IF_<Name> --
Reference variables REF_<Name> LREF_<Name>
Method – Importing parameters I_<Name> --
Method – Exporting parameters E_<Name> --
Method – Changing parameters C_<Name> --
Method – Returning parameters R_<Name> --

Page 13 of 13

You might also like