Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to type casting in OOPS ABAP and ABAP ?

Answer Posted / rs agarwal

1. Narrow casting

2. Wide casting

Demo on "Narrow Casting" Parent class->M1 , Child class-
>M1,M2
Attributes of super class can only be accessed.
Methods defined at Super class(M1) can only be accessed.
Methods with REDEFINED Logic(M1) will be called
Methods in child class (M2) cannot be accessed
Demo on "Wide Casting" Parent class->M1 , Child class->M1,M2
Assign address of PARENT to CHILD Class object
Methods defined at child class(M2) can also be accessed
with Parent reference.
Methods with REDEFINED Logic (M1) will be called
The cast is only possible if the object was instantiated as
the child and then it was casted to the parent object and
then back again to the child object. The child has
everything the parent has so there is no problem with this
path.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you create an internal table dynamically?(at run time)

1853


What are the client dependant objects in abap / sap?

1012


What are the different software packets available in the market? : sap abap hr

1050


hi,how to diable the popup window which is displayed afetr executing the SAP script program?

2025


Explain different types of locks?

1001


Kindly help me to Know the process of mapping in EDI from R/3 to a convertor(third party which translates IDoc flatfile to EDIFACT /XML / FTP /HTTP ) ?

1965


What are the basic functions of database utility?

1108


what is sap scriptview ?

2190


What is tcode se16. For what is it used. Explain briefly?

991


What is the disadvantage of using exec sql statement in abap?

1026


Explain the difference between domain and data element? What are aggregate object?

1029


Specify the types of data dictionary objects.

945


What are smart forms?

1099


Why grouping of fields is required? What is the max no of modification groups for each field?

967


What are number ranges?

1003