0% found this document useful (0 votes)
24 views26 pages

Naming Convention Latest

Naming Convention

Uploaded by

saigopal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views26 pages

Naming Convention Latest

Naming Convention

Uploaded by

saigopal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Table of Contents

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]

3. Data Dictionary Elements


The names of database tables and views in ABAP Dictionary have maximum length 16 and the names of
structures, data elements have maximum length 30.
Dictionary Naming Convention Example
Element
Database table Z[Process]_[Name] ZFI_DATA
ZHR_PAYROLL
Views Z[Process]_v_[Name] ZFI_V_DATA
Data element Z[Process]_D_[Name] ZFI_D_DATE
Structure Z[Process]_S_[Name] ZFI_S_TYPE
Append Structures ZZ[Process]_[data base table]_[Name] ZZFI_BKPF_REFI
Table type Z[Process]_T_[Name] ZCS_T_EANL
Dictionary Naming Convention Example
Element
Domain ZPROCESS_M_Name ZISU_M_WERKS
Type Group Z[Name] Max 5 characters
Search help Z[Process]_H_[Name] ZLM_H_WERKS
Lock object E[database table] EZFIDATA
Fields ZZ1[Name] - If appending to standard SAP Standard SAP allows
table upto 30 characters.
SAP also appends 4
[Name] - If adding field to custom table
characters at the end
of field if created using
Fiori custom fields tile.
So try to limit [Name]
to shorter meaningful
names and are
descriptive no longer
than 22 characters.
ZZCYEAR – Current
year
CYEAR – Current Year
[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]

Program Z[Process]_[Type]_[Name] ZCO_R_LIST_FUNDS

Where [type] is defined as R for


Report, I for Interface, E for
Enhancement, F for Form, W for
Program/ Naming Convention Example
Object Type
Workflow and C for Conversion,
BOR for Business Object.
Background Job Z[Process]_[Name] ZFI_COA
Include Z[Process]_[Name] ZFI_CONSTANTS
Transaction Code Z [Name] ZMATUPL
Module Pool SAPMZ[Process]_[Name] SAPMZCP_CPROGR1
Z[Process]_I_[Name]_TOP ZCP_CPROGR1_TOP
Z[Process]_I_[Name]_F01 ZCP_CPROGR1_F01
Z[Process]_I_[Name]_O01 ZCP_CPROGR1_o01
Z[Process]_I_[Name]_I01 ZCP_CPROGR1_i01
Z[Process]_I_[Name]_CIMP ZCP_CPROGR1_CIMP
Function Group Z[Process]_[Programming ZPS_RFC_FUNDS
Structure]_[Name]
Where [programming structure]
can be RFC, Workflow, Tools,
Tables, etc.
Function Module Z[Process]_[Type]_[Activity]_[Na ZFI_MAINTAIN_BP
me]
ZFI_RFC_MAINTAIN_VENDOR
Where:
 [Type] can be RFC,
Webservice(WS) etc.
 [Activity] reference Appendix
