Show TOC

Automatic Code CompletionLocate this document in the navigation structure

Context

In the ABAP source code editor, the ABAP code completion list is automatically displayed after have typed a component selector. This enables you, to select the component of the related identifier like a field of a structure or a method of a class to add it to the source code.

The following component selectors are supported:

Component Selector Displayed Proposals
- Fields of structures
~ Components of interfaces
-> Instance components of object references
=> Static components of ABAP classes / interfaces

If one or more hits are found, all available components (for example methods or attributes of a class) are displayed.

ABAP code completion list and popup according to the component
Figure 1: ABAP code completion list and popup according to the component
Note Automatic code completion is activated in the preferences by default.

Open the preferences page Start of the navigation path Window Next navigation step Preferences Next navigation step ABAP Development Next navigation step Source Code Editor End of the navigation path to deactivate the Automatic code completion after typing -,~,->,=> option.

Note If the automatic code completion list is not displayed, check whether the related components are correctly defined in the related development object.

Procedure

  1. In the source code editor, type the component selector.
  2. In the automatic code completion list with the suggested entries, select the desired component.
  3. Choose one of the following possibilities:
    1. Enter for adding keywords/identifiers
    2. Shift + Enter for adding the name and parameters of a method or function module

Results

The selected component is added in the source code at your current position.

A call to the static method 'call_static_demo2' is inserted at your current position
Figure 2: A call to the static method 'call_static_demo2' is inserted at your current position

Open the preferences page Start of the navigation path Window Next navigation step Preferences Next navigation step ABAP Development Next navigation step Source Code Editor Next navigation step Templates End of the navigation path to create or edit templates.