Entering content frameProcedure documentation Creating Persistent Classes Locate the document in its SAP Library structure

Persistent classes are created and managed in the Class Builder.

Prerequisites

Use of the prefix CL_ (or a corresponding naming convention in the customer namespace) is required for persistent classes since generation of the corresponding auxiliary classes assumes exactly this naming convention.

Procedure

To create a persistent class from the initial screen of the Object Navigator (SE80):

  1. Select the category Class/Interface in from the object list.
  2. Enter the name of the new class according to the naming conventions.
  3. Confirm your entries with ENTER.
  4. Confirm that you want to create the class.
  5. The system displays the Create Class ... dialog box.

  6. Enter the rest of the basic data for the class:
  7. Select Persistent class as the class type.

  8. Choose Save.
  9. The Create Object Catalog Entry dialog box is displayed.

  10. Enter the Package.
  11. Choose Save again.

The method display of the Class Builder appears.

This graphic is explained in the accompanying text

Result

You created a persistent class (called CL class below) and defined your basic data.
The new class implements all the methods of interface IF_OS_STATE. These service methods are common to all persistent classes and are used when the object status is manipulated. The application developer can only redefine the implementation of the two methods INIT and HANDLE_EXCEPTION. The other methods are reserved for internal use.
The Class Builder automatically creates two further auxiliary classes with the new persistent class CL class. They are assigned to a separate class pool. These classes are needed for managing persistent objects using Object Services.

See also:

Generated Classes

Class Diagram: Created Classes

Defining Persistence Mapping

 

 

Leaving content frame