Screen 9000-9999
Business Z[Process]_[Name]
Transaction Event
SET/GET Parameter Z[Name] ZEMP_ID
ID
ZSTATUS
Business Object Z[Existing_BOR_Name] ZBUS2032
(copy)
Program/ Naming Convention Example
Object Type
Business Object ZBUS[9nnnnn] ZBUS900001
(new)
Application Log Z[Process]_[Name]
Object – SLG1
Logical Database Z[Process]_[Name] ZHCM_EMPLOYEE
Message Class Z[Process]_[Name] ZHR_PAYROLL
Workflow Template 900-999 90100001
This prefix number is configured in
SWU3.
Workflow Task ZTS_<Activity>_<Name> ZTS_CHG _INV
Invoice document change
Workflow Template ZWS_<Activity>_<Name> ZWS_CHG _PO
PO document change
Workflow Role ZAG_<Name> ZAG_INV_APPR
Abbreviation
Workflow Task
Group Abbreviation
BOR (Business Z[Name] Use SAP BOR object for [Name]
Object Repository)
IDOC Segment Type Z1[Process]_[Name] Z1LM_ORDER_01
IDOC Segment Z2[Process]_[Name] Z2SD_ORDER_01
Definition
Basic IDoc Type Z[Process]_[Name]_[##] ZHR_LEAVE_01
IDoc Extension Z[Process]_[Standard_Basic_Type ZLM_ORDERS05
_Name]
Process Code Z[Process]_[Name] ZHCM_LEAVE
Inbound IDOC Z_IDOC_INPUT_[Message_Name] Z_IDOC_INPUT_CUSTORDERS
Function module
IDOC Message Type Z[Process]_[Message_Description ZCS_CUSTORDERS
]
Program/ Naming Convention Example
Object Type
Change Document Z[Process]_[Name] ZHCM_LEAVE_PROCESS
Object
Text Element TEXT-[###] TEXT-001
Outbound Proxy ZCO_[Process]_[Name]_OB ZCO_FI_TIFS_INTERFACE_OB
Inbound Proxy ZCL_[Process]_[Name]_IB, ZCL_FI_TIFS_INTERFACE_OB,
ZII_[Process]_[Name]_IB ZII_FI_TIFS_INTERFACE_OB
WebService Z[Process]_[Name]_WS ZMM_PLANTLIST_WS
PDF based print Z[Process] _[Name]_AF When the object being created is
form (No a copy of a standard object then
fragments) the name of the original object
shall be used and 2 digits added at
the end for versioning
PDF based print Z[Process] _[Name]_MASTER_AF When the object being created is
form with a copy of a standard object then
fragments (Master) the name of the original object
shall be used and 2 digits added at
the end for versioning
PDF based print Z[Process] _[Name]_APPL_AF When the object being created is
form with a copy of a standard object then
fragments the name of the original object
(Content/Applicatio shall be used and 2 digits added at
n) the end for versioning
Smartform Z[Process] _[Name]_SF When the object being created is
a copy of a standard object then
the name of the original object
shall be used and 2 digits added at
the end for versioning
SAP Script Z[Process] _[Name]_SS When the object being created is
a copy of a standard object then
the name of the original object
shall be used and 2 digits added at
the end for versioning
Style Z[Name] ZBILL_STYLE
Standard Text ID Z[##] 2 to 4 Meaningful alphanumeric
Program/ Naming Convention Example
Object Type
(SO10) identifier
Standard Text Z[Process]_[Name] ZFI_PSUADDRESS
name (SO10)
Migration Cockpit Z[Name]_FILE Meaningful description (e.g.
Project- LTMC MIGRATION)
Z[Name]_STAGE
ZFUND _FILE
Create one project per object
Migration Object – Z [Name] ZFUND
LTMOM
Class in the class ZCL_[Process]_<TYPE>_[Name] ZCL_FI_MANAGEMANT
library

The class name must consist of


nouns and always be singular.
For enhancement
implementations use BADI name
for the [Name] field of class
For oData Services do not override
SAP generated names for the class
Type:
U – Utility class
B – Conversion Class
C – Constants
P – AMDP
Interface in class ZIF_[Process]_[Name] ZIF_PS_STATUS_MANAGEMANT
library
The same naming conventions are
used for interfaces as are used for
classes
Program-local class LCL_[Process]_[Name] LCL_FI_MANAGEMENT
The class [Name] must consist of
nouns and always be singular.
Program-local LIF[Process]_[Name] LIF_TR _MANAGEMENT
Program/ Naming Convention Example
Object Type
interface The same naming conventions are
used for interfaces as are used for
classes
Method name in Z [Activity]_[Name] UPDATE_STATUS
Class

Method name in Z[Process]_[Activity]_[Name] ZSD_CREATE_ORDER


Standard Class (If a new method is added to a
standard class)

Event Z[Process]_[Name] ZFI_BUTTON_PUSHED


ZFI_COMPANY_CODE_CHANGED
ZCS_BUSINESS_PARTNER_PRINTE
D
Event [Name] must be assigned as
follows: [Noun]_[Verb in past
tense].
Exception Class in ZCX_[Process]_[Name] ZCX_FI_AUTHORITY
the class library
The class [Name] must consist of
nouns and always be singular.
User Exit Project Z[SMOD Name] ZCOOMKS1
BADI Z[Name] ZSAPBADINAME
Implementation
Use SAP BADI name for
SAPBADINAME
Enhancement Spot ZEI_[Name] ZEI_SAPENHANCEMENTNAME
Implementation
Use SAP Enhancement spot name
for SAPENHANCEMENTNAME
Implicit ZEIMP_[Process]_[Name] Use subroutine of program or
Enhancement method of class or FM name for
[Name]
Explicit ZEEXP_[Process]_[Name] Use subroutine of program or
Enhancement method of class or FM name for
Program/ Naming Convention Example
Object Type
[Name]
Exceptions ZCX_[Name] ZCX_DIVIDE_BY_ZERO
TVARVC Variable Z[WRICEFID]_[Name] (use STVARV transaction)
[Top]

5. Function Modules and Method Parameters


 [X] should be: V for Variables, S for Work Area, T for Tables, C for Classes and I for Interfaces.

 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]

[Name] should be on Upper camel case


Views [Name].view.[Ext] format and match the controller name.
[Ext]:
 Xml
 Json
 Html
 JS
Controllers [Name].controller.js [Name] should be on Upper camel case
format and match the view name.
Fiori Catalog Z[Process]_BC_[Name] ZMM_BC_SUPPLIER
SAP uses BC in middle
Fiori Catalog Group Z[Process]_BCG_[Name] ZMM_BCG_SUPPLIER
SAP uses BCG in middle
Fiori Tile Any user-friendly business Shopping Cart
name (user sees this name)
Semantic Object [appname]SEM [appname] ...
Launchpad Role [appname]LPD
Application Alias [appname]ALS

6.1. File Structure


[webapp_root_folder]
 CSS ... all CSS files go here
 Style.css ... and potentially more stylesheets
 ext ... all reused third party java script goes here
 i18n ... all property files for localization go here
 i18n.properties
 i18n_de.properties
 i18n_en.properties
 ...
 model
 util .. all helper classes go here
 controllers … all view controller files go here.
 views .. all view go here; all file names shall start with an upper case letter. All fragments also
will go here.
 Img ... all image files go here (.png, .gif, .jpg, ...)
 Index.html
 Component.js
 myRouter.js
6.2. Reserved Characters

ID or Character Comments

- The minus is reserved as a separator for synthetic IDs

sap-ui-bootstrap Reserved as ID of the bootstrap script tag

sap.ui.core-script Reserved as ID of the bootstrap script tag

sap-ui-* Reserved as Prefix for SAPUI5 Core internal created IDs

*-r Reserved as Suffix for former UR LightSpeed root areas (similar to UIArea of SAPUI5)

data-sap-ui-* Reserved as Namespace for custom attibutes 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

7.3. CDS View


The CDS views are used in the SADL mapping in the Gateway service development or can be directly
exposed as OData Service.

7.3.1. General Rules


 The Name of the CDS DDL name cannot not exceed 26 characters (upper case always).
 The Name of the SQL (sqlViewName) View cannot exceed 16 characters.
 The “Define View {name}” name (internal view name) should be 22 characters or less.
Note: When activating OData, the suffix “_CDS” is appended to the CDS Internal View name. The
resulting name cannot exceed 26 characters.
 The Alias name of the CDS View fields should be in upper-camel-case.
 The alias name of the association in the CDS should start with “_”(underscore).

Object Type Description Naming Conventions Example

Generated SQL Basic or Interface or Composite Z[Process]_VI_[Name ZIAMPurOrder


Views ABAP SQL view
]
Private ABAP SQL view ZP[Process]_VP_[Na ZPAMPurOrder
me]
Consumption ABAP SQL view ZC[Process]_VC_[Na ZCAMPurOrder
me]

API SQL View Z[Process]_VA_[Nam ZAAMPurOrder


e]

CDS Views Basic /Interface/Composite Data Z[Process]_I_[Name] ZI_AM_PurchaseOrder


Source view

Private Data Source view Z[Process]_P_[Name] ZP_AM_PurchaseOrder

Consumption Data Source view Z[Process]_C_[Name] ZC_AM_PurchaseOrder

[Top]

7.4. Extension CDS View


A standard CDS view can be extended to add new fields and associations.

7.4.1. General Rules


 Extension CDS view name should start with “ZE”, point to the standard CDS name, should reflect
the serial number and cannot exceed 30 characters.
 Association Name should start with an “_” and should reflect type or name of associated data
source.
 Custom Field Name should start with “Z” and can contain the technical field name or reflect the
meaning of the field.
 Field Alias should reflect the meaning of the field from end user’s perspective.
Syntax Convention Example
ZE[2-digit Series
CDS View Name Number]_[Standard CDS Name] ZE00_I_FIXEDASSETS or

ZE01_I_ FIXEDASSETS

Association Name _[Meaningful associated data] _AMActionType

Field Name Z[Technical Field Name] ZPERNR

Field Alias Z[Business Field Name] ZEmployeeNumber

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

7.5.1. General Rules


 AMDP classes can have both normal methods and SQL Script methods. The Methods must be
clearly differentiated with the naming convention.
 The CDS table function name cannot exceed 30 characters.
 The fields in the CDS table function should be in upper-camel-case.

Object Type Description Naming Conventions Example

ABDP Class AMDP Class Name ZCL_[Process]_P_ [xxx] ZCL_AMDP_MM_PURORDER

[Top]

7.6. Structure Include


A structure may need modifications w.r.t addition of new fields.

7.7. OData Service Redefinition


An OData service needs extension to add new fields, entities, associations and business logic.

7.7.1. General Rule


In case of service redefinition, the CRUD methods have to be manually created in DPC_EXT class. The
method names should describe the entity set name followed by the type of operation.

7.7.1.1. Gateway – Project


Object Type Description Naming Conventions Example

Gateway Project Gateway project with SAP Z[Process]_[Service_Na ZHR_MANGETIMESHEET


Service annotations/ me]
Gateway project with
Vocabulary annotations

Project with Annotation Z[Process]_AN_[ Service ZHR_AN_MANAGETIMESHEET


for reference service _Name]

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

Gateway Gateway service Z[Process]_[ Service_Name]_SRV ZHR_MANGETIMESHEET_SRV


Service

Classes Data Provider Base Z[Process]_[ Service_Name]_DPC ZHR_MANGETIMESHEET_DPC


Class
Data Provider Z[Process]_[ Service_Name]_DPC ZHR_MANGETIMESHEET_DPC_EXT
Extension Class _EXT

Model Provider Z[Process]_[ Service_Name]_MPC ZHR_MANGETIMESHEET_MPC


Base Class

Model Provider Z[Process]_[ Service_Name]_MPC ZHR_MANGETIMESHEET_MPC_EXT


Extension Class _EXT

Annotation Provider Z[Process]_[ Service_Name]_APC ZHR_MANGETIMESHEET_APC


Base Class

Annotation Provider Z[Process]_[ Service_Name]_APC ZHR_MANGETIMESHEET_APC_EXT


Extension Class _EXT

[Top]

7.7.1.2. OData Service Redefinition


Syntax Convention Example

Gateway OData Project Name ZE[Serial Number]_[Standard ZE00_FAA_ASSET_CREATE


Project Name]

Redefined OData Service Name ZE[Serial Number]_[Standard ZE00_FAA_ASSET_CREATE_SRV


Project Name]_[SRV] (If the number of characters exceed
then choose the one proposed by the
tool)

New Entity Name [CamelCase Meaningful Name] PurchaseOrder

New Entity Set Name [Plural of Entity Name] PurchaseOrders or PurchaseOrderSet

New Field Name [CamelCase Meaningful Name] OrderId and NOT EBELN

Field Label [Meaning of field] Purchase Order Document Number

New Association Name [Result of primary & dependent OrderItem


entities]

New Association Set Name [Plural of Association Name] OrderItems or OrderItemSet

New Navigation Name [Result of dependent entity] Items

CRUD Method Names [Entity Set]_[Operation Type] ORDERITEMS_GET_ENTITY

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]

9.1. ZProgram Authentication Check


Please ensure all Z programs are coded for this auth check. This will close the loophole with
SA38 access.
authority-check object 'S_TCODE'
id 'TCD' field 'ZSRM_MDM_SADD'.
if sy-subrc <> 0.
message e252(s#) with 'You are not authorized for this transaction'.
endif.

[Top]

10. Internal Naming Based on Scope


Global is available/scoped to the whole program. Local is scoped to the procedure in the program.
Description Scope Naming Convention Example
Form Subroutine within Global [Action]_[Name] GET_DATA_ADDRSS
ABAP program
Where:

 Action – Load Table, Get


Data, etc.

 Name – Descriptive
name

Internal Tables Internal tables are Global_ gt_[descriptive_name] gt_material_header TYPE


defined within TABLE of mara
programs and
used to hold Local lt_[descriptive_name] lt_material_header TYPE
blocks of records. TABLE of mara

Table Types Type Types hold Local ty_t_[descriptive_name]


data in table
format within your
Description Scope Naming Convention Example
Form Subroutine within Global [Action]_[Name] GET_DATA_ADDRSS
ABAP program
Where:

 Action – Load Table, Get


Data, etc.

 Name – Descriptive
name

program.

It’s good practice


to use the same
field names as in
the standard
database so data
can be moved to
and from the table
easily.

Structure/work Holds the line of Global gs_[descriptive_name] DATA:


Area data of an internal
table. It’s gs_material_header TYPE
beneficial to use a mara.
similar descriptive Local ls_[descriptive_name] DATA:
name as the
internal table it’s ls_material_header TYPE
associated with. mara.

Constants Constant variables Global gc_[descriptive_name] CONSTANT:


do not change
during the gc_true_flag TYPE c VALUE
execution of a ‘X’.
program. Local lc_[descriptive_name] CONSTANT:
Whenever
possible the literal lc_true_flag TYPE c VALUE
itself should be ‘X’.
used.

Type ref Global go_ [descriptive_name] or


objects gr_ [descriptive_name]
Local
lo_ [descriptive_name] or
lr_ [descriptive_name]

Variables Work variables are Global gv_[descriptive_name] DATA:


for general-
purpose use. gv_material TYPE matnr.
These are any Local lv_[descriptive_name] DATA:
variable types that
cannot be defined lv_material TYPE matnr.
to the above
categories. These
Description Scope Naming Convention Example
Form Subroutine within Global [Action]_[Name] GET_DATA_ADDRSS
ABAP program
Where:

 Action – Load Table, Get


Data, etc.

 Name – Descriptive
name

variables may
contain
alphanumeric,
numeric, packed,
binary, date, time,
or hexadecimal
values.

Field Symbols Field symbols are Global <[descriptive_name]> DATA:


symbolic names
declared with key <material> TYPE any.
word FIELD- Local <[descriptive_name]> DATA:
SYMBOLS to which
a memory area <material> TYPE any.
can be assigned
during program
runtime. A field
symbol can be
used instead of
data objects at
operand positions
of statements.

Select Options The SELECT-OPTIONS [Field so_[descriptive_name] SELECT-OPTION:


name] for [Table field]
statement generates a so_matnr TYPE mara-matnr.
program variable used for a
selection criteria. This allows
a user at the selection screen
to enter in a range of values.
The variable generated is
actually a system generated
table containing [variable]-
highvalue, [variable]-
lowvalue, [variable]-sign, and
[variable]-option for the
table field selected. Variable
types of this category must
be prefixed as indicated
below and have a limited
length of eight (8) characters.

Parameters Parameter variables are used p_[descriptive_name] SELECT-:


Description Scope Naming Convention Example
Form Subroutine within Global [Action]_[Name] GET_DATA_ADDRSS
ABAP program
Where:

 Action – Load Table, Get


Data, etc.

 Name – Descriptive
name

to allow data entry at the p_matnr TYPE mara-matnr.


selection screen before
program execution. These
variables have a limited
length of eight (8) characters.
Variable types of this
category must be prefixed as
indicated below.

Ranges The RANGES [Field Global gt_rng_[descriptive_name]


name] for [Table
field] statement Local Lt_rng_[descriptive_name]
generates a
program variable
used for selection
criteria much like
the SELECT-
OPTIONS. The
variable generated
is actually a
system generated
table containing
[variable]-
highvalue,
[variable]-
lowvalue,
[variable]-sign,
and [variable]-
option for the
table field
selected. Variable
types of this
category must be
prefixed with as
indicated below
and have a limited
length of eight (8)
characters.

Variants Variants are program specific [Name]_V_[##] FLTSUM_V_01


objects, which define set
parameter entries required
at program execution time.
Description Scope Naming Convention Example
Form Subroutine within Global [Action]_[Name] GET_DATA_ADDRSS
ABAP program
Where:

 Action – Load Table, Get


Data, etc.

 Name – Descriptive
name

Variant names will consist of


eleven (11) characters
formatted as follows:

 1-7 Any 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

Read Read existing data

Update Update existing data

Delete Inactivate (no deleting, effective dated)

1.4. Specification Type

Abbreviation Name
FS Functional Specification

TS Technical Specification

TUT Technical Unit Testing

FUT Functional Unit Testing


1.5. Fiori/UI5
Variable Type Convention Example

String s[Name] sCompanyCode

Object o[DomRef]

JQuery object $[DomRef]

Int i[Name] iCount

Map / assoc. array m[Name] mParameters

Array a[Name] aEntries

Date d[Name] dToday


Float f[Name] fDecimal

Boolean b[Name] bEnabled

RegExp r[Name] rPattern

Function fn[Name] fnFunction

Method for events [eventName][FunctName] [eventName]: The event name in


lowaer case. Ex: press.

[FunctName]: Free. Upper camel


case.

doSomething.

Setter/getter methods [eventName][FunctName] [eventName]: The event name in


lowaer case. Ex: press.

[FunctName]: Free. Upper camel


case.

doSomething.

Variant types v[Name] vVariant

You might also like