‎2009 Apr 02 7:32 AM
hi mates,
can anyone pls tell what is use of class definition defferred and class load.??
thanks,
Krish
‎2009 Apr 02 7:53 AM
[Class Defered|http://help.sap.com/abapdocu/en/ABAPCLASS_DEFERRED.htm]
Class Load is used to load the class from Global library into the program .
Also check for f1 help.
Regards,
Gurpreet
‎2009 Apr 02 7:46 AM
Hi,
one can refer to a class without defining the class before that point. But, the class has to be defined later on.
Program description: In this program , class C1 has an interface reference O2 declared with reference to class C2. But, before that, class C2 is not defined. It is defined later with a single public attribute , NUM .
This demonstrates the theme.
In the main section of the program, object : OBJ1 is created from class C1.
Then, an object is created from the reference variable O2 in class C1. Finally, the attribute num of that object is displayed.
Example:
Dump report ysubdel1.
CLASS C2 DEFINITION DEFERRED.
CLASS C1 DEFINITION.
PUBLIC SECTION.
DATA O2 TYPE REF TO C2.
ENDCLASS.
CLASS C2 DEFINITION.
public section.
data : num type i value 5.
ENDCLASS.
start-of-selection.
data : obj1 type ref to C1.
CREATE OBJECT obj1.
create object obj1->o2.
write:/5 obj1->o2->num .
Output 5
Thanks,
Anitha
‎2009 Apr 02 7:53 AM
[Class Defered|http://help.sap.com/abapdocu/en/ABAPCLASS_DEFERRED.htm]
Class Load is used to load the class from Global library into the program .
Also check for f1 help.
Regards,
Gurpreet
‎2009 Apr 02 9:39 AM