Code Completion/Pattern


Code Completion with Eclipse ADT:

Eclipse fully supports Code completion as well as provides ready to use Patterns as per Definition of ABAP artifacts. In some ways, I personally feel that Code completion feature is more robust and easy to use in Eclipse.

There is a dedicated Code completion setting in Eclipse which can be accessed by navigating to Manu > Window > Preferences > ABAP Development > Editors > Source Code Editors > Code completion/(CDS>Code Completion).

If you have been trying your hands on Eclipse, you may have noticed that there is no “Pattern” feature available here which was always present in classical ABAP workbench. To use Pattern like feature in Eclipse ADT, the developer needs to press Ctrl + space > select using Arrow buttons and Enter/Shift + Enter to copy the Pattern.

Code completion can be leveraged as below:

Pattern with Eclipse ADT:

Pattern help can also be used in a similar way. Let’s take an example to use a Pattern of a Function Module:

In this case, Ctrl + Space to be pressed after BAPI_ and before closing single colon. Help appears in a drop down. Using UP and DOWN arrow keys, the developer can navigate to proposed Function Modules.

During navigation, for each Function Module, Eclipse automatically shows the signature of each Function Module. After this stage, Developer has two options to utilize pattern:

  • Shift + Enter: This shortcut just brings Function Module name to the Editor
  • Ctrl + Enter: This brings the whole signature of Function Module to the Editor

Custom Templates with Eclipse ADT:

In addition to system Object patterns, Eclipse also offers to create and use user-defined patterns. User-defined patterns are particularly useful for creating Project level Program/Class/FM headers or Change logs/history. Patterns have a different name in Eclipse and they are known as Templates. They can be checked/changed or created via Menu > Window > Preferences as below. In this case, we are creating a Custom Program Header Template:

As you can notice from above diagram that Templates offer to insert runtime variables. They are easy to use and accelerate productivity as it encourages less keyboard typing.


Leave a Reply