0% found this document useful (0 votes)
1K views

ABAP OO Naming Conventions

The document provides naming conventions for ABAP Objects including conventions for classes, interfaces, internal declarations like constants and types, instance and static attributes, method data, class and interface definitions, and parameters in class methods. Specific examples are given for project names like ZSDP_CL_COMPANY_CODE and naming patterns like SET_ for setter methods, ON_ for event handling methods, and check_ for check methods.

Uploaded by

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

ABAP OO Naming Conventions

The document provides naming conventions for ABAP Objects including conventions for classes, interfaces, internal declarations like constants and types, instance and static attributes, method data, class and interface definitions, and parameters in class methods. Specific examples are given for project names like ZSDP_CL_COMPANY_CODE and naming patterns like SET_ for setter methods, ON_ for event handling methods, and check_ for check methods.

Uploaded by

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

Conventions for ABAP Objects

Naming Conventions
Object Project SAP CustDev
Class (in SE24) <ZCU>CL_<name>
Interface (in SE24) <ZCU>IF_<name>

Internal Declarations (constants, types, data…) in new classes


Naming Conventions
Object Project SAP CustDev
Constants LC_<name>
GC_<name>

Types TV_<name>
TS_<name>
TT_<name>
Instance attributes
(public, private, protected) MV_<name>
MS_<name>
MT_<name>
MR_<name>
Static attributes SV_<name>
(public, private, protected)
SS_<name>
ST_<name>
SR_<name>
method data
(local declarations)
LV_<name>
LS_<name>
LT_<name>
LR_<name>
<FS_name>
Class definition
LCL_<name>
GCL_<name>
Class interface definition LIF_<name>
GIF_<name>

Parameters in class methods


Naming Conventions
Object Project SAP CustDev
Import-Parameter IV_<name>,
PIV_<name>
Import-Parameter

IS_<name>,
PIS_<name>
IT_<name>,
PIT_<name>
IR_<name>
Export-Parameter EV_<name>,
PEV_<name>
ES_<name>,
PES_<name>
ET_<name>,
PET_<name>
ER_<name>
Changing-Parameter CV_<name>,
PCV_<name>
CS_<name>,
PCS_<name>
CT_<name>,
PCT_<name>
CR_<name>
Returning-Parameter RV_<name>,
PRV_<name>
RS_<name>,
PRS_<name>
RT_<name>,
PRT_<name>
RR_<name>

Method names
Naming Conventions
Object Project SAP CustDev
SET- / GET-Methods for
SET_<attribute
attribute access
name>,
GET_<attribute
name>
Methods for event handling ON_<event_name>

Methods for type conversion AS_<new_type>

Methods that deliver a IS_<adjective>


boolean value (true, false)

Methods for checks check_<objective>


Example
ZSDP_CL_COMPANY_CODE
ZSDP_IF_COMPANY_CODE

w classes

Example
use LC_ for declaration in methods
use GC_ for declaration in class attributes

Variable
Structure type
Table type
mv_matnr (variable)
ms_mara (structure)
mt_mara (table)
mr_header (reference)

Avoid S_<name> because it might be in conflict with select-


option
structure
internal table
object reference
same as for forms / subroutines

field symbols

local and global (e.g. TOP-Include) class definitions


local and global (e.g. TOP-Include) interface definition, e.g. for
ALV usage

Example
IV_MATNR
PIV_MATNR
Use only one notation for your project!
IS_HEADER
PIS_HEADER
IT_ITEM
PIT_ITEM
IR_HEADER
EV_SUBRC
PEV_SUBRC
Structure

internal table

Object Reference
Variable

Structure

internal table

Object Reference
Variable

Structure

internal table

Object Reference

Example
set_status

on_button_pushed

as_string

is_open, is_active
These methods must not return any EXCEPTIONs
Recommendation: The Boolean value should be represented
by the values SPACE/’X’ for false/true

check_authorization

You might also like