Static variables are variables that are active throughout the block in which they are declared i.e. its lifetime extends from the point of declaration in the block to the end of that block.
With local variables (described above) the declaration begins with ‘DATA’, for static variables within a class the declaration has ‘CLASS-DATA’ instead.
Along with ‘CLASS-DATA’ statement, ‘PARAMETERS’ are used to declare linked data objects and ‘SELECT-OPTIONS’ to include selection screens and their internal tables
Static variables are usually declared within subroutines or function modules.
There are a few rules to follow when naming a variable. Those rules are as follows –
1. Do not use any ABAP keyword as a variable name
2. Do not use special characters in variable name except underscore ‘_’ used to separate words for easier understanding
3. Don’t try to change names of predefined structures, objects and data
4. Variable name must be lucid and it should easily convey the use without explanation
5. Avoid using hyphens ‘-’ in variable names as they are used in structures
Serkan AKKAVAK
Computer Engineer BSc
SAP Department Manager
Contact : serkurumsal@yandex.com
0 Comments