Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how a statics variable different from global variable...

Former Member
0 Likes
676

explain the span of these two kind of varaiables in subroutines..with a simple example

Thanks guyz

1 REPLY 1
Read only

Former Member
0 Likes
481

Check the following syntaxes to declare a static variable.

1. STATICS f.

2. STATICS f(len).

3. STATICS: BEGIN OF rec,

...

END OF rec.

4. STATICS: BEGIN OF itab OCCURS n,

...

END OF itab.

Static validity means that, unlike normal local variables, the life of static variables does not depend on the defining procedure, but on the program at runtime. Static variables are thus not redefined on the stack each time the defining procedure is called, but exist independently of this in the program and keep their value, regardless of calls to the defining procedure.

Global Variable:

global variable is a variable that is accessible in every scope.