Sie sind auf Seite 1von 17

Revision No.: 001 Document Type: Development Naming Status: Ver 1.

0
Conventions/Programming Standards

ABAP Development Naming Conventions/Programming


Standards

Authors
This document was prepared by: Kannan Srinivasan Delivery Head of KRISH IT Solution.

This document can be enhanced as and when required and added a new version when new
requirement arises.

Document Revision/Approval Control


Documen
Date t Version Document Revision Description Document Author(s)
18/04/2016 001 Initial Version Kannan Srinivasan
21/07/2016 002 Ver 2 (Changes in Yellow Color) Kannan Srinivasan
25/07/2016 003 Ver 3 (Changes in Rose Color) Kannan Srinivasan

Page 1 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

Table of Contents
1. INTRODUCTION 3
2. PREREQUISITES 3
3. NAMING CONVENTIONS 3
3.1 General Development Naming logic 4
3.2 Naming Object Types 5
3.3 Development Class 11
3.4 Transports Naming Convention 11
3.5 Review Check list File Naming Convention 12
3.6 Technical Specification File Naming Convention 12
4. PROGRAMMING STANDARDS 13
4.1 Header Comments (Should appear at the top of objects) 13
4.2 Coding Prefixes 13
4.3 ALV Output 14
4.4 Hardcoding 14
4.5 User Exits Multi-Use (e.g. MV45AFZZ) 14

Page 2 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

1. INTRODUCTION

Following a standard naming convention for any of ABAP development is very key in terms of
saving significant time and resource for long term maintenance of SAP System. This naming
convention should be adhered prior to any SAP ABAP development which will be helpful for
addressing the following key points:

Uniformity in development style / coding practice


Help to facilitate knowledge transfer for future SAP resources on development standards

The objective of this document is to define guidelines for SAP developers about the naming
convention that needs to be followed.

2. PREREQUISITES

This document assumes that the reader is comfortable with the following topics:

ABAP programming language.


Systems development cycle of SAP R/3.
Development of DDIC objects like tables, match codes, data elements, domains, menus,
screens, functional modules, and program maintenance.

Notes:

No standard baseline SAP objects should ever be deleted or changed without the approval of
the Project PMO.
All user-defined development objects fall into the category of Customer Object Development.

In SAP terminology, Customer developed objects starts with Y or Z..

Page 3 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

3. NAMING CONVENTIONS
3.1 General Development Naming logic

In general, these naming conventions are derived from starting all custom development with the
prefix Z and adding a 2-character Application Area Code, 1-character Program Type Code,
underscore, and then a meaningful name for the developed object. .

For Project purposes, the Application ID will be a 2 character field which acts as a general
functional identifier for each object developed

Application area Description


code

PP Production Planning (Including APO)

FI Financial Accounting

GL General Ledger

PM Plant Maintenance

CO Cost Accounting

WM Inventory Management

MM Materials Management

HR Human Resources

BA Basis/Authorizations

CV Conversion

SD Sales & Distribution

Page 4 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

LE Shipping

UT Utility

The list of Application IDs may be further refined for specific project requirements. If it appears
that a specific development object cannot be appropriately classified by the current list of
Application IDs, a new Application ID should be requested from the Application Development
Team Leader.
Possible values for Program Type ID are listed below.

Program Type Description


ID

R Report

I Interface

C Data Conversion

E Enhancement

F Form

W Workflow

M Module Pool

The value of Object ID is derived by the ID associated with the Functional Specification or a four
digit running serial number of the Functional specification document. This allows the
development to be associated with the functional/technical specification. All development
should be associated with a specification.

Example : ZMMR_Costing overview report


Z-> Program starts with Z.
Page 5 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

MM-> Module for which the report is given


R-> This belongs to report category.
_
VV BBP (Business Blue Print No)
_
WWW GAP ID
Example Given Below
ZPS: MODULE

BBP No GAP ID CATEGORY PROGRAM NAME TCODE

KAIROS_BBP_PS02 PS02-GAP- ENHANCEMEN ZPSE_02_001 ZPS0201


001 T

KAIROS_BBP_PS01 PS01-GAP- FORMS ZPSF_01_003 ZPS0103


003

3.2 Naming Object Types

The following table summarizes the naming conventions described in this document. Each SAP
Object Type is described in further detail in following sections.

Page 6 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

SAP Object Type Length Naming Convention


ABAP 30 For Program :
Programs/Includes/
Module Pool ZAAB_CCCC_xxxxxx

For Includes :

ZAAB_CCCC_TOP

