‎2009 Jun 17 8:43 AM
Hello all
I have read about this on the help.sap.com site, I still do not understand it completely, can some one explain me with a simple example please ? (Not the increment counter example please !).
Thanks a ton.
Rgds
Sameer
‎2009 Jun 17 11:59 AM
Hello Sameer
When you call a module of a function group for the first time in your program then the entire function group is loaded. However, this can happen only once within your report and all global variables within the function group will have the same values all the time (except they are manipulated via fm's).
In contrast, you can create as many instances of the same class as you want and all of them can have different global attributes. And all these instances are independent of each other.
On the other hand, if fm_A changes global attributes of the function group and fm_B reads these attributes then fm_B read the changed values.
Or in other words:
Function Group = can be instantiated only ONCE
Class = can be instantiated unlimitedRegards
Uwe
‎2009 Jun 17 2:20 PM
In Classes, you could be having two different types of the Methods: Static and Instance. For the Instance method you MUST instantiate the object. Once you instantiate the object you can get access of attributes and methods as per their visibility. To access the Static methods, you don't have to instantiate the object.
You may consider: Function Modules in the Function groups may act as same as the Static Methods of the Class.
Regards,
Naimesh Patel
‎2009 Jun 22 8:01 AM
‎2009 Jun 23 7:52 AM