Vous êtes sur la page 1sur 19

Project

<ABAP/4 Naming Conventions>

ABAP/4 Naming Conventions

1 of 19

Project

<ABAP/4 Naming Conventions>

Document Control
Author File Name Path Created Last Edited Number of Pages 29 February, 2000 29 February, 2000 19 PricewaterhouseCoopers ITC ABAP Naming Conventions.doc

Version 0.1 0.2

Revision Date 29/02/2000

Revision Description Initial Release

Author Milan Day

Sign-off

Target Readership Project Management Team Technical Team Members

2 of 19

Project

<ABAP/4 Naming Conventions>

Table of Contents
ABAP/4 Naming Conventions.........................................................................................................................1 1.0 Introduction.................................................................................................................................................4 2.0 Object naming conventions........................................................................................................................5 Summary.......................................................................................................................................................5 Program Element:.........................................................................................................................................8 Program Element..........................................................................................................................................8 Development Class.......................................................................................................................................9 ABAP Program ............................................................................................................................................9 ABAP Report Include...................................................................................................................................9 Report Variant............................................................................................................................................10 Transaction Codes:.....................................................................................................................................10 ....................................................................................................................................................................10 ABAP module Pools:..................................................................................................................................10 ....................................................................................................................................................................10 Module Pool Includes:................................................................................................................................10 Dynpros (Screen)........................................................................................................................................11 SPA/GPA Parameters.................................................................................................................................11 Batch Job Requests.....................................................................................................................................11 Batch Input Sessions...................................................................................................................................12 Area Menus.................................................................................................................................................12 ....................................................................................................................................................................12 Function Key..............................................................................................................................................12 Titlebar........................................................................................................................................................13 Transparent Tables:....................................................................................................................................13 Domains......................................................................................................................................................13 Data Elements ............................................................................................................................................13 Search Helps...............................................................................................................................................14 ....................................................................................................................................................................14 Data Element Supplement..........................................................................................................................14 Table Fields................................................................................................................................................14 Lock Objects...............................................................................................................................................15 Function Groups.........................................................................................................................................15 Function Modules ......................................................................................................................................15 Messages Classes and Number...................................................................................................................15 Number Range............................................................................................................................................16 Layout Sets.................................................................................................................................................16 Standard Texts............................................................................................................................................16 Styles...........................................................................................................................................................17 3.0 Appendices...............................................................................................................................................18 Module ID & Sub-Module ID :..................................................................................................................18 Program Type Ids.......................................................................................................................................19

3 of 19

Project

<ABAP/4 Naming Conventions>

1.0 Introduction
Using consistent development standards and naming conventions through SAP technical development will not only contribute significant time and resource savings for both the initial construction and long term maintenance of SAP system, but also improve system efficiency dramatically. Developing these standards prior to construction and adhering to them during construction is especially helpful when addressing the following: Migration into a production environment Long-term maintenance of custom development Future upgrades Facilitating knowledge transfer for future SAP resources

Small amounts of effort now will provide beneficial for the overall project and SAP System. The objective of this manual is to define guidelines for SAP developers. This document is based on : SAPs Naming Convention for Development Objects Previous PwC SAP project implementation standards This document will further evolve as batch scheduling and mapping tools are more solidly integrated into Project SAPlings development environment, and as new requirement/standards arise.

4 of 19

Project

<ABAP/4 Naming Conventions>

2.0 Object naming conventions


Summary
The following table summarizes the naming conventions described in this document. Each SAP Object type if described in further detail in following sections. Note that capital letters represent literals and should not be changed. Lowercase letters represent variable fields which may take on some range of values described in the appropriate section.

SAP Object Type


ABAP Programs

Length
9

