Local and Global Classes
Classes in ABAP Objects can be declared either globally or locally. You define global classes and interfaces in the Class Builder (Transaction SE24) in the ABAP Workbench. They are stored centrally in class pools in the class library in the Repository. All ABAP programs have access to these global classes.
Local classes are defined within an ABAP program. Local classes and interfaces can only be used in the program in which they are defined. When you use a class in an ABAP program, the system first searches for a local class with the specified name. If it does not find one, it then looks for a global class.
Global class are better suited for maintenance. Sometimes, your local classes need to be accessed from outside your component, report, ... and the question of conversion to global class arises.
For this, transaction SE24 provides the solution :
For this, transaction SE24 provides the solution :
Nevertheless, ABAP Unit classes have to be embedded within objects to perform their tasks. Let's say you want to have a template for ABAP Unit class, you may want to maintain it as a global class. Thus, at some point in the process you will want to convert your global class into a local class.
Here it is (thanks BSP package !) :
No comments:
Post a Comment