cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

STATICS data declaration

Former Member
0 Likes
1,744

Hi all,

When we declare the data declaration using STATICS and DATA.

What are the advantages using STATICS. why we use when we are creating generic extractors using FM.

Please let me.

Thanks and Regards

Satish

View Entire Topic
Former Member
0 Likes

Hi Satish,

from SAP-Docu:

Example

The subroutine add_1 gets the same result for the variable local for each call as this is instanced again each time. The static variable static is already available and its value increased by one during each call.

DO 10 TIMES.

PERFORM add_one.

ENDDO.

FORM add_one.

DATA local TYPE i VALUE 10.

STATICS static TYPE i VALUE 10.

local = local + 1.

static = static + 1.

WRITE: / local, static.

ENDFORM.

/manfred