Naming Convention
Yabccxxxx a - Program Type Id (see appendices) b - Module Id (see appendices) c - Sub Module Id (see appendices) x - Open Yibccxxxx b - Module Id (see appendices) c - Sub Module Id (see appendices) x - Open x - Open ga99 g - Y or Z a - application code (see appendices) 99 - number from 01 to 99 SAPxZannnnnnnnnnnnnnnnnnnnnnnn x Type of module pool M Screens L Function Module F Subroutines D Dialog a Module Id n Descriptive Text xZannnnnnnnnnnnnnnnnnnnnnnnTOP Top Include xZannnnnnnnnnnnnnnnnnnnnnnnOyy PBO modules xZannnnnnnnnnnnnnnnnnnnnnnnIyy PAI Modules xZannnnnnnnnnnnnnnnnnnnnnnnFyy Subroutines x Type of module pool M Screens L Function Module F Subroutines D Dialog a Module Id n Descriptive Text y - Open (Numeric : 0 99) 9nnn nnn Numeric between 000 and 999 gxx g Y or Z x Descriptive Text Z_bb_a_xxxxxxxxxxxxxxxxxxxxxxxxx b Frequency Indicator

ABAP Report Include

ABAP Report Variant Transaction Codes

14 4

ABAP Module Pools

30

ABAP Module Pool Includes

30

Dynpros (Screens) SPA/GPA Parameters Batch Job Requests

4 3 32

5 of 19

Project

<ABAP/4 Naming Conventions>

Batch Input Sessions (BDC Sessions) Area Menus

12 20

Function Key Codes Titlebars Tables, Views, Structures

4 3 16

Domains Data Elements

30 30

Data Element Supplements Table Fields

34 16

Search Helps

30

Lock Objects

16

Function Groups Function Modules

26 30

da Daily wk Weekly mn Monthly qt Quarterly an Annually re On Request a Application ID x Descriptive Text Yxxxxxxxx_nn Yxxxxxxxx ABAP program submitting the BDC Session n Sequential Number gaxxxxxxxxxxxxxxxxxx g Y or Z a Module Id x Descriptive Text xxxx x Open xxx x Open gaxxxxxxxxxxxxxx g Y or Z a Module Id x Descriptive Text ZZxxxxxxxxxxxxxxxxxxxxxxxxxxxx x- Descriptive Text ZZxxxxxxxxxxxxxxxxxxxxxxxxxxxx x- Descriptive Text Should use the same name in both Domain and Data Element ZZxxxxxxxxxxxxxxxxxxxxxxxxxxxxnnnn x name of the corresponding Data Element n range between 0001 to 9999 ZZxxxxxxxxxxxxxx (Attached to SAP delivered tables) xx Descriptive Text xxxxxxxxxxxxxxxx (Attached to custom tables) xx Descriptive Text gat_xxxxxxxxxxxxxxxxx g Y or Z a Module Id (see appendices) t type E Elementary C Composite x descriptive text Eg_xxxxxxxxxxxxx g Y or Z x Primary Table Name (where multiple Lock Objects are required for the same primary table, assign a unique digit to the final position ) Ya_xxxxxxxxxxxxxxxxxxxxxxx a Module ID (see appendices) x descriptive text Ya_xxxxxxxxxxxxxxxxxxxxxxxxxxx

6 of 19

Project

<ABAP/4 Naming Conventions>

Message Classes

20

Message Number Number Range Object

3 10

Layout Sets (SAPScript)

16

Standard Texts

32

Styles

a Module Id (see appendices) x descriptive text ga_xxxxxxxxxxxxxxxxx g Y or Z a Module Id (see appendices) x descriptive text nnn nnn Number Interval 001 999 ga_xxxxxxx g Y or Z a Module Id ( see appendices) x Descriptive Text gabb_xxxxxxxxxx g Y or Z a Module Id (see appendices) b Sub Module Id (see appendices) x Descriptive text ga_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx g Y or Z a Module Id (see appendices) x descriptive text ga_999 g Y or Z a Module Id (see appendices) 9 Number from 001 to 999

7 of 19

Project

<ABAP/4 Naming Conventions>

