| Home • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us | ||
Document Categories:
What's New?
Contribute?Sample SpecsWhat's Hot? |
Visibility of Methods in Global ClassesBy Anil Bharadwaj, OpenText Technologies This is a very basic example in the OO
concepts in ABAP. In this example we deal with the visibility of classes and how
we can use them in our Custom Programs and how a constructor and Friend Function
work along with inheritance using Global Classes. Create Global Class in Transaction
code SE24.
Select the type as Class
Make the class as Public
We
have 2 Levels options and 3 types Visibilities while creating Methods Levels: 1. Instance
method: For these methods we have to create object i.e. Instance while using
the class in the program. We can have any number of Instances of a class in a
program. 2. Static
method: For these we no need to create an object i.e. Instance, directly we
can use the method with the class name. this does not support polymorphism and
has many functionalities which are not needed at this stage.
Visibilities: Public:
These methods are accessible trough out the program with instances and for
subclasses and friends. Private:
These Methods can be used only within the class where it is declared like the
other methods of the class and these methods cannot be used with object
reference from your Z Programs. Below is the screen of the code of the
public method which is using the private and protected methods of its own class.
Now I had created another class which
inherits the above class. You can see the super class name.
|
|
|
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us ©2006-2007 SAPTechnical.COM. All rights reserved. All
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG. Graphic Design by Round the Bend Wizards |
||