Abap naming conventions
Upcoming SlideShare
Loading in...5
×
 

Abap naming conventions

on

  • 844 views

 

Statistics

Views

Total Views
844
Views on SlideShare
844
Embed Views
0

Actions

Likes
1
Downloads
28
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Abap naming conventions Abap naming conventions Document Transcript

  • ABAP NAMING CONVENTIONS Version Revision history Version Date 4.0 09-Jun-2006 4.0 Release date 19-Jun-2006 Description Author Separate document for naming conventions for easy Yadav Kulkarni document maintenance purpose. This initial version created from information contained in “ABAP Development standards and naming conventions” document Version 3.0. Review history Version Date 4.0 19-Jun-2006 Reviewer comments Review of Version 4.0 Reviewed by Rajat Bahadur Approval history Version Date 4.0 19-Jun-2006 Approver comments Approval of Version 4.0 Approved by Sandeep Sahasrabudhe Page 1 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 Contents SCOPE................................................................................................................................................................................................4 SHORT FORMS AND FORMATTING NOTATIONS.................................................................................................................4 1. ABAP WORKBENCH OBJECT NAMING CONVENTIONS..................................................................................................5 DEVELOPMENT CLASS (PACKAGE)....................................................................................................................................................5 TEST PROGRAMS................................................................................................................................................................................5 REPORT PROGRAMS...........................................................................................................................................................................5 INTERFACE PROGRAMS......................................................................................................................................................................5 CONVERSION PROGRAMS...................................................................................................................................................................5 INCLUDE PROGRAMS..........................................................................................................................................................................5 SUBROUTINE POOL PROGRAMS..........................................................................................................................................................5 MODULE POOL PROGRAMS................................................................................................................................................................5 FUNCTION GROUPS............................................................................................................................................................................5 FUNCTION MODULES & ITS INTERFACE COMPONENTS......................................................................................................................6 FORM PRINT PROGRAMS....................................................................................................................................................................6 FORM – SAPSCRIPT & SMARTFORM................................................................................................................................................6 FORM – STYLE & SMARTSTYLE........................................................................................................................................................6 STANDARD TEXTS..............................................................................................................................................................................6 PROGRAM VARIANTS........................................................................................................................................................................6 ALV LAYOUT VARIANTS..................................................................................................................................................................6 COPIES OF STANDARD PROGRAMS OR FORMS...................................................................................................................................6 TRANSACTION CODES........................................................................................................................................................................6 MESSAGE CLASS AND MESSAGE NUMBERS.......................................................................................................................................6 2. ABAP DICTIONARY OBJECT NAMING CONVENTIONS...................................................................................................7 DOMAIN.............................................................................................................................................................................................7 DATA ELEMENT.................................................................................................................................................................................7 STRUCTURES AND TABLE TYPES.......................................................................................................................................................7 TRANSPARENT TABLES......................................................................................................................................................................7 DATABASE VIEWS..............................................................................................................................................................................7 HELP VIEWS (SEARCH HELP).............................................................................................................................................................7 POOL TABLES AND CLUSTER TABLES................................................................................................................................................7 LOGICAL DATABASE..........................................................................................................................................................................7 FIELDS IN STRUCTURE/TABLE TYPE/TRANSPARENT TABLE..............................................................................................................7 LOCK OBJECTS...................................................................................................................................................................................7 DATABASE TABLE SECONDARY INDEX..............................................................................................................................................7 APPEND STRUCTURES........................................................................................................................................................................7 3. ABAP OTHER MISCELLANEOUS OBJECT NAMING CONVENTIONS..........................................................................8 AREA MENU.......................................................................................................................................................................................8 SAP MEMORY PARAMETERS (SPA/GPA).........................................................................................................................................8 NUMBER RANGE OBJECT...................................................................................................................................................................8 CHANGE DOCUMENT.........................................................................................................................................................................8 ENHANCEMENT – SMOD/CMOD PROJECT......................................................................................................................................8 ENHANCEMENT – BADI DEFINITION - IMPLEMENTATION................................................................................................................8 BUSINESS OBJECTS AND COMPONENTS..............................................................................................................................................8 CLASSES............................................................................................................................................................................................8 METHODS..........................................................................................................................................................................................8 BASIC IDOC TYPE.............................................................................................................................................................................8 IDOC TYPE........................................................................................................................................................................................8 IDOC SEGMENT TYPE.......................................................................................................................................................................8 BAPI.................................................................................................................................................................................................8 QUERY INFOSET................................................................................................................................................................................9 QUERY USER GROUP.........................................................................................................................................................................9 QUERY...............................................................................................................................................................................................9 AUTHORIZATION OBJECT CLASS.......................................................................................................................................................9 AUTHORIZATION OBJECT...................................................................................................................................................................9 TRANSPORT REQUEST DESCRIPTION..................................................................................................................................................9 LSMW, SXDA/SXDB PROJECTS/SUBPROJECTS..............................................................................................................................9 Page 2 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 APPLICATION SERVER FILENAMES.....................................................................................................................................................9 BDC SESSION....................................................................................................................................................................................9 4. PROGRAM HEADER DOCUMENTATION BLOCK............................................................................................................10 5. SAMPLE PROGRAM DOCUMENTATION BLOCK.............................................................................................................11 6. ABAP PROGRAM DATA NAMING CONVENTIONS...........................................................................................................13 Page 3 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 Scope Scope of this document is to describe naming conventions for ABAP developments and its components. Short forms and formatting notations Application area Materials management Production planning and control Quality management Sales and distribution Finance Controlling Asset management Investment management Treasury Plant maintenance Project system Human resource Personnel time management Cross applications Basis Customer relationship Customer service Defence forces & public security Enterprise portal Industry specific component NetWeaver component Public sector management Product lifecycle management Supply chain management Supplier relationship management General (Common across modules) MM PP QM SD FI CO AM IM TR PM PS HR PT CA BA CR CS DF EP IS NW PB PL SC SR GN Development type Forms, Form components and texts Reports Interfaces Conversions Enhancements Module pool Function group and Function module Data dictionary objects ALE, EDI and IDOC components Test developments F R I C E M U D A T • Naming conventions in this document contains following formatting conventions… o Symbol enclosed in triangular bracket <> refers to one of acronyms and shall be replaced with appropriate value or short form. o Symbol enclosed in square bracket [] refers to optional part of the naming convention and shall be replaced with appropriate value or short form when decided to opt. Such optional parts when adopted shall be consistent throughout the implementation. Page 4 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 1. ABAP Workbench Object naming conventions • Development class (Package) Z<Application area>[_Development type] Note: SAP provided development class $TMP shall not be used for any kind of developments. • Test programs Z<Developer ID>_<Text to represent use>_nn Where nn is sequential number between 01 to 99 Note: All test developments shall be included in proper transport request with description as “Test – Not to be transported”. • Report programs Z<Application area>R_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Interface programs Z<Application area>I_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Conversion programs Z<Application area>C_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Include programs Z<Application area>N_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Subroutine pool programs Z<Application area>S_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Module pool programs Main program: SAPMZ<Application area>T_<Text to represent use>_nn Where nn is sequential number between 01 to 99 Include for data declaration: Z<Application area>N_<Text to represent use>_TOPnn Where nn is sequential number between 01 to 99 Include for PBO modules: Include for PAI modules: Z<Application area>N_<Text to represent use>_Inn Where nn is sequential number between 01 to 99 Include for form routines: Z<Application area>N_<Text to represent use>_Fnn Where nn is sequential number between 01 to 99 Screen numbers: Screen GUI status: Screen GUI title: • Z<Application area>N_<Text to represent use>_Onn Where nn is sequential number between 01 to 99 Between 9000 to 9999 4 digit number same as the screen number Last 3 digits of the screen number Function groups Page 5 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 Z<Application area>_<Text to represent use> • Function modules & its interface components Function module: Import parameters: Export parameters: Table parameters: Exceptions: • Z<Application area>_<Text to represent use> I_<Name of the parameter> E_<Name of the parameter> T_<Name of the parameter> <Name to represent use> Form print programs Z<Application area>F_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Form – SAPScript & SmartForm Z<Application area>F_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Form – Style & SmartStyle Z<Application area>F_<Text to represent use>_nn Where nn is sequential number between 01 to 99 • Standard texts Z<Application area>TX[_<Text to represent use>]_nnnn Where nn is sequential number between 0001 to 9999 Exception: Custom naming conventions for building Logo library to allow dynamic logo selection. • Program Variants <Text to represent use> • ALV Layout variants /<Text to represent use> • Copies of standard programs or forms Z<Name of the standard program or form> Note: If name built this way doesn’t fit the length, first character from the standard name shall be removed. • Transaction codes Z<Application area><Text to represent the use> • Message class and message numbers Message Class: Message number: Z<Application area>_<Text to represent the use> Between 001 and 999. Page 6 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 2. ABAP Dictionary Object naming conventions • Domain Z<Text to represent use> • Data element Z<Text to represent use> • Structures and Table types Z<Application area>_<Text to represent use> • Transparent tables Z<Application area>_<Text to represent use> • Database views Z<Application area>_<Text to represent use> • Help views (Search help) Z<Table name>_<Text to represent use> • Pool tables and Cluster tables Z<Application area>_<Text to represent use> • Logical database Z<Application area>_<Text to represent use> • Fields in Structure/Table type/Transparent table - Maximum possible, use standard SAP field names if referenced data element is standard SAP data element. - For fields referencing to custom data element, ZZ<Text to represent use> • Lock objects EZ<Table name> • Database table secondary index 2 digit sequential number • Append structures Ideally should use SAP proposed name while creating append structure. If for any reason the same could not be used, use following convention… Z<Table name>nn Where nn is sequential number between 01 to 99 Page 7 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 3. ABAP Other Miscellaneous object naming conventions • Area menu Z<Text to represent use> • SAP memory parameters (SPA/GPA) Z<Text to represent use> • Number range object Z<Application area>_<Text to represent use> • Change document Z<Application area>_<Text to represent use> • Enhancement – SMOD/CMOD Project Z<Application area>_<Text to represent use> • Enhancement – BADI Definition - Implementation Definition: Z<Application area>_<Text to represent use> Implementation: Z_<Definition name> • Business objects and components Business object: Z<Text to represent use> BOR Supertype: Z<Text to represent use> BOR Subtype with delegation: Z<Supertype name> BOR Subtype without delegation: ZY<Supertype name> • Classes Z<Application area>_<Text to represent use> • Methods Z<Text to represent use> • Basic IDOC type Z<Application area>_<Text to represent use> • IDOC type Z<Application area>_<Text to represent use> • IDOC Segment type Z<Text to represent use> • BAPI Z_BAPI_<Text to represent use> Page 8 of 13
  • ABAP NAMING CONVENTIONS Version • 4.0 Release date 19-Jun-2006 Query InfoSet Z<Application area>_<Text to represent use> • Query User group <Text to represent use> • Query Z<Application area>_<Text to represent use> • Authorization Object class Z<Application area>X Where X is single character, appropriately to be replaced by value ranging between A to Z • Authorization object Z< Text to represent use> • Transport request description <Application area>_<Object ID>_Object description • LSMW, SXDA/SXDB Projects/Subprojects <Application area>_<Text to represent use> • Application server filenames <Application area>_<Object ID>_<Text to represent use>_<Time Stamp> • BDC Session <Object ID>_<Text to represent use> Page 9 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 4. Program header documentation block *----------------------------------------------------------------------* * Author : <Name of the author/Developer user ID> * Creation Date : <DD-MMM-YYYY> * Transaction : <Transaction code if attached> * Technical design: <Technical design document name> * Description : <Short description of the functionality of the * program> *----------------------------------------------------------------------* * Modification Information *----------------------------------------------------------------------* * Date : <DD-MMM-YYYY> * Author : <Name of the programmer/Programmer user ID> * Change request : <Change request number> * Transport number: <Transport number> * Description : <Short description of changes> ← *----------------------------------------------------------------------* Information and recommended way of usage: SAP allows maintenance of “Pattern”. It is recommended to maintain one single pattern to store above mentioned program header block to maintain consistency across all programs developed in a project. To maintain a patter, open any custom program in change mode in SE38 and follow the path… Utilities -> More utilities -> Edit pattern -> Create pattern Recommended name for the pattern: Z_PROGRAM_HEADER Whenever new program is created…. • First include this pattern through SE38 by clicking on “Pattern” button from Application toolbar, select “Other pattern” radio button in the popup, enter pattern name “Z_PROGRAM_HEADER” and press “Enter”. • Update necessary information in the included program header pattern. • Leaving one blank line after the program header pattern, then the actual code should start. Whenever modifications are being made to already released custom program…. • Modification Information block should be maintained with appropriate information. Page 10 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 5. Sample program documentation block <<Program Header Documentation Block>> <<Program declaration statement (if applicable)>> ************************************************************************ * Selection screen definition ************************************************************************ <<Remove this header if not applicable>> ************************************************************************ * Data declaration ************************************************************************ * Types * Internal tables * Work areas * Variables * Constants <<Add/Remove components to/from this data declaration header as required>> ************************************************************************ * Load of program processes ************************************************************************ <<Remove this header if not applicable>> ************************************************************************ * Initialization processes ************************************************************************ <<Remove this header if not applicable>> ************************************************************************ * AT-SELECTION SCREEN processes ************************************************************************ <<Remove this header if not applicable>> ************************************************************************ * START OF SELECTION processes ************************************************************************ <<Remove this header if not applicable>> Page 11 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 ************************************************************************ * END OF SELECTION processes ************************************************************************ <<Remove this header if not applicable>> . . <<Add more header(s) as necessary if additional events are being used>> . . <<Create subroutines using forward navigation and immediately use “Pretty printer” option to automatically create FORM header.>> Recommended name for the pattern: Z_PROG_DOCU_BLOCK Page 12 of 13
  • ABAP NAMING CONVENTIONS Version 4.0 Release date 19-Jun-2006 6. ABAP Program data naming conventions Program data type Types Internal tables - Standard Internal tables - Sorted Internal tables – Hash Work areas Variables Constants Ranges Field strings Field symbols Table controls Conventions for Global data T_<Name> IT_<Name> IS_<Name> IH_<Name> WA_<Name> G_<Name> C_<Name> R_<Name> S_<Name> FS_<Name> TC_<Name> Conventions for Local data LT_<Name> LIT_<Name> LIS_<Name> LIH_<Name> LWA_<Name> L_<Name> LC_<Name> LR_<Name> LS_<Name> LFS_<Name> LTC_<Name> Parameters Select options P_<Name> S_<Name> --- Forms Formal parameters Z_<Name> FP_<Name> --- Class Class interface Reference variables Method – Importing parameters Method – Exporting parameters Method – Changing parameters Method – Returning parameters CL_<Name> IF_<Name> REF_<Name> I_<Name> E_<Name> C_<Name> R_<Name> --LREF_<Name> ----- Page 13 of 13