Entering content frame

Procedure documentationCreating Subclasses 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 can do this by adding new components to the subclass or redefining methods inherited from the superclass.

Procedure

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

  1. Select in the required class.
  2. Choose Edit ® Create subclass.
  3. The Create Class dialog box appears.

  4. Define the required basic data for the class:
  5. Enter the name of the subclass in the Class field and enter a short text as Description of the subclass.

    When you define the remaining basic data, proceed as described for Creating Classes.

  6. Choose This graphic is explained in the accompanying textSave.
  7. The Create Object Catalog Entry dialog box is displayed.

  8. Enter the Package.
  9. 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.

 

 

Leaving content frame