Table of Contents
Scope The team members will use this standard during the construction phase. It covers
References Nil
(Optional)
The 8-character ABAP names will conform to the formats given below:
Position 1:
All characters except ‘Y’ and ‘Z’ are reserved for SAP.
Y - Denotes a SAP ABAP, which has been copied and modified. All
original SAP code must remain in place commented out if appropriate.
Positions 3 - 8 of the ABAP name remain as the SAP original. These will
be referred to as Y-ABAPs.
Copies of original SAP ABAPs must remain Y-ABAP’s in the following
situations.
If the changes to the standard SAP code will have to be applied again
after each upgrade.
If the ABAP is called automatically by another standard SAP ABAP
or transaction.
Z – Denotes programs, either written from scratch or based on a SAP
original without the original code being retained. (This may be done if
the changes become significantly large. As a guide, if more than a quarter
of the original code lines is changed, a new Z-ABAP is desirable).
Position 2:
For Y-ABAPs
Position 2 is only changed from the original SAP ABAPs name, in a SAP
system, which contains multiple Development Groups. This position
indicates the ABAPs ‘owner’. A single character or number will
represent the Development Group.
For Z-ABAPs
Following represents the SAP Application (as per SAP ABAPs).
A Assets Accounting
C PPC (Production Planning and Control)
F Financial Accounting
H Human Resources Planning
I Maintenance
K Cost Accounting
L Warehouse Management
M Materials Management
N Hospital
P Human Resources
S System
V Sales
X This has been allocated to SAP enhancements – e.g. user exits
etc.
In cases where some ambiguity may be present, such as in ABAPs
dealing with one of the Cycles where strict Application boundaries are
crossed, the application letter used should represent the primary use of
the ABAP.
S External Routine
Status:
This should contain a ‘T’ (Test program) while the program is being developed,
and a ‘K’ (Customer production program) once testing of the program is
complete.
Application:
Application must be entered. (For a list of applications please refer to possible
entries on-line). Must match the second character of the program name.
Authorization Group:
A list of valid authorizations groups can be found in program ZSAUTH (for all
SAP releases before 3.0) and in table TPGP (for all SAP releases after 3.0).
This field is mandatory in the following cases: -
If a logical database is not being used for the primary source of data.
If specific authorization checks on the primary source of data are not done in
the ABAP.
Logical Databases:
Logical databases are optional.
It is not mandatory for the application of the logical database to match the
application of the ABAP.
Fixed point arithmetic:
When fixed-point arithmetic is switched on, all calculations are performed using fixed-
point arithmetic. The default is set to ‘on’ (This is especially useful when dealing with
floating point numbers).
1.3.2 Indenting All ABAPs must be neatly indented. The standard indent applied by Pretty Print is 2
positions. Statements should be indented and aligned, as it makes reading the ABAP
much easier. For example:
TABLES: VBAK, “ Comment
VBAP.
WRITE: /01(05) xx-xxxx, “ Comment
10(08) xx-yyyy,
xx-zzzz DD/MM/YY.
Not
TABLES: VBAK, VBAP.
WRITE: /1(5) xx-xxxx, 10(8) xx-yyyy, xx-zzzz DD/MM/YY.
1.3.3 Spacing Please leave blank lines between coding structures, or clearly definable coding
blocks.
For example.
IF . . . . . .
MOVE . . . . .
ENDIF.
*------------ Check For ......... -----------------------------------------------------------*
IF . . . . . .
PERFORM . . . . . .
ENDIF.
*EJECT
1.3.4 Paragraphing Ideally no consecutive piece of code should extend to more than 50 lines or so.
Elements of the code should be split into FORMs so that they become
manageable. Putting common pieces of code in FORM routines is also
recommended.
1.3.5 Variable When naming the variables, Internal tables, Parameters and Select options do
naming follow the following naming:
Variables V_XXXXXXXX…..
Internal tables I_XXXX.._XXXX
Parameters P_XXXXXX
Select options SO_XXXXX or S_XXXXXX
The Internal table if similar to a Database table shall preferably contain the name
of the DB table.
Always use variable names that correspond to SAP Data Dictionary naming. This
carries the advantages of often being self-defining, and of being consistent and
recognizable.
For example:
DATA: BUKRS,
xxxx_BUKRS,
BUKRS_xxxx.
For record or internal table definition:
DATA: BEGIN OF rrrrrr,
BUKRS LIKE xx-BUKRS,
WERKS LIKE xx-WERKS,
MATNR LIKE xx-MATNR,
END OF rrrrrr.
BEGIN OF tttttt occurs nn,
xxxxxx LIKE xx-xxxxxx,
END OF tttttt.
As a general rule, keep names as short as possible, it reduces effort and helps to
avoid mistakes. Avoid using names containing a hyphen (‘-’) as the may appear
like table or database fields. The use of ‘like’ when defining a field is to be used
when possible. This will avoid problems at upgrade time.
If a DATA structure is to be used in many ABAPS, then create a structure in the
Data Dictionary.
When creating multiple variables, group fields with similar purposes together, for
example all Total fields could be coded together in one area.
1.3.6 Commenting Internal ABAP commenting is critical for ease of maintenance and for general
comprehension. It is a good practice to explain all working storage defined by
TABLES, SELECT-OPTIONS and PARAMETERS. Particular care should be
taken to explain the purpose of records and internal tables.
Comment blocks in the standard format are expected for the following structures.
REPORT, FORM . . ENDFORM, MODULE . . ENDMODULE
The report standard comment block must include the following information.
The notifications ‘UPDATE = Y/N’ and ‘BDC = Y/N’ using either ‘Y’ or ‘N’
as appropriate.
A brief description of the output produced by the ABAP
A brief description of the purpose of the ABAP.
Details of any special peculiarities in the coding.
The name of the author and the month/year it was written.
See ABAP ZSABAP for an example of a header block.
If a control structure is complex or large, then a comment block should be
included giving an explanation.
NOTE:
Pretty print will try to put all double inverted commas for comments in column 40.
If this is impossible because of the line length, it will increment the column
number in 5s.
1.4 Layouts
1.4.1 Selection These must follow SAP standards. All input fields must be left aligned with
Screens descriptions entered in a combination of lower and uppercase. No lines are to be
skipped between parameters and select-options unless a logical grouping of
parameters can be formed. All parameters and select-options must be assigned a
memory-id if one exists. Selection texts must be taken from the data dictionary
wherever possible (The texts are found on the data element). ‘Possible entries’
must be available wherever possible.
Memory-id’s can be picked up off the data element screen.
1.4.2 Reports Standard page headings and footers must be used. Column headings should follow
the same alignment as the field being represented, example, quantity fields must
have a heading that is right aligned.
All parameters entered on the selection screen should be displayed in the headings
of the report, example if a specific plant is called for, then the headings must
reflect which plant was selected.
The sequence of the fields from top to bottom and left to right should indicate the
sort sequence, as far as logically possible.
1.5 Modifications
1.5.1 Standard SAP Place a modification comment block at the top of the ABAP. If more than one
repairs (OSS Repairs) modification has been made, the latest change should be at the top. In the body of the
ABAP, any line no longer required must be commented out (with an asterisk (‘*’) in
column 1), NOT deleted. A line needing to be changed must also be commented out, the
new, modified line following it immediately.
The comment block must include the OSS number, the name of the person making
the modification and the date. All the altered lines, including lines commented out
must contain the OSS note number on the far right hand side of the line
(OSS99999).
(This is required to assist in upgrades). The description of the repair MUST be "OSS
Note xxxxx - Your Name - Description of Fix", e.g.: "OSS Note 42225 - Nico -
Itemization Display in prod. Order". If this convention is not followed, then the fixes
will be lost after an upgrade.
1.5.2 Approved The comment block must include the Repair number, the name of the person
Repairs making the modification and the date. All the altered lines, including the lines
(Changes/Repairs) commented out must contain the Repair number on the far right hand side of the
line.
The change MUST then be documented in the repair documentation.
1.5.3 Modifications toAs a general principle, if a standard SAP ABAP is to be modified, create a copy
Copies of Standard (using ‘Yxxxxxxx’ for the ABAP name) and modify the copied version only.
SAP ABAPs
Place a modification comment block at the top of the ABAP. If more than one
modification has been made, the latest change should be at the top. The comment
block must include the name of the person making the modification and the date
as well as the modification id (the modification id consists of the author(s) initials
and the date, in the format IIDDMMYY). The original name of the SAP ABAP
must be specified to aid in identification should this be necessary.
In the body of the ABAP, any line no longer required must be commented out
(with an asterisk (‘*’) in column 1), NOT deleted. A line needing to be changed
must also be commented out, the new, modified line following it immediately. All
the altered lines, including lines commented out must contain the modification id
on the far right hand side of the line. This is required to assist in upgrades.
Version management cannot be relied upon for the following reasons: -
Version management will only keep the changes made from the first time the
new modified ABAP is copied to production. I.e. the first lines of code
changed would not be recorded.
Before release 3.0d, it is not possible to copy a single client from one R3
system to another. Therefore when a copy of a client from production to
development is required, the entire system must be copied. In this process
record of versions may be lost. Whenever this copy process happens the
versions will be lost.
It is not necessary to comment each individual line that is changed in the program
so long as a detailed description of the change is provided in the REPORT
comment block and other comments and documentation for the ABAP are updated
to reflect the change.
If extensive changes are being made to the program, more detailed comments in
the body of the ABAP will be required.
In order to pick up the exact purpose of the change quickly, the correction or task
description should be very concise and accurate.