2010 Sep 18 4:51 PM
Dear All,
can anybody tell me what are global and local varilables in Function Module ? Where they defined ? Are Global varialble defined in function group ? Please , do needful regarding it .....l
2010 Sep 18 5:13 PM
Hi TVC6784,
all variables declared in TOP include of the function group are global, all others including interface parameters are local.
Exception: You can 'globalize' the function interface. SAP says this is obsolete but still it is possible and frequently used by SAP. If you do so, the interface parameters are global varianles in the function group, but, at run time only if the function with globalized parameters is called.
Regards,
Clemens
2010 Sep 18 6:08 PM
Hi Clemens Li ,
Thanks for your needful reply..... Can you just tell me that global variables defined in function group can be used by any function module which is exist in that particular function group ? And If i call any function module between Loop and Endloop than are their global variables values changed or their local variables ?
Edited by: TVC6784 on Sep 18, 2010 7:08 PM
2010 Sep 18 7:21 PM
Global variables in Functon Group (FG) are the same what STATIC variables are for program. When you call any FM from the FG, whole FG is loaded to the memory. This means that every change that goes to its global variable will reflect in all the function modules you call in your program. As long as the FG stays in the memory (till report is not finished) you can use these global variables accross all FMs of that FG. So every FM call while looping will see changed global variables.
In contrary, all variables of FM which you call are local ones, meaning after each new call they receive initial value.
Regards
Marcin
2010 Sep 18 8:20 PM
Moderator message - Please do not ask or answer basic/easily searchable questions - thread locked Rob