Вы находитесь на странице: 1из 8

SCSL

Quality Procedures ABAP Code Review Checklist


Manual

Program Name:
Description:
WR / CR/ Iss No.
Developer:
Reviewer:
Review Date
Note:
Sl.No Program Objects
Program Definition
Attributes
1 Program Name(Comply with the Customer Quality Standards)
2 Title of the program (Format: TO Description -TO Number)
3 Type(1-Online,M-Module pool,etc)
4 Status(This should always be ‘K’ for ABAPs developed by anyone other than SAP).
5 Application (this should correspond to the third character of the name).
6 Development Class(Give the Relavant Development Class)
7 Authorization Group (If Type is ‘I’, an authorization group is not needed).
8 Check for the usage of Logical Database. If not found there should be valid reasons for not using
LDBs.Please note that "Not specified in the Specification" is not a valid reason( LDB should be
the 1st option .Select to be used only if LDB is not available )
Text Elements
9 Title and Headers
If the report definition says ‘no standard page headings’ or if no report is produced in the ABAP,
then these can be blank; otherwise they must be filled in. Normally this comes from the title given
in the attributes.
Selection Texts
If the ABAP uses Selection Options or Parameters, they must be documented here.

Text Symbols
Texts which are used in cloumn headings, Write statements should not be hard coded in the
program.Must use Text-symbols for this.
Program History Documentation

10 a) Format as prescribed by the customer

CTS Document / Naming Standards (Use SE09)


11 a) Standard Comment(Header) . Check for CTS Number and TO reference. The Naming Convention
for CTS Number should be <Release No>/<TO Ref>/<Short Description> Eg.
R03/R000104/Quality Data Analysis
12 Report Definition should contain:
Report xxxxxxxx NO STANDARD PAGE HEADING
LINE-SIZE yyy (YYY shall not exceed 132 )
LINE-COUNT zz (ZZ shall not exceed 65).
13 Technical object reference , There are 2 options for the TO reference in an ABAP
1) Internal in source code in first block of comment
2) In the documentation -> short text. Which is text elements -> title & headers -> title
Program Declaration
Naming Standards:
All Data Declarations to be included in a separate include program as per customer naming
standards(YGFI<TO No>T, 3rd character- Application ,4th character - 'Include'Program Type' and'T'
14 refers to TOPINCLUDE
Data Definition
Note: Should be Self Explanatory Max : 30 Characters.
a) Types begin with t_ (with comments)
b) Internal table (with comments & comments for elements of internal table)
a.Internal table begins with I_ for eg I_mara
b.If more than one Internal table for a Database Table occurs
then follow the convention I_<database table name_01>
Eg: I_mara_01,I_mara_02 …
c. If the internal table is populated from a variety of sources,name the table according to it's
Purpose.(eg: I_totals etc..)
c) Work areas for internal tables begin with wa_ (with comments)
d) Variable names begin with v_ (with comments)
e) Constant names begin with c_(With comments) , Literals to be declared as constant
f) Data Dictionary elements declaration(with comments)
Selection Screen Element Definition

f) Program parameters begin with p_(with comments)


g) Select Options begin with s_(with comments)
h) Range Parameters begin with r_(with comments)
i) Radio Buttons has to declared as "rad_"
j) Check Boxes has to be declared as "ch_"
K) Block Title : Text Element Range of "900-999" Should be used to define Block Names
l) Comments: Text Element Range of "800-899" should be used .
Subroutine / Include Definition

Sourcecode of all subroutines to be in a separate include program as per customer


standards(YGFI<TO No>F)-3rd character- Application ,4th character - 'Include'Program Type' and' F'
refers to subroutine(Avoid use of calling external subroutines)
m) Subroutine Parameters begin with p_(with comments)
n) Subroutine names begin with f_(with comments)
Design subroutine names with <f_object_action> For Eg… f_Tax_Compute .(Proper
o) documentation)
SQL Queries
When ever GET statement is used, select the fields which are required. For Example : GET VBRK
15.LDB FIELDS ERNAM VKORG…… etc.(Provided it works properly)
16.Select Statement

Data base selections, [ 1)Check the use of * in select statements, preferable to have a field list
always( Select * to be used only when more than 1/3 of the total fields required for processing for
the DB table_ 2)Check the usage of Start & End-of-Selection events where ever necessary]
SY-SUBRC is checked after database calls and other activities when logic must be used for Error
Handling.

When an internal table needs to be created directly from one database table,the SELECT INTO is
used to fill the internal table.It is faster to use INTO version of a SELECT statement rather than
use APPEND
Avoid SELECT …. ORDERBY .Better to use SORT after appending into an Internal Table.
Where Clause
For Transparent or Pool Tables ,the SELECT statement is fully qualified as much as possible with
the WHERE option, including data fields that are not part of the key
For Cluster tables,only the consecutive fields that are part of the key are qualified in the WHERE
option .The CHECK Command is used to eliminate other records .

