Show TOC

 Enhancing the Components of Global Classes or InterfacesLocate this document in the navigation structure


Use this procedure to implement enhancements ( pre , post , and overwrite methods) of global classes or interfaces. In the context of the enhancement concept, a global class or global interface provides implicit enhancement options .


To implement an enhancement of global classes or interfaces, use the Class Builder to call the Enhancement Builder.

  1. In the form-based mode of the Class Builder, choose Class → Enhance or Interface → Enhance for an existing class or an interface.

    A dialog box appears.

  2. Select an existing enhancement implementation or create a new one

    This takes you to the enhancement mode of the Class Builder in which the original components of the class or interface are displayed and cannot be changed.

  3. Create your enhancements following the steps below:
    1. Create the new attributes in the same way as when you create a class or interface.
    2. Insert new, optional formal parameters in the same way as when you create a method.
    3. Insert or delete pre- and/or post-methods:
      1. Select the desired method
      2. Choose Edit → Enhancement Operations → Enhancement Operations and then choose one of the menu entries:
      3. Insert Pre-Method, Insert Post-Methodor Insert Overwrite-Method
      4. Delete Pre-Method, Delete Post-Method or Delete Overwrite-Method.

        An overwrite-method cannot exist simultaneously with pre- or post-methods for the same method.

    4. Insert new methods in the same way as when you create a class or interface.
    5. Insert new interfaces.
    6. Insert new events.
    7. Insert new types
  4. Save and activate the class.

    You can further use the new components for implicit and explicit enhancement options in enhancements to the source code of the class. This can be done via ABAP Source Code Enhancements .

Additional Information

When pre / post / overwrite methods are created, a local class named lcl_<enhancement_name> is generated for the enhancement <enhancement_name> . This local class is attached to the end of the local class implementation section in the original class (as an implementation of the predefined enhancement option).

You can access the components of the original class within lcl_<enhancement_name> by the object reference CORE_OBJECT .

The local class lcl_<enhancement_name> can implement three interfaces:

  • IPR_<enhancement_name> for pre methods.
  • IPO_<enhancement_name> for post methods.
  • IOW_<enhancement_name> for overwrite methods.

The parameters of pre / post / overwrite methods are similar to the parameters of the original method but the following restrictions exist:

  • The pre method does not have export parameters.
  • The post method does not have export parameters; the export parameters become changing parameters.
  • The returning parameter of a functional method becomes a changing parameter
  • overwrite methods have the same signature as the original method.
  • The parameter definitions of pre / post / overwrite methods cannot be changed.