06-24-2008 8:33 AM
Hi,
when to use local class and when to use a global class ? In other words: what are the reasons to switch to global class ?
thanks,
Rolf
06-24-2008 8:40 AM
06-24-2008 8:35 AM
06-24-2008 8:40 AM
06-24-2008 12:02 PM
Hi Rolf Schorpion ,
There is clear distinction between global and local classes.
Local class
Local classes can be used in the program where it is defined.
Its scope is limited to the program where it is defined.This can be created in any program where you want.
Global class
Global classes are created by using SE24. These classes can be used in any program.you provides all the required attributes,methods,events,exceptions,friend classes.
You can use it in any program.
If it useful, reward points.
By
Prasad G.V.K
06-24-2008 1:57 PM
Hi,
The classes are divided into local and global based on their reusability.
If we want to use the same classs (in specifc the same structure) in more than one program,
we need to define this SE24 as GLOBAL class. here the scope of the class is more. the same structure can be reused many times across programs. In specific, if we want to design a class with a fucntionality that is used in all other classes or programs then we can define it as global class.
Local class - the life of this is specifi to that program only. The class is said tobe local if it is defiend or declared in SE38 program (report or include). This class of one report cant be used in other class. If we want to use it we need to again declare the same class in other program also.
this local classes are designed to meet only specific functionality ie to acheive the specifc task pertaining to that program only. It is not generalised.
Depending on the business logic we can desgin these classes accordingly.
Reward points if helpful.
Regards
Chandralekha.