Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

ABAP Programming Best Practices: Part-III

$
0
0

ABAP Programming Best Practices: Stability

 

Contents

Introduction

Stability Rules


1.     Introduction

 

 

               This document is a continuation of 'ABAP Programming Best Practices' which is intended to cover the basic Stability rules of good ABAP programming for ABAP developers and ABAP learners. In a normal SAP environment we use ABAP to write a code for doing a look-up in transformation or to code function modules to extract data from source systems. This process would generally involve declarations, selection of data, read the selected data to manipulate it or to perform calculations. I have taken into consideration only these basic steps for this document.

 

2.     Stability Rules


          Rule 1(Important): It is always recommended to include proper error handling to avoid abnormal terminations by the means of checking SY-SUBRC value after every statement that changes it and if you are not doing anything then just explain why not with a proper commenting.


          Rule 2: It is good to validate all the fields on the selection screen. If no condition is specified then validate them according to the forigen key definations persent in the DDIC.


          Rule 3(Important): It is always recommended to sort the standard table(If used) before using BINARY SEARCH with that table.


          Rule 4: It is good practice not to include TIMESTAMP field with COLLECT Statement.


          Rule 5: Always ensure that the DELETE ADJACENT DUPLICATES is applied to sorted internal tables.


          Rule 6: Never try to use CLIENT SPECIFIED addition to read or update data from another client within the system until and unless it is very necessary.


          Rule 7: It is always recommended to read the time dependent data with appropriate time restrictions.


          Rule 8: It is always good to use DEQUEUE ALL to remove system lock when the SYSTEM_FAILURE (SF) exception is raised from the ENQUEUE FM.


           Rule 9: It is always recommended to have correct defination of reference table and reference field for the currency and amount fields in order to display correct ouptut.


          Rule 10: It is always recommended to create a text table for the language specific elements present in the table, and the proper link between the element and the text table has to be maintained.




Note: I will keep updating this document based on further corrections/suggestions.


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>