Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

definition deffered..?

Former Member
0 Likes
655

hi mates,

can anyone pls tell what is use of class definition defferred and class load.??

thanks,

Krish

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
626

[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

3 REPLIES 3
Read only

Former Member
0 Likes
626

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

Read only

Former Member
0 Likes
627

[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

Read only

Former Member
0 Likes
626

This message was moderated.