ZAAB_CCCC_SEL_SCREEN

ZAAB_CCCC_FORMS

AA Application Area Code (2 Characters)

B Program Type ID (1 Character)

CCCC Object ID (4 Characters)

x Open

*Include INB or OUT in the Open section for interfaces.

*If an include is multi-use (used by multiple RICEFW)


please do not include the object id in the name.

*If multiple includes needed for same object ID, use


sequence for that.

Example : ZAAB_CCCC_TOP_1,
ZAAB_CCCC_TOP_2.
ABAP Report Variants 14 Zxxxxxx

x Open

Page 7 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

SAP Object Type Length Naming Convention


Transaction Codes 7 ZAAVVWW

AA Application Area Code (2 Characters)

VV BBP Number

WW Last 2 digit of Gap id

If its supplied in the functional specification ,with


the above naming standard ,follow that alone.
Adobe form & 30 Z_<Program Name>
Interface Name

Dynpros (Screens) 4 Attached to SAP-supplied programs:


9000-9999, increments of 1

Attached to custom-developed programs:

0100-9999, increments of 10

Pop-up screens

Parent screen # plus 1 (e.g. 0101)

Logical Databases 20 ZAA_xxxxxx

AA Application Area Code (2 Characters)

x Open

Page 8 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

SAP Object Type Length Naming Convention


Classes 30 ZCL_AA_xxxxxx

AA Application Area Code (2 Characters)

x Open

*methods need to have a name that describes its use and


do not have to start with Z

Function Key Codes 4 XXXX


X - Open (capital letter)

Titlebars 3 XXX

X Open

Tables, Views, 16 ZXAA_xxxxxx


Structures
X Type of Object:

T Table

TT Table Type

S Structure

V View

AA Application Area Code (2 Characters)

x Open

Page 9 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

SAP Object Type Length Naming Convention


Append Structure 30 (Attached to SAP-delivered tables/Structures)

ZAXXXXX

XXXXX SAP Table/Structure Name

Example: ZARFPOS

___________________________________________
____

(Attached as an Include in an append Structure)

ZAaa_xxxxxxx

Example :ZAFI_EXT_FBL1N

aa Application Area Code (2 Characters)

x Open

Domains 30 ZAAxxxxxx

AA Application Area Code (2 Characters)

x Open

Data Elements 30 ZAAxxxxxx

AA Application Area Code (2 Characters)

x Open

Page 10 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

SAP Object Type Length Naming Convention


Table Fields 16 (Attached to SAP-delivered tables)

ZZxxxxxx...

x Open

(Attached to custom tables)

xxxxxxx...

x Open

Search Helps 30 ZAAxxxx..

AA Application Area Code (2 Characters)

x Open

xxxx Table name search is based on or description of search


help

Lock objects 16 EZAA_tttttt

AA Application Area Code (2 Characters)

t - primary table name (where multiple Lock Objects


are required for the same primary table, assign a
unique digit to the final position).

Function Groups 26 Z_AA_xxxxxx

AA Application Area Code (2 Characters)

x - Open (freely definable)

Function Modules 30 Z_AA_xxxxxx

AA Application Area Code (2 Characters)

x - Open (freely definable)

Page 11 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

SAP Object Type Length Naming Convention


BAdI Definitions & 30 Z_AA_CCCC_xxxxxx
Implementations
AA Application Area Code (2 Characters)
Enhancements
CCCC Object ID (4 Characters)

x - Open (freely definable)

Messages classes 20 ZAA_xxxxxx

AA Application Area Code (2 Characters)

x - Open (freely definable)

Project ( Created in 8 ZAA_CCCC


CMOD)
AA Application Area Code (2 Characters)

CCCC Object ID (4 Characters)

IDOC Segment Type 27 Z1AAxxxxxx


AA Application Area Code (2 Characters)

x - Open (freely definable)


IDOC Segment Name 30 Z2AAxxxxxx
AA Application Area Code (2 Characters)

x - Open (freely definable)


Basic IDOC Type 30 ZAAxxxxxx
AA Application Area Code (2 Characters)

x - Open (freely definable)


Enhancement IDOC 30 ZAAxxxxxx
Type AA Application Area Code (2 Characters)

x - Open (freely definable)


Workflow Object Type 10 ZAAxxxxxx
AA Application Area Code (2 Characters)

x - Open (freely definable)

Page 12 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

3.3 Development Class


Development classes group together development objects (e.g. programs, tables, function
modules) which can be corrected and migrated together across instances. A development class
can, for example, consist of a transaction or a group of related transactions along with
programs, DDIC objects, menu painters, screen painters, lock objects, message classes, match
codes, etc.

