Show TOC

Creating Methods from Method CallsLocate this document in the navigation structure

Prerequisites

Your code must be free from syntax errors.

Context

In an ABAP class, you can generate the method definition from the method call in the implementation part.

Note You can also create the method definition if the method is used in an ABAP class other than the one you are now working in.

Procedure

  1. In the source code editor of the ABAP class where the method is implemented, position the cursor on a method call to create the definition in another ABAP class.
    Creating the method definition from the method call in another class
    Figure 1: Creating the method definition from the method call in another class
  2. Choose Quick Fix (Ctrl 1) from the context menu.
  3. In the Quick Fix dialog box, double-click Create method.
  4. In the dialog, you can change a suggested method name as well as the suggested name and attributes of a method parameter.
    Adding parameters that are to be declared in the signature of the method definition
    Figure 2: Adding parameters that are to be declared in the signature of the method definition
  5. In the dialog box, click Finish.

Results

The source code editor inserts the definition of the method in the public section of the existing ABAP class – here with IMPORTING and EXPORTING parameters – using the wizard, and it creates the empty method in the implementation.

Adding the method definition in the public section and creating the empty implementation part in another ABAP class
Figure 3: Adding the method definition in the public section and creating the empty implementation part in another ABAP class