ABAP Coding STD + Naming Conversions
ABAP Coding STD + Naming Conversions
Convention
www.atos.net
Issued by:
Atos
Integrated
Date/ SignatureProject Automation
6th August, 2012 Acceptance:
Date/ Signature:
Version 1.1 / English / 06 Aug 2012
History of Changes
Added Code
20/02/20
2.0 M for CRM and <Name> <Name>
13
SRM
CONTENTS
1 NAMING CONVENTIONS............................................................4
1.1 NAMING CONVENTIONS FOR ABAP DEVELOPMENT
4
1.2 SAP SCRIPTS
8
1.3 SMARTFORMS
9
1.4 PROJECT NAMES FOR ENHANCEMENTS
9
1.5 AUTHORIZATION RULES & PROCEDURES
9
2 NAMING CONVENTIONS............................................................11
2.1 NAMING CONVENTIONS FOR DATA DICTIONARY OBJECTS
11
2.2 MESSAGE ID AND NUMBER
13
2.3 BATCH JOB SCHEDULING
14
2.4 WORKFLOW OBJECTS
15
2.5 TRANSPORT REQUESTS
16
2.6 Country codes
24
Naming Conventions
Position 1 is a Z.
Position 2 represents the SAP module, following SAP standards:
R Report
I Interface
C Conversion
M Module pool
N Include (used in another program)
K Class
F Forms
W Workflows
Y Webdynpro for ABAP development
E Enhancement
A Authorization Object
Position 1: ‘Z’
Position 2: Functional field as described in Section 1.1
Position 3: Object Number
Position 4 onwards: Freely definable
1.1.2 Dynpros
Custom screen painter dynpro must always be numbered greater than 1000.
XXXXXXXX 9 NNN M
where:XXXXXXXX Module Pool Screen Belongs To
9 Index number to indicate customer-specific Number
NN Free form numeric number
The recommended ranges are:
· 9000 - 9499 for changes to SAP programs
Module pools, which are used when developing custom transactions, are also ABAP
programs. They are identified by the format:
Module pools commonly use INCLUDE routines for shared structures: for example:
Name of the pool program: ZVM001_XXXXX
Position 1: ‘Z’
Position 2: Functional field as described in Section 2.1
Position 3: ‘F’ for Function Module and ‘G’ for Function Group
Position 4: Object Number
Position 5: ‘_’
Position 6 onwards: Freely definable and descriptive text
variables, formulas, cells, and key figures, you can create reports to meet your
specific needs.
1.1.7 Reports
Position 1: ‘Z’
Position 2: Functional field as described in Section 2.1
Position 3: ‘R’
Position 4: Object Number
Position 5: ‘_’
Position 6 onwards: Freely definable and descriptive text
Position 1: ‘Z’
Position 2: Functional field (Section 2.1)
Position 3: Program type (Section 2.3)
Position 4: Object Number
Position 5: ‘_’
Position 6 to n: Name of the SAP standard program.
Example: ZVM001_SAPMV60A
1.3 SmartForms
1.4 Enhancements
1.6 Workflows
This section specifies the standards for ABAP/4 and Table authorizations.
You can assign an Authorization Group to an ABAP/4 program in the attributes screen.
Authority Check statements are useful for further restriction on the execution of the
program. E.g. the execution of a report can be limited to a specific company code,
depending on the profile that was assigned to the user.
The AUTHORITY-CHECK statement searches the user's master record for authorizations
corresponding to the authorization object specified in the statement. This means
searching through all profiles in the master record, since the user could have more than
one authorization for the given authorization object.
To pass the authority check, the user must have at least one authorization specifying all
the values given in the AUTHORITY-CHECK statement. If so, the system sets the return
code SY-SUBRC to 0, and your program can allow the user to continue working. In all
other cases, you must prevent the user from proceeding or accessing the data.
We need this kind of Authority to limit the number of users who can maintain tables.
How do I do that?
The table TDDAT defines the link between a table and an authorization group. Those
authorization groups are defined in table TBRG. The related object is S_TABU_DIS.
2 Naming Conventions
Error messages in custom developments should use a message ID that begins with
“Z” followed by the application letter. All messages should be as general as possible
with the detail transferred via “&” symbols in the message.
2.2.1 Message Id
Z<module code>M_XXXX
9 NN (3 Characters)
When including messages for programs that do not require multi-lingual messages,
use the general ID 38 message 001 and the WITH clause to enter the message.
There are 6 scenarios, which will be explored, each having a different job name.
2.3.7 Interfaces
F is fixed
G is for Global, as L is for Local Roll Outs
10 is for roll out , where 10 if for Global, 20 is for Europe, 30 is for
Americas, 40 is for Asia Pacific
01 indicated applicability – 01 for multiple countries, unique 2
character identifier for single country applicability (eg. UK, FR, US,
PR…) – see defined country list for all countries
Change Request Number is the internally generated project change
request number (5 characters)
Process-ID would be (e.g.) PP-01-01 and provides the direct link to the
Functional Specification (FS) (header only, no indication of which
requirement specifically is met by the content)
Meaningful description
Comments in the body of the code are only required if they help the understanding
of the processing.
Example :
*******************************************************************
**
* PROGRAM ID : Zxxxxxx Copy of:XXXXXXXXX
* TITLE : xx
* FO contact : XXXXXXXFUNCTIONAL CONTACTXXXXXXx
* CREATE DATE : OCT-03-2007
* AUTHOR : Name & T-Number
* Project No. : Tracker Ticket number e.g FI-07-00-TS-001
*------------------------------------------------------------------
-*
* DESCRIPTION :
Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
* xxxxxxxxxxxxxxxxx .
*------------------------------------------------------------------
-*
* CHANGE HISTORY
*------------------------------------------------------------------
-*
* DATE | NAME | DESCRIPTION |
Reference
*------------------------------------------------------------------
-*
* MON.DD.YYYY| Tx99999 | Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
XYZDDMMMYY
* | | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
* | | Transport No. |
*-------------------------------------------------------------------*
* | | Transport No. |
*******************************************************************
**
The above header block must be added to all programs, including INCLUDES.
The reference is used to identify the changed lines into the ABAP code. The format
of this reference is:
XYZDDMMMYY
The reference must be placed in any changed line during the change of an
existing ABAP.
To improve the readability of the ABAP code, it is required to use rules to specify the names of the internal data
objects. Depending on the type of data objects, use the following prefix codes.
OR
xxxxx. : object
Import description (as possible
variable I_xxxxx the standard name)
xxxxx. : object
Changing description (as possible
variable C_xxxxx the standard name)
xxxxx. : object
Export ES_xxxx description (as possible
structure x the standard name)
xxxxx. : object
Import IS_xxxx description (as possible
structure x the standard name)
xxxxx. : object
Changing CS_xxxx description (as possible
structure x the standard name)
xxxxx. : object
Export ET_xxxx description (as possible
table x the standard name)
All the code elements must be coded in the following defined sequence to help find the coding elements in the
REPORT declaration.
INCLUDES declaration.
TABLES declaration.
TYPE-POOLS
TYPE declarations
CONSTANTS declaration.
RANGES definition.
FIELD-GROUPS definition.
FIELD-SYMBOLS definition.
INITIALIZATION event.
AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN.
START-OF-SELECTION.
END-OF-SELECTION.
TOP-OF-PAGE.
END-OF-PAGE.
AT LINE-SELECTION.
AT USER-COMMAND .
AT PFnn.
MODULE coding.