The ordering of the WHERE Statements match the arrangement of the keys in the table records.
Fields compared in the WHERE clause of the SELECT statements have similar types.
The use of negative logic in SELECT's is avoided whenever possible .
When using the AND or OR operator ,the most likely elimination criteria is specified first,and so on
down to the least likely criteria.
Aggregrate functions (SUM,AVG,MIN,MAX) shall be used whenever possible
Primary Key Used - Whenever possible ,the full table key is specified and SELECT SINGLE is
specified
Secondary Index Usage - When possible ,in the Where clause the fields of the INDEX are in the
specified order and linked by the logical AND with comparisons for equality .
A Secondary Index has been considered if :
1) Non-key fields or fields for which index support does not exist are repeatedly used to make
selections.
2) Only a small part of a large table is selected .(<5%)
3) The WHERE condition of the SELECT is simple .
4) Fields that make up the index significantly reduce the selection set of records by matching the
unique Qualifiers in the WHERE clause .
For relation operators Use 'EQ' 'GT' 'LT' 'GE' 'LE' instead of
symbols '=' '>' '<' etc…
Note : Prior to creating secondary indexes ,consultation with the Database administrator is
required.
Data Processing
Avoid Negative Logic
Use Structured Coding Style .Avoid the use of 'STOP' & 'EXIT' in the program .

Exit Should be used only when there is no other structured method for exiting a Loop or Form
Currency Calculations are performed between currency fields only - Both fields must have the
Same Currency key.
Calculations of fields with a Unit of Measure - Both fields must have the Same UOM .

ALL CASE statements must have a WHEN OTHERS statement to capture unexpected errors.
All LOOPS,Ifs,CASEs and similar statements are broken down to their simplest form and nesting is
not complicated unless absolutely necessary
MOVE statements - when possible ,the destination operands are kept as the same data type as
the source operands
CASE statement preferred to multiple ELSEIFs .
WHILE preferred to DO .
CLEAR command - CLEAR <field> is used to initialize rather than explicit moves.
Table headers and work areas are CLEARed at the end of loop processing .
MOVE CORRESPONDING is only used for small tables or tables where most but not all ,fields
need to be moved .
when all fields need to be moved and the attributes for every field and Position are identical ,the
table is moved as a group
When COLLECT semantics are needed,the COLLECT command is used .

Internal Tables / Extracts


All fields involved in sort options ( user specified / hardcorded in the abap program) of the output
17.Extracts data shall be the part of the fieldgroup'Header'.
18.Internal Tables Nested Loops are avoided .
Use APPEND LINES OF <I_table> to merge two internal tables .
APPEND SORTED BY used only for reportrs such as "TOP 50" or "TOP 100" .
For reading ,LOOP …. WHERE is used instead of LOOP/CHECK .
For READ operations ,the key fields are specified for the READ access explicitly .
when performing direct reads,the BINARY SEARCH is used only when the table contains more
than 500 rows and must be sorted by the key
REFRESH <table> is used to initialize table records .Internal tables are REFRESHed when
needed .
The FREE command is used to release the memory allocated to internal tables when the program
is finished processing the data in the table
OCCURS clause - Use Occurs '0' .
Output Formatting
19 a. Check for the Colouring format
b. Check the Line Size & Line Count ,if it is more than the standard( 132 for printing or Max of
255) clearance has to be obtained from the analyst.
c. Take a printout of the report & check the output with the Spec
d. Write statement of Currency / UOM shall be outputted specific currency key / UOM key

New Page Definition :NEW-PAGE NO-TITLE NO-HEADING LINE-SIZE yyy LINE-COUNT zz .


Messages
Every Message (Error/Information/Warning) in the program has a comment beforehand for
20 explanation .

21 If function modules used ,every error message should be captured and processed accordingly .
22 Where output/Error/Status is written a comment should be added for easier understanding .
23 If error messages occur the processing of report should be stopped .

Extended Code Check

24 The “Pretty Printer” function has been used to line up the code.
25 Usage of STD includes(YGSITOPPAGE,YGSIENDREPT)
Check for any unused code lines(i.e) Commented code lines in case of new development and in
case of TDL / PQR , the commented lines should have the 'CTS Number' within the comment
26 string in the editor

27 Check for any kind of Delete statements.If found check with the developer if it is really required.
28 Check for any division by Zero
An Extended Syntax Check has been run on tha ABAP Program . The Run time Trace Analysis
29 (SE30)
The Run time Trace Analysis (SE30) has been used to evaluate the hit lists of the top CPU
consumers,table accesses,and to get a general idea of the coding run during the program
30 execution .
Documentation
31 User Documentation in SE38
32 Comments on events
33 Comments on processing blocks
34 Comments on every PERFORM subroutine call
35 Comments on every FUNCTION call
36 Comments for every Include program statement
37 Documentation for each PERFORM Subroutine
38 Documentation for each Include Program

Layout set Inspection


39 Title is correct/Valid .
40 Development Class is correct.
41 Naming Standards for layout set ,windows,pages,pagewindows & text elements are followed
Logic from existing SAP layout (copied as a basis for custom layout) is commented out - not
42 deleted .
43 The tab symbol(,,) is used instead of spaces .
44 Underlines,etc., are written using commands such as uline(xx) instead of typing it out .
45 Revision comments are placed in the layout set in a window called 'History' .
46 Whether Correct Page format is used .
Layoutset documentation to be completed with details of the elements used, the print programs
47 that utlizes the layout set and also the subroutines used in the layout set

Programming
Modularization &
Optimization

48 Spacing : Please leave blank lines between coding structures or clearly definable coding blocks.
The Standard structure for coding a ABAP Program has been followed as outlined in the
49 Development Standards Document
50 Modularize code - Forms Should be used to group Logical Segments of Code.
51 Modularize the code as much as possible using FORM Routines .
52 Putting Common pieces of code in FORM routines is also recommended.

Вам также может понравиться