Show TOC Start of Content Area

Procedure documentationCreating a Subclass  Locate the document in its SAP Library structure

Use

Inheritance allows you to derive classes from other classes. The new class contains a greater range of more specific functions than its superclass. You achieve this by adding new components to the subclass or redefining methods inherited from the superclass.

Prerequisites

The superclass already exists.

Procedure

To create a new direct subclass from an existing non-final class in the Class Builder:

...

       1.      Proceed as follows:

      To create a subclass in the form-based mode of the Class Builder:

                            a.      Select the required class.

                            b.      Choose Edit ® Create subclass.

                            c.      Enter the required data.

      To create a subclass in the source code-based mode of the Class Builder, go to the class definition statement in the editor and add the addition inheriting from <super class name>.

       2.      Choose Save.

The Create Object Catalog Entry dialog box appears.

       3.      Enter the Package.

       4.      Choose Save.

Result

You have created a direct subclass for a class. The subclass inherits all the components of the superclass with visibility areas PUBLIC and PROTECTED, with the exception of the Constructor methods. The interfaces implemented in the superclass are also implemented and visible in the subclass.

See also:

Extending Subclasses.

 

 

End of Content Area