Any MAP statements defined between FUNCTION and ENDFUNCTION are considered local stack variables, which are allocated and initialized for each instance of the function.
You may also prefix MAP statements within the function definition with STATIC (e.g. STATIC MAP1 S'COUNT,F) to make the local variable persistent across instances of the function. Such a variable will only be initialized once, the first time the function is called.