Inline Decleration (Değişken Tanımlama)

Note : If you want to use instant variable declaration in ABAP, you can do so using the new syntax supported in version 7.40 and above.


When declaring a global variable, we use the prefix "gv_" (global variable) to indicate its scope. On the other hand, when declaring a local variable using inline declaration, we use the prefix "lv_" (local variable). This is done to differentiate between global and local variables and to indicate their respective scopes. By using the prefix "gv_", it becomes clear that the variable is intended to have a global scope and can be accessed across different parts of the program or system. On the other hand, by using the prefix "lv_", it signifies that the variable is intended to have a local scope and is limited to the specific block or routine where it is declared. The prefixes "gv_" and "lv_" are naming conventions commonly followed in ABAP programming to enhance code readability and maintainability. They help developers quickly identify the scope of variables and understand how they can be accessed within the program. It's important to note that these prefixes are not enforced by the ABAP language itself but are recommended practices followed by developers to adhere to coding standards.



Yorumlar

Bu blogdaki popüler yayınlar

Transaction Code assignment for Query created in SQVI - SQVI Raporu Tcode Bağlanması