Program Element: Program Element


Internal Tables

Use
Internal tables: Standard Internal tables: Sorted Internal tables: Hashed Copy of database table Intermediate Storage Radio Buttons Push Buttons Check Boxes General General General General General General Global Local

Syntax
I_* IS_* IH_* IY_* or IZ_* X_* RB_* PB_* CB_* TY_* C_* P_* R_* Sub_* S_* G_* L_*

Structures Screen Elements Types Constants Parameters (all kinds) Ranges Forms Select Options Variables

Note: The asterisk in the table above signifies a descriptive name of your choosing. Consider using an underscore (_) to connect multi-word variable and multi-world FORM names.

8 of 19

Project

<ABAP/4 Naming Conventions>

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 $TPM development class will not be migrated.

Class
$TPM ZBAS ZCFG ZDCV ZFRM ZINT ZRPT

Description
Local Objects (not migrated) Basis Configuration General Development Forms Interfaces Reports

ABAP Program
The maximum length of an ABAP program name is 30 characters. SAP requires that the first character begin with a Z or Y. For all programs in this project the first character will be always a Y. The second character signifies what kind of program it is. The next three characters identify the Application process ID, which comprises of Module ID and sub-module ID. The last 26 characters of the program name are open for any alphanumeric string. For all purposes in project SAPLing we will follow the length of program name to be 9. Yabccxxxx a - Program Type Id (see appendices) b - Module Id (see appendices) c - Sub Module Id (see appendices) x - Open

ABAP Report Include


For all report include programs in this project the first character will be always a Y. The second character will be I. The next three characters identify the Application process ID, which comprises of Module ID and sub-module ID. The last 26 characters of the program name are open for any alphanumeric string. For all purposes in project SAPLing we will follow the length of program name to be 9. YIbccxxxx b - Module Id (see appendices) c - Sub Module Id (see appendices) x - Open Naming convention

9 of 19

Project

<ABAP/4 Naming Conventions>

Report Variant
When an ABAP report is created, ABAP may generate some database-specific selections on the selection screen. Additional selectionscreen criteria can also be programmed into the report. In order to execute a report for a specific range of data or selection set, the selection ranges must be entered on the screen. However, if there is a requirement to run the same report with the same selection set, especially in batch, a variant can be used to save that selection set. If a variant is used, there is no need to enter the same selection set again each time the report is executed. The maximum length of an ABAP variant is 14 characters. Report Variants should adhere to the following naming convention: xxxxxxxxxxxxxx

Transaction Codes:
Transaction Codes are created either through ABAP Development Workbench/Development/ Other Tools/Transactions or if you are developing a transaction you can create a transaction code there itself. Every transaction in SAP contains a unique transaction code. Information about all transactions are stored in two standard SAP tables. Table TSTC contains the attributes of the transaction and table TSTCT contains the short text associated with the transaction. The entries in tables TSTC and 10 of 19

Project

<ABAP/4 Naming Conventions>

Data Definition (Global Data Include) Module Process Before Output (PBO) Module Process After Input (PAI) Module Performs (subroutines) Process On Help-Request (POH) Module Process On Value-Request (POV) Module Forms for OKcode functions

xZannTOP xZannOyy xZannIyy xZannFyy xZannHyy xZannVyy Form_<Okcode>

Remarks: It is strongly recommended that you use the SAP Workbench to construct module pools. The SAP Workbench is designed to enforce standard naming conventions.

Dynpros (Screen)
SAP screens are referred to as dynpros. Standard SAP components, such as transactions, menus and tables, contain dynpros and the associated processing logic. The identification of a screen painter dynpro consists of an ABAP program name and a 4-digit dynpro number. The number range reserved for dynpros should be between 9000 - 9999. The initial screen number for a given transaction should be 9000 and additional screens numbers increment by 10. If there are any pop up screens their number should be maintained as an increment of 1 on the main screen no. Example Module Pool: SAPMZF01 Screen #: 9000

