‎2008 Apr 02 8:25 PM
I've defined an internal table to my Class as a static attribute. I would like it to be filled once during runtime and it should stay populated because it is a static attribute....right?
Please confirm: I need to create a method "Constructor". Within this method, it should load the internal table. This will occur when I say "Create Object" in my code automatically?
Am I correct?
Thank-You.
‎2008 Apr 02 8:45 PM
Hello,
You need to create the CLASS_CONSTRUCTOR method to populate the static internal table. This method run in the first time you use the create object or when you call a static method. And this method run only once per class.
The CONSTRUCTOR method is called every time you create a new instance to the class using the command CREATE OBJECT.
So, the CLASS_CONSTRUCTOR run only once, instead the times that the class is instancied and the CONSTRUCTOR run one time per instance.
Regards,
‎2008 Apr 02 8:45 PM
Hello,
You need to create the CLASS_CONSTRUCTOR method to populate the static internal table. This method run in the first time you use the create object or when you call a static method. And this method run only once per class.
The CONSTRUCTOR method is called every time you create a new instance to the class using the command CREATE OBJECT.
So, the CLASS_CONSTRUCTOR run only once, instead the times that the class is instancied and the CONSTRUCTOR run one time per instance.
Regards,
‎2008 Apr 03 7:48 PM
Justa adding a bit more information about CLASS_CONSTRUCTOR :
They are executed once per program
They are first executed when : -Create an instance of the class or
-Acessing a static attribute of the class
-Calling a static methid of the class
-Register and event for this class