The type of an object is known as its class. A class is an abstract representation of an object. Alternatively, it can be viewed as a set of instructions for building an object. The attributes of objects are defined by the components of the class, which describe the state and behavior of objects.
Global Classes and Local Classes
Global classes are coded in a special ABAP program, a class pool, whereas local classes can be coded in almost every ABAP program. Global classes are visible in all ABAP programs. How they are used depends on the package check. Local classes can be used statically only in their own program. Dynamic access is also possible from other programs, although this is not recommended. When a global class is first used, the class pool is loaded to the internal session of the consumer. The local classes of a class pool can be used by the global classes of the pool.
Except for the storage type and the visibility, there are hardly any conceptual differences between global and local classes. One of the few differences is that, in the public interface of a global class, only references to public types are possible. These types are subdivided into global and local friends.
In principle, it also does not make any difference whether a method of a local class or a global class is called. This is the reason why classes used by multiple programs should be created exclusively in the class library. The reuse of local classes should be avoided by using include programs.