Naming Convention Latest
Naming Convention Latest
1. OBJECTIVE
2. AUDIENCE
3. DATA DICTIONARY ELEMENTS
4. ABAP WRICEFS
5. FUNCTION MODULES AND METHOD PARAMETERS
5.1. EXCEPTIONS
6. FIORI/UI5
6.1. FILE STRUCTURE
6.2. RESERVED CHARACTERS
7. CDS/ODATA
7.1. CDS HIERARCHY
7.2. DATA MODELING DECISION TREE
7.3. CDS VIEW
7.3.1. GENERAL RULES
7.4. EXTENSION CDS VIEW
7.4.1. GENERAL RULES
7.5. AMDP
7.5.1. GENERAL RULES
7.6. STRUCTURE INCLUDE
7.6.1. GENERAL RULES
7.7. ODATA SERVICE REDEFINITION
7.7.1. GENERAL RULE
7.7.1.1. GATEWAY – PROJECT
7.7.1.2. ODATA SERVICE REDEFINITION
8. Z TABLES
9. AUTHORIZATIONS
9.1. ZPROGRAM AUTHENTICATION CHECK
10. INTERNAL NAMING BASED ON SCOPE
11. BI OBJECTS
12. PROJECT ARTIFACTS
13. EXTERNAL FILES
13.1. SINGLE FILE (CONVERSIONS OR USER UPLOAD PROGRAMS)
13.2. MULTIPLE FILES (INBOUND INTEGRATIONS)
13.3. REMOVE WHITE SPACE CHARACTERS
14. NFS DIRECTORIES
14.1. LINUX (APP SERVER)
15. PROCESS ORCHESTRATION (PO)
16. STANDARD PROGRAM STRUCTURE
17. CDS TEMPLATES
18. CODE REVIEW CHECKLIST
18.1. RECOMMENDED TOOLS FOR CODE REVIEW PROCESS
18.1.1. CODE INSPECTOR
18.1.2. EXTENDED PROGRAM CHECK
18.1.3. PERFORMANCE TRACE, TRANSACTION ST05
18.1.4. RUNTIME ANALYSIS
18.1.5. ABAP TEST COCKPIT
APPENDIX 1: ABBREVIATIONS
1.1. PROCESS AREA
1.2. TYPE OF WRICEF
1.3. ACTIVITY
1.4. SPECIFICATION TYPE
1.5. FIORI/UI5
1. Objective
The purpose of this document is to outline coding standards in ABAP. The aim of this document is,
To describe a consistent set of practices so that all coding will be done using uniform
conventions and techniques. Therefore, once a programmer becomes familiar with these
conventions, he will have a much easier time understanding all the other custom developed
programs, which also follow the same set of practices.
To recommend, explain and illustrate techniques that have been developed as efficient ways of
handling certain situations in ABAP programming.
To ensure the quality of custom developed programs, without limiting creative development.
Clear and understandable code is easy to understand, maintain and modify. During the software
life cycle, code is read and understood more often than it is re-written.
[Top]
2. Audience
This document is intended to be referred and used by ABAP Development team, BASIS consultants, etc.,
who would undertake ABAP development of WRICEF objects and carry out associated tasks in SAP
environment. It is assumed that the user of this document is sufficiently exposed to ABAP development
concepts.
This document should be distributed to employees or consultants who are new to the project to ensure
that the standards are followed. Anyone doing a standards review must have this document as a
reference.
[Top]
4. ABAP WRICEFs
Program/ Naming Convention Example
Object Type
Package Packages are required to pool ZABAP_GEN
related SAP objects into one
ZABAP_FI
common area for easier
reference.
ZABAP_[Process]
Usage of tables parameter should be avoided within Function Modules. Exceptions are allowed
where it is mandatory to use tables due to the system’s restrictions. (i.e., Workflow/AIF
template functions and RFCs).
Parameter Type Data Type Naming Convention Example
Method Table IM_T_[XXXX] IM_T_SBOOK
Importing
Structure IM_S_[XXXX] IM_S_IMDB_ITEM
Variable IM_V_[XXXX] IM_V_COUNTER
Object IM_O_[XXXX] IM_O_ALV_SBOOK
Reference IR_[X]_[XXXX] IM_RT_SBOOK
Method Table CH_T_[XXXX] CH_T_SBOOK
Changing
Structure CH_S_[XXXX] CH_S_IMDB_ITEM
Variable CH_V_[XXXX] CH_V_COUNTER
Object CH_O_[XXXX] CH_O_ALV_SBOOK
Reference CH_R[X]_[XXXX] CH_RT_SBOOK
Method Table EX_T_[XXXX] EX_T_SBOOK
Exporting
Structure EX_S_[XXXX] EX_S_IMDB_ITEM
Variable EX_V_[XXXX] EX_V_COUNTER
Object EX_O_[XXXX] EX_O_ALV_SBOOK
Reference EX_R[X]_[XXXX] EX_RT_SBOOK
Method Table RT_T_[XXXX] RT_T_SBOOK
Returning
Structure RT_S_[XXXX] RT_S_IMDB_ITEM
Parameter Type Data Type Naming Convention Example
Variable RT_V_[XXXX] RT_V_COUNTER
Object RT_O_[XXXX] RT_O_ALV_SBOOK
Reference RT_R[X]_[XXXX] RT_RT_SBOOK
Function Table EX_T_[XXXX] EX_T_SBOOK
Module
Exporting
Function Table CH_T_[XXXX] CH_T_SBOOK
Module
Changing
Function Table IM_T_[XXXX] IM_T_SBOOK
Module
Importing
[Top]
5.1. Exceptions
The following table contains meaningful Exception names that should be used generically.
Exception Meaning
ACTION_NOT_SUPPORTED The requested action or OK code is not supported.
CANCELLED This EXCEPTION can be used if a dialog in a method has
determined what is to be done (example: selection list) and
the user chooses “Cancel”.
EXISTING An object that you want to create exists on the database
already.
FAILED The method was not able to carry out its task, due to the
current environment situation. This exception is intended in
particular for situations where the environment is
temporarily in a constellation that makes it impossible to
carry out task of the method.
..._FAILED A sub function of the method could not be carried out, due
to the current environment situation. (OPEN_FAILED,
CLOSE_FAILED, SELECTION_FAILED,
AUTHORIZATION_FAILED)
FOREIGN_LOCK Data is locked by another user.
INCONSISTENT Object data on the database is inconsistent.
..._INCONSISTENT The sub object data of an object on the database is
inconsistent.
INVALID The specified object data is incorrect. (For example,
company code not available) ( as opposed to
NOT_QUALIFIED)
..._INVALID The specified sub object data of an object is incorrect. (As
opposed to NOT_QUALIFIED)
INTERNAL_ERROR The last resort. Use this EXCEPTION when all else fails and
the error can not be narrowed down any further.
NOT_AUTHORIZED The user is not authorized for the action.
NOT_CUSTOMIZED The requested object has been customized incorrectly.
..._NOT_CUSTOMIZED The sub object of the requested object has been customized
incorrectly.
NOT_FOUND The requested object had not been found.
..._NOT_FOUND The sub object of the requested object has not been found.
NOT_QUALIFIED The combination of the input parameters is insufficient to
trigger the function of the method. (As opposed to INVALID)
..._NOT_QUALIFIED A particular parameter of the method is not qualified.
NUMBER_ERROR Error in the numbering.
SYSTEM_ERROR This EXCEPTION can be set when the Basis system returns
an unexpected error code.
[Top]
6. Fiori/UI5
Dictionary Element Naming Convention Example
We recommend to not exceed 15 chars for
Application name Z[AP]_[ Process]_[name] [name]
ID or Character Comments
*-r Reserved as Suffix for former UR LightSpeed root areas (similar to UIArea of SAPUI5)
[Top]
7. CDS/OData
7.1. CDS Hierarchy
7.2. Data Modeling Decision Tree
S/4 Decision Tree Data Modeling.pdf in SharePoint
[Top]
ZE01_I_ FIXEDASSETS
[Top]
7.5. AMDP
AMDP classes are used to perform data intensive logic with complex calculations. The AMDP method(s)
can be exposed through a CDS Table function for consumption by CDS.
[Top]
The following objects are defaulted with the listed naming conventions. If not automatically set by SAP
upon creation of the service use these conventions.
Object Type Description Naming Conventions Example
[Top]
New Field Name [CamelCase Meaningful Name] OrderId and NOT EBELN
ORDERITEMS_GET_ENTITYSET
ORDERITEMS_CREATE_ENTITY
ORDERITEMS_UPDATE_ENTITY
ORDERITEMS_DELETE_ENTITY
[Top]
8. Z Tables
9. Authorizations
Object Type Naming Convention Example
MAT
Object Class An authorization object class groups common
check objects together in a logical group.
Authorization class has a length of four (4)
characters and should be defined as follows
(position):
Z (Required by SAP)
2-4 3 character short business name
Check objects Check objects are objects that are called from
(Authorization ABAP/4 programs and transactions to check the
Objects) login user’s authority to perform a function or
check access to specific field values. Names should
be defined as follows (position):
Z (Required by SAP)
2-4 Process
5_
6-12 Use meaningful words
Authorizations Authorizations control the values of a specific
check object for which a user requires to have
access to. A value or range of values is assigned to
each field based on the authorization. The second
character for any authorization must not be an
underscore ‘_’, this is reserved by SAP.
Naming convention, suggested for consistency
with check objects (position):
1 Z (Required by SAP)
2-4 Process
5_
6-12 Use meaningful words
Profiles Profiles link multiple authorizations into one
common group, usually defined as a business
profile. A business profile is assigned specific
authorizations to perform tasks related to the
security level of that business profile. The second
character for any profile must not be an
underscore ‘_’. This is reserved by SAP.
Naming convention, suggested for consistency
with check objects (position):
1 Z (Required by SAP)
2-4 Process
5_
6-12 Use meaningful words
[Top]
[Top]
Name – Descriptive
name
Name – Descriptive
name
program.
Name – Descriptive
name
variables may
contain
alphanumeric,
numeric, packed,
binary, date, time,
or hexadecimal
values.
Name – Descriptive
name
Name – Descriptive
name
8_
9V
10-11 2 character
numeric, ranging from
01 to 99, starting at 01.
[Top]
Appendix 1: Abbreviations
1.1. Process Area
Abbreviation Process Area Name
AM Fixed Assets
AP Accounts Payable
AR Accounts Receivable
ARL Applied Research Lab
FI Finance-Controlling
FM Funds Management
GM Grants Management
HCM Human Resources
OPP Office of Physical Plant
SBP Budget Prep and Planning
SRM SRM General
CM SRM Contract Management
MDM SRM Master Data Management
PO SRM Purchase Order
RFx SRM Bid Invitation
SC SRM Shopping Cart
SLC/SUS SRM Supplier Lifecycle Management
TRCM Treasury-Cash Management
ISU_DM ISU Dunning
ISU_BIL ISU Billing
ISU_FC ISU FICA
ISU_CS ISU Customer Services
1.2. Type of WRICEF
Abbreviation Technology Name
W Workflow
Abbreviation Technology Name
R Report
I Interface (Integration)
C Conversion
E Enhancement
F Form
1.3. Activity
Activity Description
Create Create new data
Abbreviation Name
FS Functional Specification
TS Technical Specification
Object o[DomRef]
doSomething.
doSomething.