Invisible Inheritance

Reading time:

1–2 minutes

In my daily development work, composition is used frequently. Inheritance, on the other hand, is something I use rather rarely. Rarely does not mean never, though.

Recently, I happened to notice that inherited components such as methods and variables are not visible in the Outline and Project Explorer views of the ABAP Development Tools for Eclipse. It’s as if the currently displayed class has no inheritance at all. Quite confusing.

You really have to look at the DEFINITION part of the class and pay attention to the INHERITING FROM statement to realize there is inheritance.

Alternatively, you can see the inherited components through the globally available variable ME using the access operator -> and the code completion feature. The entries in the code completion have yellow icons in front of them. Of course, this only works when you are editing the class.

A little research in the SAP Community led me to a post by another ABAP developer from 2016, who also missed the inherited components in the Outline view. Almost 10 years later, this feature still doesn’t exist. Most likely, it never will. Andrea Borgia made a very funny comment on this in the mentioned blog.

However, Thomas Fiedler from SAP gave the crucial hint in that SAP Community post about the keyboard shortcut CTRL+O, which opens the Quick Outline view within a class. Pressing CTRL+O again then shows the expected view with the inherited components.

Clunky, but well hidden. Fortunately, this function is needed rather rarely.