ABAPCLASS_DEFERRED - CLASS DEFERRED
General Material Data General Data in Customer MasterThis documentation is copyright by SAP AG.
CLASS - DEFERRED
Syntax
CLASS class DEFINITION DEFERRED [PUBLIC].
Effect
This variant of the statement CLASS is used to make the class class known, regardlessof the location of the actual definition of the class in the program. It does not introduce a declaration part and must not be ended using ENDCLASS.
- Without the PUBLIC addition, the statement makes the local class of its actual definition knownbefore its actual definition. The program must contain a declaration part for class at a laterpoint. You cannot access individual components of the class before it is actually defined. You need this statement if you want to make reference to a local class before it is defined.
- Using the PUBLIC addition, this variant makes a global class known and defers loading the classuntil the end of the current program unit. You can only access individual components of the class afterit has been loaded. This statement can be used to prevent unwanted recursions when making references to global classes.
Note
This variant of the statement CLASS can also only be listed in the context described under CLASS.
Example
In this example, the class c1 uses the class c2 and vice versa. This means that one of the classes must be made known before it is actually defined.
CLASS c1 DEFINITION DEFERRED.
CLASS c2 DEFINITION.
PUBLIC SECTION.
DATA c1ref TYPE REF TO c1.
ENDCLASS.
CLASS c1 DEFINITION.
PUBLIC SECTION.
DATA c2ref TYPE REF TO c2.
ENDCLASS.
An example of using the DEFERRED PUBLIC addition would be a type group in which a reference typeis declared with a reference to a global class, which itself contains components with references tothis reference type. In this situation, the entire class cannot be loaded before the type group, sincethe types are not yet known. However, after the statement DEFERRED PUBLIC statement, the class name can be specified after REF TO without the class having been loaded previously.
ROGBILLS - Synchronize billing plans TXBHW - Original Tax Base Amount in Local Currency
This documentation is copyright by SAP AG.
Length: 2662 Date: 20120518 Time: 204444 triton ( 143 ms )






