Life Time of Data Object
Life Time of Data Object
Life Time of Data Object
Global data objects remain valid as long as the corresponding program is in the memory.
The lifetime of object attributes begins when the object is instantiated at runtime and ends
when the last reference to the object has been deleted.
The lifetime of a local data object is usually identical to the lifetime of the surrounding
modularization unit, which means the contents of the data object are lost between two calls of
the same modularization unit.
Hint: If you use the STATICS statement instead of DATA when you declare local data
objects, the system extends their lifetime to the overall program lifetime. Therefore, these
such data objects have the same lifetime as global data objects, but their visibility is still
limited to the respective modularization unit. You can use the STATICS statement in
function modules, subroutines, and static methods.