2008 Jun 27 1:26 AM
Hello Experts.
I'm beginner of ABAP.
I think valiable declared on the top of program is global valiable
and those declared under subroutain are local valiable.
is it right?
And
If a valiable is declared under event line such as START-OF-SELECTION, AT SELECTION-SCREEN,
which group is this valiable?
2008 Jun 27 4:06 AM
>data decla with in subrotine are local variable only.
-
>data dec in top are global variable..
-
> data declared in events is also global
Hello Experts.
I'm beginner of ABAP.
I think valiable declared on the top of program is global valiable
and those declared under subroutain are local valiable.
is it right?
And
If a valiable is declared under event line such as START-OF-SELECTION, AT SELECTION-SCREEN,
which group is this valiable?
2008 Jun 27 4:06 AM
>data decla with in subrotine are local variable only.
-
>data dec in top are global variable..
-
> data declared in events is also global
2008 Jun 27 4:12 AM
Hi Kim,
It is also global. One of the best practise is to create an include. This will separate all the global variables that you declare. Its the common practise. 😃 Hope this will help you.
Rewards if useful.
Regards,
Mark
2008 Jun 27 4:47 AM
2008 Jun 27 5:00 AM
Hi Kim,
- A variable declared in subroutine is a local variable . it s value will not be accessible outside the subroutine.
-Whereas a variable declared anywhere in the main program is global can be accessed even with the subroutine.
example:
- if a variable say 'z_abc' is declared in main program (global variable) then it can be acessed in the subroutine too.
Regards,
Vasuki
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |