Show TOC

 Creating a Standard ClassLocate this document in the navigation structure

Use

You use this procedure to create standard ABAP classes in the Class Builder.

Prerequisites

The package in which the class is to be created must exist.

Procedure
  1. In the Repository Browser (transaction SE80), navigate to the package in which you want to create a class.
  2. In the context menu of the package, choose Create → Class Library → Class.

    The Create Class dialog box appears.

  3. In the Class Type group box, choose Usual ABAP Class.
  4. In the Class field, enter a name of the new class according to the naming conventions.
  5. In the Description field, enter a short description of the class.
  6. Enter the rest of the basic data for the class:
    Option Description

    Superclass

    • To create a subclass in the Class Builder, choose Superclass on the Properties tab page. Then enter any non-final, global class as a superclass in the Inherits from field. The Undo inheritance and Change inheritance options allow you to change the inheritance relationship.
    • To display the components in a subclass that were inherited from the superclass, choose the menu option Utilities → Settings, and then choose the Display Inherited Components Also option.

    Instantiation

    • Public is the default option. In that case, each user can create instances of the particular class (with CREATE OBJECT).
    • The Protected option defines that only inherited classes or the relevant class itself can create instances of this class.
    • If you choose Private, only the relevant class itself can create its instances (only using its own method).
    • You can define an abstract class with the Abstract option. You cannot create an instance for this class. An abstract class can be used as template for your subclasses. You can only access this class with your static attributes or with your subclasses.

    Final

    Specifies the development status of the object. Only objects and components with status final can have executable code. This class completes the inheritance hierarchy since a final class may not create any further subclasses.

    Only Modeled

    No entry is made in the class pool for this class. This class cannot be accessed at runtime.

  7. Choose Save.
  8. Enter the name of the package to which your class should belong.
  9. Choose Save.
Result

You have created a standard ABAP class in the specified package. The system creates a class pool for the new class and displays the complete source of the class in the mode chosen by the user. In a class pool you can have only one global class. In addition, you can create local definitions and implementations that can be used by the global class.

Note

For more information about ABAP classes, see the ABAP User Guide under Classes.