Skip to Content
1
Mar 26, 2015 at 10:07 AM

Lifespan of static variables

231 Views

Hello experts,

I'd like to have a static variable in a function module. This function module would be called several times remotely (RFC) from a different system. Will the static variable in my function module keep its value even when the function module will be called remotely?

Example:

* Piece of code on system X

" Two remote calls of function DUMMY on system Y

CALL FUNCTION 'DUMMY' DESTINATION SYSTEM_Y.

CALL FUNCTION 'DUMMY' DESTINATION SYSTEM_Y.

* Function DUMMY

FUNCTION DUMMY.

STATICS my_var TYPE i.

my_var = my_var + 1.

ENDFUNCTION.

Will my_var be 2 after two remote calls?