Global variable in ABAP function group

Function group is loaded into runtime memory by the FIRST call of a function module inside this function group.
See example below:
I have a global variable defined in function group in X3C/504:

clipboard1

Before I call any of the function module in this function group, this global variable is not available - this make senses because the whole function group is NOT loaded into memory.

clipboard2

When the first function module is called, the function group is loaded into memory - global variable available:

clipboard3

I insert one entry to this table:

clipboard4

Now function1 execution is finished, when I entry function module2, this global variable is still available, because the lifetime scope of function group is application level - which means it will always stay in the memory until the application terminates.

clipboard5

Summarized into one sentence: local variables defined in the function module, the scope is the function module scope, namely module executing the variable on the failure, but is defined in the function group-level global variables is the entire application life cycle, that does not close before the application, It has been effective.

For more Jerry's original article, please pay attention to the public number "Wang Zixi":
No public Screenshot

Guess you like

Origin www.cnblogs.com/sap-jerry/p/12056412.html