All custom development should be assigned to a custom development class. Temporary objects
may be assigned to class $TMP. Objects defined under the $TMP development class will not
be migrated.

Development classes follow the naming convention:


ZAA
AA Application Area Code (2 Characters)

3.4 Transports Naming Convention

Transport Naming Convention


Transport Name GAP ID (EX PS02-GAP-001

Description of the program

Short name of the developer

*Example PS02-GAP-001 -Costing report_Short name of


developer

3.5 Review Check list File Naming Convention

Page 13 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

Review Checklist File Naming Convention


Review Check list Replace the charter FS in the FS Name with RC and
Kept remaining as it is.

*Example

FS Name :FS_OTC_XXX_Shipment Arrival Form

RC Name : RC_OTC_XXX_Shipment Arrival Form

3.6 Technical Specification File Naming Convention

Technical File Naming Convention


Specification
Technical Specification Replace the charter FS in the FS Name with
TSpec and Kept remaining as it is.

*Example

FS Name :FS_OTC_XXX_Shipment Arrival Form

TS Name : TSpec_OTC_XXX_Shipment Arrival Form

4. PROGRAMMING STANDARDS
4.1 Header Comments (Should appear at the top of objects)

Object Id: Defined in section 3.1. Identifies the associated RICEFW Specification #.
Program Name: The name of the object starting with Z.
Created By: The initial developer
Create Date: The date of initial program completion
Initial Transport no DW2K900000
Description: A one or two sentence description of the object and usage.
********************************************************************
Modification Section:
ID: Changed by Date Reason for Change
Page 14 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

Example:

************************************************************************
* Object Id: 0059 *
* Program Name: ZMMR_XXXXXXXX *
* Created By: Kannan Srinivasan and SAP user id *
* Create Date: 05/31/2014 *
* Description: Report to Material master *
************************************************************************
* MODIFICATIONS *
************************************************************************
* ID: Changed By Change Date: Description: *
* A252521 Kannan 15/04/2016 Added new logic *
************************************************************************

4.2 Coding Prefixes

Program Component Prefix


Global Constants GC_
Global Variables GV_
Global Structures GS_
Global Internal Tables GT_
Global Ranges GR_
Global Statics GST_
Select-Options S_
Parameters P_
Radiobuttons RB_
Checkbox CB_
Pushbuttons PB_
Types Definition TY_
Table Types TT_
Field Symbols FS_
Local Constants LC_
Local Variables LV_
Local Structures LS_
Local Internal Tables LT_
Local Ranges LR_
Routine Passing Parameter Table PT_
Routine Passing Parameter Structure PS_
Routine Passing Parameter Variable PV_
Page 15 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

Program Component Prefix


Routine Passing Parameter Constant PC_

4.3 ALV Output

Use the classCL_GUI_ALV_GRID when creating objects for ALV use.Inform the ABAP
Development Team Leader if you need to use SALV and provide the reason.

4.4 Hardcoding

Hardcoding is discouraged in any program. Please create a custom table (refer to section 3 for
naming convention) and create a transaction code if reference fields are needed in a program.
The use of TVARVC variables is also discouraged. Use this z table to input the program name
and constant and a check box to active / deactivate the checking. Use this z table along with
check point groups.

4.5 User Exits Multi-Use (e.g. MV45AFZZ)

Use a separate include (naming conventions from section 3) for each RICEFW in a standard
user exit with the inclusion of statement IF FOUND.

Also it is recommended to first create only a dummy include in the main user exit and transport
to Quality and Productive environment before working on the empty include. This is to avoid
overlap and transport issues arising out later.

Example below

*---------------------------------------------------------------------*
* FORM USEREXIT_MOVE_FIELD_TO_VBAK *
*---------------------------------------------------------------------*
* This userexit can be used to move some fields into the sales *
* dokument header workaerea VBAK. *
* *
* SVBAK-TABIX = 0: Create header *
* SVBAK-TABIX > 0: Change header *
* *
* This form is called at the end of form VBAK_FUELLEN. *
Page 16 of 17
Revision No.: 001 Document Type: Development Naming Status: Ver 1.0
Conventions/Programming Standards

* *
*---------------------------------------------------------------------*
FORM USEREXIT_MOVE_FIELD_TO_VBAK.

* Object ID/Spec 0126 Update Custom Header Fields On Sales Order


INCLUDE XXXX if found.

ENDFORM.

**************End of the document*************************

Page 17 of 17