SPA/GPA Parameters
A field can be filled with proposed values from SAP memory using a parameter ID. These have to be mentioned as field attributes in a module pool program. gxx g Y or Z x Descriptive Text

Batch Job Requests


The maximum length of a batch job request is 32 characters. Batch job requests should adhere to the following naming convention : Z_bb_a_xxxxxxxxxxxxxxxxxxxxxxxxx b Frequency Indicator da Daily wk Weekly mn Monthly qt Quarterly

11 of 19

Project

<ABAP/4 Naming Conventions>

an Annually re On Request a Application ID x Descriptive Text

Batch Input Sessions


Batch input sessions are a collection of batch input data used as input to one or more update transactions. External data can be transferred into the SAP system through a batch input session. They are stored on the batch input queue until submission to the transaction processing. In order to guarantee data consistency, all data is subject to the same validations performed in the on-line transaction. Batch input session names can be up to 12 characters long. It should start with the name of the primary program that created the session. The remaining characters should be a running serial no. Yxxxxxxxx_nn Yxxxxxxxx ABAP program submitting the BDC Session NSequentialNumber

Area Menus
An area menu is the first menu that appears when entering an application area. For example, selecting Tools ABAP Workbench will take you to the ABAP Workbench area menu and the ABAP Workbench application area. The application area can also be accessed via transaction code S001. The area menu name is the transaction code S001. The area menu follows the same naming conventions as transaction codes. The maximum length of an area menu is 20 characters. gaxxxxxxxxxxxxxxxxxx g Y or Z a Module Id x Descriptive Text

Function Key
Function keys are part of the GUI status and are defined in the menu painter along with pushbuttons and menu items. SAP has certain standard settings for some function keys, listed below: F1 F2 F3 F4 F9 F10 F11 F12 Shift-F1 Print Shift-F2 Delete Shift-F5 Open Help Choose Back (one step) Possible entries Select Jump to menu bar Save/Generate Cancel

12 of 19

Project

<ABAP/4 Naming Conventions>

SAP also uses the following function keys for scrolling: Shift-F9 First Page Shift-F10 Previous Page Shift-F11 Next Page Shift-F12 Last Page xxxx x Open

Titlebar
Used to give a heading to a window. The content can be dynamically changed as per requirement. xxx x Open

Transparent Tables:
A Transparent table has a 1:1 relationship (field for field) with a corresponding physical table on the underlying database. Transparent tables are typically used to store master and transaction data. A view can be used to create virtual tables that do not contain any data, but presents selected columns of data from one or more database tables. A structure is defined like a table, but it does not store records in the database. Structures can be shared by multiple ABAP programs. The table and view name can be up to 16 characters long, whereas a structure can be of a length of 30 characters. All custom created Tables, Views and Structures will be maintained at length of 16 for this project. The first character should be Y or Z. The second character should reflect the Module ID. The remaining characters are open and should be as descriptive as possible. gaxxxxxxxxxxxxxx g Y or Z a Module Id x Descriptive Text

Domains
A domain is a central object for describing the attributes of a business object. A domain describes the value set for a field. This set of values is defined by specifying the format attributes, such as external format, length and type. The maximum length of a domain is 30 characters. The first two characters must be ZZ and the remaining 28 characters can be arbitrarily assigned. ZZxxxxxxxxxxxxxxxxxxxxxxxxxxxx x- Descriptive Text

Data Elements
A data element is a semantic domain. It provides a precise description of the function of a domain in a specific business context for the fields that depend on it. Each new data element defined by a

13 of 19

Project

<ABAP/4 Naming Conventions>

developer should be linked to a new domain. Existing SAP domains should not be used to define new data elements. The maximum length for a data element is 30 characters. The first two characters must be ZZ and the remaining 28 characters can be arbitrarily assigned. ZZxxxxxxxxxxxxxxxxxxxxxxxxxxxx x- Descriptive Text Should use the same name in both Domain and Data Element

