Show TOC

Creating ABAP Classes or ABAP Interfaces from UsageLocate this document in the navigation structure

Prerequisites

In order to make this option available in the Quick Fix dialog, note the following prerequisites:

  • The definition statement must be completed.
  • No class or interface with the given name must exist in the ABAP system.

Context

In the source code of an ABAP program, you can create a local and global ABAP class / interface directly from the name of the missing class or interface.

ABAP Classes

ABAP classes can be generated from the following statements:

  • Definition statements, where the type ref to addition is used to specify a variable, constant type, or method parameter
  • Catch statements
  • Raise exception statements
  • Class definition statements within the inheriting from addition
  • Create object statements with a type addition

Example

Example of an ABAP class that contains references to missing classes
Figure 1: Example of an ABAP class that contains references to missing classes
ABAP Interfaces

ABAP interfaces can be generated from the following statements:

  • Definition statements, where the type ref to addition is used to specify a variable, constant type, or method parameter
  • Interface implementation statements in the public section of a class

Example

Example of an ABAP class that contains references to missing interfaces
Figure 2: Example of an ABAP class that contains references to missing interfaces

Procedure

  1. In the source code editor, position the cursor on the corresponding class or interface name for which you want to create a class or interface.
  2. In the context menu, choose Quick Fix or use the shortcut (Ctrl 1).
  3. In the Quick Fix dialog box, double-click the required entry.
    Note

    The entries are displayed in reference to the element that you have selected.

    The following entries are provided:

    • Create global class
    • Create global interface

Results

If you create a global class or interface, the corresponding creation wizard is opened. Here you define further creation details.