0% found this document useful (0 votes)
162 views6 pages

ABAP Naming Standards

This document outlines naming standards for ABAP elements including: - Declarative elements like variables, constants, types, tables should start with prefixes like GV_, GC_, TY_, IT_ - Parameters, select options, ranges should start with P_, S_, RT_ - Local, formal, and global elements have different prefixes like L, PV, PC - Objects like programs, classes, interfaces, function modules use prefixes like Z, CL, INT, Z_ - Lock objects use the prefix EZ_

Uploaded by

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

ABAP Naming Standards

This document outlines naming standards for ABAP elements including: - Declarative elements like variables, constants, types, tables should start with prefixes like GV_, GC_, TY_, IT_ - Parameters, select options, ranges should start with P_, S_, RT_ - Local, formal, and global elements have different prefixes like L, PV, PC - Objects like programs, classes, interfaces, function modules use prefixes like Z, CL, INT, Z_ - Lock objects use the prefix EZ_

Uploaded by

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

ABAP - Naming Standards

DECLARATIVE ELEMENT 3

WORK VARIABLES 3
CONSTANTS 3
FLAGS 3
FIELD STRINGS 3
TYPES 3
TYPE DECLARATION FOR STRUCTURES 3
TYPE DECLARATION FOR INTERNAL TABLES 4
INTERNAL TABLE 4
PARAMETERS 4
SELECT-OPTIONS 4
RANGES 4
FORMAL PARAMETERS 4
LOCAL DATA DECLARATIONS 5
LOCAL STATIC DATA DECLARATIONS 5
MACRO 5
CLASS 5
OBJECT 5
INTERFACE 5
BLOCKS DEFINED ON THE SELECTION-SCREEN 5
MODULE POOL FOR SCREEN 5
FUNCTION MODULES 5
OBJECTS (PROGRAMS, TABLES, VIEWS ETC.) 5
Lock Objects 5

Effective From: Page 1 of 6


ABAP - Naming Standards

AMENDMENT HISTORY

Version Author Page Description Reviewed Approved By


No By
Review Approval Date
Date

Effective From: Page 2 of 6


ABAP - Naming Standards
Declarative Element Naming Standards
Work variables Should start with . GV_

Example:
DATA:
GV_USERID LIKE BKPF-USNAM, User id
GV_ACCT_NUM TYPE. N VALUE 0. G/L acct
Constants Should start with GC_.

Example:
CONSTANTS:
GC_SOLDTO LIKE BVBPA-PARVW " Sold-to partner
VALUE 'AG.

Flags Should start with FL_.

Example:
DATA:
FL_NEW_PAGE(1) TYPE C, " New page indicator
Field strings Should start with FS_.

Example:
DATA:
FS_BVBPAKOM LIKE BVBPAKOM. " Communication structure

DATA:
BEGIN OF FS_OUTPUT, " Record structure
LINE(1000),
END OF FS_OUTPUT.
Types Should start with TY_.

Example:
TYPES:
TY_TABLE_INDEX LIKE SY-TABIX.
Type declaration for structures Should start with TY_.

Example:
TYPES:
BEGIN OF TY_REPORTLINE,
PKUNAG LIKE S510-PKUNAG, " Sold-to party
NAME1 LIKE KNA1-NAME1, " Customer name
MATNR LIKE S510-MATNR, " Material number
UMMENGE LIKE S510-UMMENGE, " Quantity
VRKME LIKE VBAP-VRKME, " Sales UoM
END OF TY_REPORTLINE.

Effective From: Page 3 of 6


ABAP - Naming Standards
Declarative Element Naming Standards
Type declaration for internal Should start with TY_T.
tables
Example:
[TYPES:
BEGIN OF TYPE_S_STRUC,
NAME(10) TYPE C,
AGE TYPE I,
END OF TYPE_S_STRUC. ]

TYPES:
TY_T_TAB1 TYPE STANDARD TABLE OF TYPE_S_STRUC WITH
DEFAULT KEY.

Internal table Should start with IT_.

