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

Significance - '?=' operator

Former Member
0 Likes
1,545

Hello People,

Can anyone tell me the significance of '?=' operator used in ABAP-OOPS.

Thanks in advance.

Abhishak

1 ACCEPTED SOLUTION

Hello People,

Can anyone tell me the significance of '?=' operator used in ABAP-OOPS.

Thanks in advance.

Abhishak

2 REPLIES 2
Read only

Former Member
0 Likes
1,501

hi,

Definition: The assignment of a subclass instance to a reference variable of the type "reference to super class" is described as a narrowing cast, because you are switching from a more detailed view to a one with less detail. It is also called as up-casting.

Use of narrowing casting:

A user who is not interested in the finer points of cars, trucks, and busses (but only, for example, in the fuel consumption and tank gauge) does not need to know about them. This user only wants and needs to work with (references to) the lcl_vehicle(super class) class. However, in order to allow the user to work with cars, busses, or trucks, you generally need a narrowing cast.

Principle of narrowing casting:

In narrowing casting the object which is created with reference to the sub class is assigned to the reference of type super class.

Using the super class reference it is possible to access the methods from the object which are only defined at the super class.

This access is also called as generic access as super class is normally called as general class.

"information retrieved from saptechnical"

regards,

orhan

Edited by: goktasor on Jun 1, 2010 1:10 PM

Edited by: goktasor on Jun 1, 2010 1:10 PM

Edited by: goktasor on Jun 1, 2010 1:11 PM