Friday, 22 September 2023

How to Navigate Within ABAP CDS Source Code and Between ABAP CDS Objects?

In this blog, I will describe how to …

◉ navigate within ABAP CDS source code,
◉ come to another  CDS/Dictionary object
◉ navigate within the ABAP CDS object you currently work on

… using ABAP development tools for Eclipse (ADT) a.k.a. ABAP in Eclipse.

Note: When I talk about objects, I mean CDS objects such as data definitions and/or relating ABAP Dictionary objects such as database tables, classic views and so on.

Now, lay back and check out the following possibilities:

Relation Explorer


Do you already know the Relation Explorer? It helps you to understand how objects are related to each other. In the context of ABAP CDS, related objects can be, for example CDS extend views and CDS metadata extensions.

To open it, you can choose, for example, Show In > Relation Explorer from the context menu in the editor or from the relevant object in the Project Explorer.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

After execution, the Relation Explorer will be opened and displays the relating objects in a hierarchical way.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

From here, you can select the relevant object and choose the relevant function from the context menu.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

Results From the Where-Used List


The where-used search finds and visualizes the development objects that use a specific object in accordance to their dependencies.

To open it, you can choose, for example, Get Where-Used List from the context menu in the editor or from the relevant object in the Project Explorer. In addition, you can also use the Ctrl + Shift + G shortcut.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

From here you can navigate to the used object(s) by clicking it.

Using F3 in the Source Code


To navigate to an object, field, or element, click F3 on the relevant occurrence, for example the name of the datasource …

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

… or on the name of the field/element.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

Using Ctrl + Click


You can also use Ctrl + click for navigation.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

For example, select the relevant CDS annotation and keep Ctrl pressed. Click then the underlined segment of the annotation. In a new editor, the CDS annotation will be opened.

Outline View


The Outline view represents the structure of your object that is opened in the active editor. If you don’t know it; you can find the Outline on the left side under the Project Explorer or you can open it by choosing Window > Show View > Other… > Outline from the menu.

To navigate to the relevant field or element within your object, just click it in the tree. In the ABAP CDS source code, you can choose the supported ABAP CDS keywords, fields, or elements in order to skim through the outline.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

Dependency Analyzer


The Dependency Analyzer evaluates the relationships and complexity from a CDS entity with regards to its SQL definition.

To open it, choose Open With > Dependency Analyzer from the context menu in the editor or from the relevant object in the Project Explorer.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

SQL Dependency Tree


The SQL Dependency Tree displays SQL dependencies of a CDS view on other database objects.

To open the object, field or element in question, just double-click its name in the tree.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

SQL Dependency Graph


The SQL Dependency Graph visualizes SQL dependencies between ABAP Dictionary objects and CDS views.

To open the object, field or element in question, just double-click its name in the graph.

SAP ABAP Certification, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Prep, SAP ABAP Preparation

No comments:

Post a Comment