Example:
DATA:
IT_CRED_MEMO_HDR TYPE STANDARD TABLE
OF TYPE_S_CRED_MEMO_HDR
INITIAL SIZE 30
WITH HEADER LINE.

Should start wit WA_


Work Area
Parameters Should start with P_.

Example:
PARAMETERS:
P_UNBLK AS CHECKBOX DEFAULT ' ',
P_SIMUL RADIOBUTTON GROUP RG1,
P_PRNAME LIKE TSP01-RQDEST.
Select-options Should start with S_.

Example:
SELECT-OPTIONS:
S_VKORG FOR S510-VKORG. " Sales organization
Ranges Should start with RT_.

Example:
RANGES:
RT_USERID FOR BKPF-USNAM.
Formal parameters Formal parameters passed by value, should start with PV_.
Formal parameters passed by reference, should start with PC_.
Formal parameters passed by value and result, should start with PR_
Formal parameters representing Internal tables that are passed by
TABLES, should start with PT_

Example:
PV_DOC_DATE Value parameter
PC_USERID Reference parameter
PR_MATNR Value and Result parameter

Effective From: Page 4 of 6


ABAP - Naming Standards
Declarative Element Naming Standards
Local data declarations Should start with L followed by the naming conventions specified for the
global data elements.

Example:
Local variable declaration:
DATA:
LV_USERID LIKE BKPF-USNAM. User id

Local constant declaration:


CONSTANTS:
LC_SOLDTO LIKE BVBPA-PARVW Sold-to partner
VALUE AG.
Local Work Areas Should start with LS followed by the naming conventions specified for the
global data elements.

Example:
Local work area:
DATA:
LS_MARA type MARA.
Macro Should start with M_.
Class Should start with CL_.
Object Should start with OBJ_.
Interface Should start with INT_.
Blocks defined on the If a program contains multiple selection-screens, the corresponding
selection-screen selection-screen number should prefix the block name.
Module pool for screen Program name should begin with SAPMZ.
Function Modules Customer defined function modules should start with Z_.
Objects (Programs, Tables, Customer-defined objects should start with Z
Views etc.)
Lock Objects Should start with EZ_.

Z<ModuleName>_<Meaningful Name>_

Modification Log

*&---------------------------------------------------------------------
*
* Date : 07/24/2015
* Requested By : Venkateshwarlu Peddi *
* Created By : Shriniwas Dakhare *
* Program Name : ZWM_STOCK_TRANSFER
* Transaction Code : ZRET_PUTAWAY
*&---------------------------------------------------------------------
* Description:
*& To read stock from the storage type and bin entered on the selection
*& screen and move stocks from one storage location to another storage
*& location and then create a transfer order to place the stocks in
*& respective storage types and bins.
*&---------------------------------------------------------------------
*
* MODIFICATION HISTORY
*

Effective From: Page 5 of 6


ABAP - Naming Standards
*----------------------------------------------------------------------
*
*Date Dev.Name Transport Request Description
*
*----------------------------------------------------------------------
*
*07/24/2015 Shriniwas D ECDK907029 Initial development.

*----------------------------------------------------------------------
*

Change Log
For Multiple Lines
Adding Code
* Begin of Ins - <Ticket Number> <TR Number>
* End of Ins - <Ticket Number> <TR Number>
Comment Code
* Begin of Del - <Ticket Number> <TR Number>
* End of Del - <Ticket Number> <TR Number>

For Single Line


Insert Ins <TR Number>
Delete/Comment Del <TR Number>

Implicit Enhancements
ZEHN_<Program Name>

Dictionary Objects
Tables
Z<Module Name>_<Meaningful Name>
Structures
ZS<Module Name>_<Meaningful name>
Data elements
ZDE<Module Name>_<Meaningful name>
Domains
ZDM<Module Name>_<Meaningful name>
Views
ZV<Module Name>_<Meaningful name>

TR Name
PP-APAP : 16646 : Changes in MB52
<Module Name>-ABAP : <Ticket Number> : Meaningful description

Effective From: Page 6 of 6

You might also like