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

declaring variable

Former Member
0 Likes
526

How to declare a static variable in the report program...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
497

Hi Mahesh,

Its as simple as declaring normal variables. We will use STATICS instead of DATA Keyword.

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.

Thanks,

Vinay

2 REPLIES 2
Read only

Former Member
0 Likes
498

Hi Mahesh,

Its as simple as declaring normal variables. We will use STATICS instead of DATA Keyword.

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.

Thanks,

Vinay

Read only

Former Member
0 Likes
497

Hi,

STATICS: To declare variables with static validity in procedures

variables defined with STATICS are static attributes that are only visible in the corresponding method

Regards

Sudheer