- Only one statement per line
- Use a template for creation of ABAP programs with the standard includes
- Indent the program for readability
- Creation of variables
- Parameter – P_
- Select option – S_
- Radio button – RB_
- Ranges – R_
- Checkbox – PX_
- Constants – C_
- Counters – N_
- Internal tables – IT_
- Sorted – IS_
- Hashed – IH_
- Structure – X_
- Flags – FG_
- Global variables – G_
- Local variables – L_
- All literals that are displayed on a report must use Text Elements
- Use GUI_UPLOAD and GUI_DOWNLOAD to upload or download data
1.2. Guidelines for Internal tables
- Read internal table WITH KEY particularly for sorted and hashed
- Read only the needed fields thru TRANSPORTING
- Use the BINARY search wherever possible
- Avoid nested looping
- Avoid COLLECT statement
- Specify the sort fields
- Use COMPARING for deleting duplicate data in the internal tables
- Do not use index operations while populating sorted tables
- Do not resort a sorted type of an internal table
- Index operations cannot be used on hashed tables
- Do not use OCCURS 0 in the declaration unless less than 8K data is stored.
- Use CLEAR
to initialize the header record - Use REFRESH
to clear the contents of the internal table. This statement does not clear the header record - Use FREE
to free the resources used by the internal table
- Remove all code and variables that are not used in the program
- Perform the Extended Program Check
- Use selection criteria to effectively select and limit the number of database reads
- Select only those columns that are needed – Do not use a SELECT * unless necessary
- Use aggregate functions wherever required
- To update table entries, specify the columns
- Use a SELECT SINGLE if the primary keys are known, otherwise SELECT UPTO 1 ROWS
- Do not use nested SELECTs – Use views, joins or the FOR ALL ENTRIES option
- Do not use SELECTs in loops
- Restrict the database access by using the WHERE clause – do not use a CHECK
- Use indexes wherever available
- Avoid NOT in the WHERE condition
- Do not select the same data more than once
- To populate an internal table thru a SELECT, use the INTO addition
- Use sort on the internal table for small amounts of data and database ORDER BY for larger amount
No comments:
Post a Comment