Search Helps
As of SAP R/3 release 4.0, Matchcode Objects have been replaced by Search Helps. The search help concept simplifies and extends the past options for defining an input help (matchcode). Search Helps must begin with the letters Y or Z and can be up to 30 characters long. Existing help views and matchcodes are automatically converted to Search Helps in a release upgrade to 4.0. Note: Search Helps are ABAP dictionary objects and can be created at any point in the Repository Browser. Search Helps are linked to data elements, check tables and structure fields. You can also define default values for input parameters using Search Helps. Search Help Exits are function modules that allow you to change the appearance and functionality of how the Search Help appears to the user, however it is recommended by SAP not to overuse Search Help Exits to preserve the integrity of regular Search Help process. Note: Several Search Helps can be combined to form a collective Search Help. The user can then choose between several search options in the input help, as was the case or matchcodes. gat_xxxxxxxxxxxxxxxxx g Y or Z a Module Id (see appendices) t type E Elementary C Composite x descriptive text

Data Element Supplement


ZZxxxxxxxxxxxxxxxxxxxxxxxxxxxxnnnn x name of the corresponding Data Element n range between 0001 to 9999

Table Fields
Field names in SAP tables can be upto 16 characters. Whenever a field is added to an SAP supplied table, the convention followed is to start with ZZ and then add some descriptive text, whereas for custom defined tables the naming convention is open. ZZxxxxxxxxxxxxxx (Attached to SAP delivered tables) xx Descriptive Text xxxxxxxxxxxxxxxx (Attached to custom tables)

14 of 19

Project

<ABAP/4 Naming Conventions>

xx Descriptive Text

Lock Objects
Lock objects control simultaneous access to a particular table/entry by two update users. Locks are set and released by calling a function module. When a lock object is activated, the system automatically generates the function modules to be included in an ABAP program. Lock object names can be up to 16 characters long and should start with the prefix EZ_. The remaining characters are open to the developer. For Project SAPling table name will be used for the remaining characters. Eg_xxxxxxxxxxxxx g Y x Primary Table Name (where multiple Lock Objects are required for the same primary table, assign a unique digit to the final position )

Function Groups
SAP function modules are programs written in ABAP that can be called by any ABAP program or the function modules themselves. They are managed centrally in the function library, which provides search, display, maintenance and printing capabilities for all standard and custom function modules. Function modules are grouped together using function groups. SAP supplied function groups should never be assigned to new function modules. Function group names are 26 characters long and must start with a Z. The next character will store the Module ID. The remaining 24 characters are open. Ya_xxxxxxxxxxxxxxxxxxxxxxx a Module ID (see appendices) x descriptive text

Function Modules
The function module name can be up to 30 characters long and must begin with Z. This will differentiate custom created function modules from standard SAP function modules. The remaining 28 characters must start with the module id and an underscore and should reflect the nature of the function. Underscores are used to separate words. Ya_xxxxxxxxxxxxxxxxxxxxxxxxxxx a Module Id (see appendices) x descriptive text

Messages Classes and Number


Messages are used in ABAP programs to send information to the user. There are six different types of messages: information, warning, error, abend, exit and success. A message consists of a 20 character message class and a 3 digit message number. The first character of the message class should be a Y or a Z and the second character will contain the Module ID. The remaining 18 characters are open. The message number is open to any number between 000 and 999.

15 of 19

Project

<ABAP/4 Naming Conventions>

Message Class: ga_xxxxxxxxxxxxxxxxx g Y or Z a Module Id (see appendices) x descriptive text Message Number: nnn nnn Number Interval 001 999

