Show TOC

 Implementing MethodsLocate this document in the navigation structure

Prerequisites

The methods and attributes of the class or interface already exist. The parameters and exceptions required by the methods also exist. If you want to implement methods of interfaces, the interfaces should be listed in the class definition.

Procedure

In the form-based mode of the Class Builder:

  1. Open the class you want to edit.
  2. Choose Methods.
  3. Position the cursor on the name of the relevant method.
  4. Double-click, or choose the Source code pushbutton.

    The ABAP Editor appears with an empty statement block between the METHOD and ENDMETHOD statements.

    Tip

    It is useful to display the signature of the method here. To do so, choose Signature. To close the signature display, choose Signature again.

  5. Write the ABAP source code for the method.
    Note

    You can also create text elements in the source code using forward navigation.

  6. Check the syntax.
  7. Save your source code.
  8. Choose Back to return to the class editor.
  9. Document the new method. Choose the appropriate icon in the Methods display.

In the source code-based mode of the Class Builder:

  1. Open the class in the source code-based mode of the Class Builder.
  2. Make sure you are in Change or On-Demand Locking mode.
  3. Add method definitions in any of the sections of the class.
  4. Double-click the method name in the definition to generate the implementations.

    This automatically positions the cursor in the method implementation. From here, you can start coding the method.

  5. Save the method.