ABAP in Eclipse enhanced by Open Source Plugins
ABAP in Eclipse contains a lot of features which are not available in SE80. But for executing some of these features several clicks on menu entries are necessary or you have to remember and continuously click some shortcuts.
In the following blog I will give you an insight into three Open Source Plugins. These three plugins automate existing features of ABAP in Eclipse and also add some feature to Eclipse.
This blog is divided into seven independently usable features. Whether you see them as the seven deadly sins or the seven world wonders is up to you ;-).
In serious: As everybody is developing differently maybe only some of the presented features will be usable for you, but this should not be a problem as each feature can be switched on or off independently.
But enough of introduction, lets dive into the automation of ABAP in Eclipse.
- Coloring your ABAP projects
- Automatic Pretty Print of ABAP source code
- Automatic run of Quality tools: ATC and Unit tests
- Favourite transaction shortcuts inside ABAP in Eclipse
- Inline Code information
- Inline Debug information
- Calling abapGIT with a shortcut
1. Coloring your ABAP projects
The good old SAP GUI has one very helpful feature. You can color each of your projects or even different clients with a proper flavour. In the standard Eclipse installation the current project/client is indicated on the right bottom of the editor window as text, which could be easily overseen.
When the feature “Colored Projects” which is part of the ABAP Continous Integration Plugin is enabled a colored bottom bar visualizes the current project/client – in the example below red is for example chosen for the PRD environment. Additionally there are some other options like for example adding small squares to the icons of the different editor tabs.
In the screenshot an ABAP object (in this case the transaction SM04) is opened from the PRD environment. Each time when an object from the PRD environment is opened this is indicated by a red colored status bar.
Additionally there is a small colored square added to the tab icon. This should help you to see immediately to which environments the currently opened editors belong. In the sample above: one belongs to the DEV environment (no color), one to the NPL environment (blue color), one to the QAS environment (yellow color) and two to the PRD environment (red color).
2. Automatic Pretty Print of ABAP source code
ABAP in Eclipse already has a feature build in which gives you the possibility to format your ABAP objects, function modules or CDS views. This can be done by using the context menu or a shortcut.
The ABAP Continuous Integration Plugin enhances your ABAP in Eclipse environment by adding a feature which automatically formats your source code before each activation. This saves you some mouse clicks but more important you have not to remember to perform the pretty print operation each time you modify an ABAP development object.
In the Eclipse preferences you can choose if each development project should be formatted or only selected ones. And of course there is also the possibility to disable this feature entirely.
3. Automatic run of Quality tools: ATC and Unit tests
The core feature of the ABAP Continuous Integration Plugin is the automatic run of ATC checks and Unit tests. Whether you use Unit tests in your ABAP development or ATC checks or both of them – this feature should give you three advantages:
- It saves you time as you have not to click the necessary menu items or shortcuts on your own
- It gives you a fast summarized feedback about the current state of your source code
- You will not forget about ATC checks and Unit Tests anymore as they are executed automatically
A typical TDD cycle:
In the first step the Unit Test is modified. The failing test is indicated after the activation by the color red in the status bar.
In the next step the productive code is modified and activated. The color changes to blue.
After fixing the ATC errors, the color changes back to white again.
In the whole animation there was no other Eclipse command beside the three activations executed by the user.
4. Favorite transaction shortcuts inside ABAP in Eclipse
With the plugin ABAP Favorites, Łukasz Pęgiel brings on of the most useful features of the SAP GUI to ABAP in Eclipse. The favourite list. After installing this plugin you have the possibility to add in a dedicated view your favourite transactions but also your most used development objects.
As a result you can open them with one mouse click when needed.
In an additional view GUI transactions and also ABAP development objects can be maintained and opened with one mouse click. With one mouse click they are opened and available to use.
5. Inline Code information
Especially when an existing method in an ABAP class is modified there are always the same two questions:
- What are the method parameters of the method?
- How often the method si called from other source code parts
These answers gives a feature which is part of the ABAP Code Insight Plugin. The plugin adds inline code information above each class definition, each class method and each class attribute.
The reference count indicates how often the code element is called from another part in the code which should help to assess how big the risk is to modify a certain source code part. The second part which can be activated for method definitions and also for other ABAP development objects like function modules or CDS views is the information about the method parameters.
With this additions to the source it is not necessary anymore to scroll up to the method definition or press F2 to get the method signature information.
Above each ABAP source code element an information line is shown
that look like comments but is only displayed in ABAP in Eclipse and not stored with the source code in the backend system.
6. Inline Debug information
This is currently a feature in experimental mode. The feature itself already works but unfortunately it is still slow and freezes the Eclipse environment after approximately hundred debug steps.
The idea behind this feature is to get the current parameter values displayed next to the variables. The variable values are updated automatically when the debug step position changes.
Currently this feature is still in experimental state.
With each debugging step the information about the current source code values is displayed next to the variables. If the value of the variable changes it is updated automatically.
7. Calling abapGIT with a shortcut
abapGIT is the most famous project in the Open Source space regarding ABAP development. Started by Lars Hvam and also dedicated to systems which do not yet support ABAP in Eclipse it is currently based on a SAP GUI interface.
With some shortcuts its easily usable within ABAP in Eclipse. But reading through this blog you certainly have a clue what follows now:
A feature part of the ABAP Continuous Integration Plugin enhances ABAP in Eclipse and makes it possible to open abapGIT with one click and having already the right development package preselected.
As a side node: There is also an ongoing Open Source project with a native Git client https://github.com/abapGit/ADT_Frontend on GitHub.
With a click on the context menu in the project explorer or for example also by using the quick access the abapGit user interface is opened and the right package is preselected.
For each development a separate tab is opened. If an already opened package is called again you are redirected to the corresponding tab.
Hopefully this blog contains one or more features that adds some value to your ABAP development flow in ABAP in Eclipse.
More details about the features can be found on the following GitHub repositories or the Eclipse Marketplace entries.
|ABAP Continuous Integration||https://github.com/andau/abapCI||https://marketplace.eclipse.org/content/abap-continuous-integration|
|ABAP Code Insight||https://github.com/andau/abap-code-insight/||https://marketplace.eclipse.org/content/abap-code-insight|
Thanks for reading and I am curious on your feedback, suggestions and further ideas.