Number Range
Number ranges are used to assign numbers to individual database records for a commercial object, to complete the key. Such numbers are e.g. order numbers or material master numbers. The R/3 number range management also monitors the number status, so that numbers which have already been issued are not reissued. All dialogs, database accesses or other activities which are necessary for the maintenance of number range objects and number ranges and number allocation in user developments, can be performed using SAP function modules. The layout set name can be a maximum of 10 characters. It should start with a Y or a Z. This is followed by the Module ID and the remaining characters are open to any alphanumeric combination. ga_xxxxxxx g Y or Z a Module Id ( see appendices) x Descriptive Text

Layout Sets
A layout set in SAPscript is used for page layout. The layout set contains various elements used for layout control. A layout set definition contains the following elements: Header Data, Paragraphs, Character Strings, Windows, Pages and Page Windows. The layout set name can be a maximum of 16 characters. It should start with a Y or a Z. This is followed by the Module ID and subsystem. The remaining ten characters are open to any alphanumeric combination. gabb_xxxxxxxxxx g Y or Z a Module Id (see appendices) b Sub Module Id (see appendices) x Descriptive text

Standard Texts
ga_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx g Y or Z a Module Id (see appendices) x descriptive text

16 of 19

Project

<ABAP/4 Naming Conventions>

Styles
A style defines the set of paragraph and character formats that are available for formatting a document. A typical style contains, for example, a definition for a standard paragraph, list paragraph formats, and possibly special-purpose paragraph formats for headings, data in forms, and so on. A style also usually defines such character formats as boldface, italics, and so on. You can select from these formats to format your document. If you select a style, this style provides the character and paragraph formats for your document. Any formats defined in the form selected for a document are ignored. Style Names can be upto 8 characters. They must begin with either a y or a Z. This is followed by the module id and then by a running serial number. ga_999 g Y or Z a Module Id (see appendices) 9 Number from 001 to 999

17 of 19

Project

<ABAP/4 Naming Conventions>

3.0 Appendices
Module ID & Sub-Module ID :
For all development purposes, the application process ID will be a 3 character field which acts as an identifier for each program developed. This identifier can be used to group related programs and development objects together and may be used to give a distinct signature for interface control logic, reporting, and data file names. The Application process ID will be divided into Module ID and a Sub-Module ID for further categorization and organization. See the table below for the Module ID and Sub-Module relationships: Application Function Financial Accounting Module ID F AP AR CF ED FC FM GL LC Controlling C IO CA PC PA Production Planning P PD AO PC PO MR CP MP SP Quality Management Q QP QI QC CA QN Materials Management M BD CM ED IM PI Basic data Common across MM EDI Inventory Management Purchasing Info system Quality Planning Quality Inspection Quality Control Quality Certificates Quality Notifications Plant Data Collection Assembly Orders Planning & Control - Rep. Man Production Orders Material Requirements Plann Capacity Planning Master Planning Sales & Operations Planning Internal Orders Cost Center Accounting Product Costing Profitability Analysis Accounts Payable Accounts receivable Common across FI EDI Financial Controlling Funds management General Ledger Consolidation Sub-Module ID Sub-Module Description

18 of 19

Project

<ABAP/4 Naming Conventions>

IV PR WM CB Sales & Distribution V BD BI CS CX ED IS SH SL SO TR Basis B CB IC Human Resources H BD CC PA TI IW BN PY Cross-Application Test/Throw-away Z T ZZ ST

Invoice Verification Purchasing Warehouse Management System Consumption-Based Planning Basic data Billing Sales Support Common across SD EDI Sales Info system Shipping Sales Sales Order Management Transportation Common across BASIS Interface Control

Basic Data Common across HR Personnel Administration Time Management Incentive Wages Benefits Payroll Cross-Application Test/Throw-away

If it appears that a specific development object cannot be appropriately classified by the current list of Module IDs, a new Module ID should be requested from the Development Team Leader.

Program Type Ids


C G I O M N R S U X Conversion General Functionality/Other Inbound Interfaces Outbound Interfaces System Maintenance/Utility Include Report Sapscript User Exit/Enhancement Temporary, Demo or Test programs

19 of 19

Vous aimerez peut-être aussi