Вы находитесь на странице: 1из 40

Frequently Asked Questions

ABAP CORE DATA SERVICES TOOLING FAQs

Document Version: 1.0


Release Date: June 2016
Target Release: SAP NetWeaver 7.5

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

Table of Contents
CREATING CDS OBJECTS

HOW CAN I DUPLICATE / COPY CDS OBJECTS?


MY CDS ENTITY IS EMPTY AFTER CREATION. WHAT NOW?
CAN I CREATE MY OWN CODE (CREATION) TEMPLATES?
IS THERE AN EASY WAY TO CREATE A PROJECTION VIEW?

3
4
5
6

EDITING CDS OBJECTS

HOW CAN I USE FOREIGN KEYS ALREADY DEFINED IN THE ABAP DDIC IN MY JOIN CONDITIONS AND ASSOCIATION DEFINITIONS?
7
IS THERE AN EASY WAY TO CREATE THE IMPLEMENTING METHOD OF MY CDS TABLE FUNCTIONS?
8
HOW CAN I INSERT COMMENTS IN MY CDS ENTITIES?
9
HOW CAN I NAVIGATE TO THE TARGET ENTITY OF AN ASSOCIATION?
10
HOW TO USE CODE COMPLETION TO INSERT THE SIGNATURE OF A CDS VIEW WITH PARAMETERS, CDS TABLE FUNCTIONS OR BUILT-IN SQL
FUNCTIONS?
11
HOW CAN I HIDE THE ANNOTATIONS/COMMENTS IN MY DATA DEFINITION SO THAT I CAN BETTER SEE THE DEFINED FIELDS?
12
FORMATTING CDS SOURCES

13

WHY IS THE CASING OF KEYWORDS AND IDENTIFIERS MODIFIED WHEN I SAVE MY DATA DEFINITION?
WHERE CAN I CAN CHANGE THE TEXT SIZE AND COLOR IN MY CDS EDITORS?

13
14

ANALYZING CDS OBJECTS

15

HOW CAN I GET A BETTER OVERVIEW OF ALL THE FIELDS AND ASSOCIATIONS PROVIDED BY MY DATA DEFINITION?
WHERE CAN I SEE DETAILS (TYPE, ELEMENTS, LABELS AND DESCRIPTIONS) OF THE DATA SOURCES AND ELEMENTS USED?
HOW CAN I EASILY SEE THE DATABASE TABLES AND VIEWS WHICH MY DATA DEFINITION USES?
WHERE CAN I SEE THE SQL CREATE STATEMENT WHICH IS GENERATED FOR MY DATA DEFINITION?
HOW CAN I SHARE MY CDS ENTITIES WITH MY COLLEAGUES?
CAN I PERFORM WHERE-USED FOR MY DATA DEFINITION / ACCESS CONTROL?
I ONLY HAVE THE SQL VIEW NAME. HOW CAN I FIND THE CORRESPONDING DATA DEFINITION?
HOW CAN I SEARCH FOR A TEXT IN MY DATA DEFINITIONS?

15
17
18
20
21
23
24
25

ERROR HANDLING

26

MY DATA DEFINITION FAILED TO ACTIVATE. WHERE IS THE ACTIVATION LOG?


WHERE CAN I SEE THE DETAILS ABOUT THE PROBLEMS REPORTED IN THE PROBLEMS VIEW?
ARE THERE QUICK FIXES FOR THE PROBLEMS REPORTED IN THE PROBLEMS VIEW?
CAN I DEBUG THE SELECT STATEMENT IN MY DATA DEFINITION?
HOW CAN I SEE WHICH ANNOTATIONS ARE ACTIVE FOR MY DATA DEFINITION, INCLUDING THE PROPAGATED ANNOTATIONS?
HOW CAN I TEST MY DATA DEFINITION?
HOW CAN I SEE THE PREVIOUS VERSIONS OF MY CDS ENTITY OR COMPARE THEM WITH THE ACTIVE VERSION IN ANOTHER SYSTEM?
HOW DO I CHANGE THE PACKAGE ASSIGNMENT OF MY CDS ENTITY?
CAN I RENAME MY ENTITY / SQL VIEW AFTER IT HAS BEEN TRANSPORTED?

26
28
29
30
31
32
33
35
36

HELP

37

WHERE CAN I FIND DETAILED INFORMATION ABOUT THE CDS TOOLING IN ADT?
WHERE DO I GET MORE INFORMATION ABOUT THE CDS LANGUAGE?
IS THERE A LIST OF ALL THE KEYBOARD SHORTCUTS I CAN USE IN MY CDS EDITORS?

37
38
39

DISCLAIMER

40

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

Creating CDS objects


How can I duplicate / copy CDS objects?
You can duplicate a CDS Object (Data Definitions / Access Control Definitions by selecting
the object in the Project Explorer and choosing "Duplicate ..." and specifying a "Package"
and a new "Name".

After duplicating the object, you can use the TAB-key to navigate to the positions in the
source code which must be modified, e.g. the entity name.

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

My CDS entity is empty after creation. What now?


You can use the content assist (CTRL+SPACE) to select a creation template and insert
template code for your Data Definition / Access Control. Several templates are delivered
with ADT, depending on the type of object you are creating.

You can also choose a creation template in the creation wizard after you have selected a
Transport Request (click "Next >"). If you select the "Use the selected template" checkbox
in the Templates page, then the chosen template will automatically be inserted every time
you call the wizard to create a new object.

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

Can I create my own code (creation) templates?


You can create your own code templates for Data Definitions in the
"Window" > "Preferences..." > "ABAP Development" > "Editors" > "Source Code Editors" >
"Data Definition Templates".
You can then use these templates via the content assist (CTRL+SPACE) in the DDL editor.
If you select the context "Data Definition (creation)" when you create your template, then
you can also use this template in the creation wizard when you create a new Data
Definition, respectively.
You can share a template with your colleagues by exporting and importing the template
definition.

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

Is there an easy way to create a projection view?


Projection views are used to hide fields of an underlying data source. You can easily create
a projection view using the standard code template "defineView" either in the creation
wizard of your Data Definition or via the content assist (CTRL+SPACE) in the DDL editor.
After the template has been inserted, use the content assist again in the SELECT list to
insert the required fields.
Alternatively, you can use the content assist "Insert all elements" to insert all the fields of
the underlying data source and then simply delete the fields from the SELECT list which you
wish to hide.

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

Editing CDS objects


How can I use foreign keys already defined in the ABAP DDIC in my join conditions
and association definitions?
If you have defined foreign keys for your database tables in the ABAP Data Dictionary, you
can use them to define the conditions of your joins and associations in your Data Definition.
Place the cursor on the ON keyword of your condition and trigger the quick assist with the
keyboard shortcut CTRL+1. Select "Define ON conditions". In the On Conditions wizard,
select the strategy "By Foreign Key" and then choose the foreign key definition you'd like to
use in the "Variant" drop-down box. The corresponding fields in the source and target data
sources will be mapped according to the chosen foreign key definition.

The condition will be inserted into your Data Definition when you click "Finish".

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

Is there an easy way to create the implementing method of my CDS Table


Functions?
You can use the quick assist "Create method ..." to create the implementing method of your
CDS Table Function. Place the cursor on the method name in your Data Definition and
trigger the quick assist with the keyboard shortcut CTRL+1. Choose "Create method ...".
Note that the ABAP AMDP-class must already exist before you trigger the quick assist.
The new AMDP-method will be added to the specified class.

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I insert comments in my CDS entities?


Text that appears after a double forward slash (//) or between a forward slash and an
asterisk (/*...*/) is interpreted as a comment and highlighted accordingly in the CDS editors.
The double slash can be used for end-of-line comments or for complete-line comments.
The forward slash and an asterisk allows you to insert comment text that extends over
multiple lines.
In the CDS editors you can insert a complete-line comment by positioning the cursor in the
line or selecting several lines and using the "Toggle Comment" keyboard shortcut CTRL+7.

The Best-Run Businesses Run SAP

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I navigate to the target entity of an association?


You can navigate to the target entity of an association used in your Data Definition by
placing the cursor on the association name and pressing CTRL.
Select "Navigate To Target".
You can navigate to the origin of the association by selecting "Navigate To" or simply
placing the cursor on the association name and pressing F3.

The Best-Run Businesses Run SAP

10

CORE DATA SERVICES ABAP - TOOLING FAQ

How to use code completion to insert the signature of a CDS View with
parameters, CDS Table Functions or built-in SQL functions?
You can insert the signature of a CDS View with parameters, a CDS Table Function and/or
built-in SQL functions which you use in your Data Definition by using the content assist
(CTRL+SPACE), selecting the object you wish to insert and inserting it with the keyboard
shortcut SHIFT+ENTER.

After insertion you can use the TAB-key to navigate to the placeholders which need to be
modified.

The Best-Run Businesses Run SAP

11

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I hide the annotations/comments in my Data Definition so that I can


better see the defined fields?
You can use code folding in the CDS editors to collapse and expand blocks of annotations
and comments. Check that folding is enabled by right-clicking on the vertical ruler on the
left hand side of the editor and selecting "Folding" > "Enable Folding".

Alternatively, you can also hide the comments and/or annotations by choosing "Hide
Comments" or "Hide Annotations" in the vertical ruler of the editor.

The Best-Run Businesses Run SAP

12

CORE DATA SERVICES ABAP - TOOLING FAQ

Formatting CDS sources


Why is the casing of keywords and identifiers modified when I save my Data
Definition?
Identifiers in ABAP CDS are not case-sensitive. Nonetheless, to ensure consistency across
ABAP Data Definitions, the keywords and identifiers are automatically formatted on save.
The identifiers are formatted to match the way the corresponding entity or element was
defined. Preserving the case of the identifiers increases readability and potentially
increases the interoperability of ABAP and HANA CDS.
It is not possible to deactivate this formatting. If you wish to change the formatting of an
entity or element name, you can define an alias.

The Best-Run Businesses Run SAP

13

CORE DATA SERVICES ABAP - TOOLING FAQ

Where can I can change the text size and color in my CDS editors?
You can change the settings of your CDS editors in "Window" > "Preferences..." > "ABAP
Development" > "Editors" > "Source Code Editors". Select "Colors and Fonts" to navigate to
the general color and font preferences.

Edit the "Text Font" in the "Basic" folder to change the text size and color in your CDS
editor. Edit the settings in the "CDS" folder to change the highlighting of your CDS
keywords, annotations, identifiers, etc.

You can also modify the settings in "Window" > "Preferences..." > "General" >
"Appearance" > "Editors" > "Text Editors" > "Accessibility" to change the appearance of
your IDE.
The Best-Run Businesses Run SAP

14

CORE DATA SERVICES ABAP - TOOLING FAQ

Analyzing CDS objects


How can I get a better overview of all the fields and associations provided by my
Data Definition?
Use Element Info to get an overview of the fields and associations provided by your Data
Definition. Position the cursor on the name of your CDS object in your Data Definition and
press F2.

The Outline View also provides a good overview of the structure of your Data Definition.
Annotated elements are decorated with the @ symbol. If the view is not visible in your IDE,
open the Outline View via the menu entry "Window" > "Show View" > "Outline".

Topic continued ->

The Best-Run Businesses Run SAP

15

CORE DATA SERVICES ABAP - TOOLING FAQ

Finally, you can hide the comments and annotations in your Data Definition to focus on the
implementation details of your elements. Enable "Hide Comments" or "Hide Annotations"
via the context menu in the vertical ruler of the editor.

The Best-Run Businesses Run SAP

16

CORE DATA SERVICES ABAP - TOOLING FAQ

Where can I see details (type, elements, labels and descriptions) of the data
sources and elements used?
Use Element Info or navigate to the data sources and element types used in your Data
Definition to see more details. Position the cursor on the name of the data source or
element in your Data Definition and press F2 (Element Info) or F3 (Navigate To). Within the
Element Info you can access further details by clicking on a hyperlink.

You can open the Element Info in the Element Info View by clicking on the @ button "Show
in ABAP Element Info View". The Element Info View will be automatically updated
whenever you click on an identifier.

The Best-Run Businesses Run SAP

17

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I easily see the database tables and views which my Data Definition uses?
Under the "from" node of the "select" statement in the Outline View (menu "Window" >
"Show View" > "Outline") you will see the data sources which are listed in the FROM clause
of your Data Definition.
This, however, does not include the data sources which are used in path expressions when
you access elements of other entities via associations.
The SQL CREATE statement which is generated for your entity displays the SQL names of all
the data sources used in your Data Definition (including the data sources used in path
expressions) in the FROM clause. You can display the statement via the context menu of
the Data Definition source > "Show SQL CREATE Statement".

You can see the transitive dependencies of your Data Definition in the Dependency
Analyzer (context menu > "Open With" > "Dependency Analyzer"). The SQL Dependency
Tree and SQL Dependency Graph show the relationship between all the data sources used
both directly and indirectly in your Data Definition. This is relevant, i.a. for the performance
of your entity. Other performance relevant metrics of your Data Definition can be found in
the Complexity Metrics tab of the Dependency Analyzer.

Topic continued ->

The Best-Run Businesses Run SAP

18

CORE DATA SERVICES ABAP - TOOLING FAQ

The Best-Run Businesses Run SAP

19

CORE DATA SERVICES ABAP - TOOLING FAQ

Where can I see the SQL CREATE statement which is generated for my Data
Definition?
You can display the SQL CREATE statement generated for your Data Definition via the
context menu entry "Show SQL CREATE Statement" of the Data Definition source.

The Best-Run Businesses Run SAP

20

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I share my CDS entities with my colleagues?


The "Share Link" functionality is also available for Data Definitions and Access. Select "Share
Link..." in the context menu of your object in the Project Explorer.

You can email a link to your object directly to your colleagues ("Email link") or copy the link
to the clipboard.

Topic continued ->

The Best-Run Businesses Run SAP

21

CORE DATA SERVICES ABAP - TOOLING FAQ


If you choose a "HTTP Link", your colleagues can open your CDS object in a web browser
and view it without installing ADT, provided they have access to the ABAP system.

If you send an "ADT Link", your colleagues can easily open the CDS object in ADT via the
menu entry "Navigate" > "Open ADT Link...".

The Best-Run Businesses Run SAP

22

CORE DATA SERVICES ABAP - TOOLING FAQ

Can I perform Where-used for my Data Definition / Access Control?


You can perform Where-used for your CDS object by selecting the object in the Project
Explorer and choosing "Get Where-used List..." in the context menu.

The results are displayed in the Search View. You can filter the results using the Filter Dialog
of the Search View.

Where-used is performed separately for your CDS entity (R3TR/STOB) and


the generated SQL View (R3TR/VIEW). To find all usages of your Data
Definition, you should always perform Where-used twice: Once for the entity
and again for the generated SQL view.

The Best-Run Businesses Run SAP

23

CORE DATA SERVICES ABAP - TOOLING FAQ

I only have the SQL View name. How can I find the corresponding Data Definition?
If you know the SQL View name of your CDS View, you can navigate to the Data Definition
by opening the SQL View in ADT (CTRL+SHIFT+A) and double-clicking on the "DDL Source"
name in the virtually integrated SE11.

Alternatively, you can select the SQL View in the Project Explorer and navigate to the Data
Definition via the context menu entry "Open with" > "Definition".

The Best-Run Businesses Run SAP

24

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I search for a text in my Data Definitions?


If you are running SAP HANA and your system administrator has activated the business
function SRIS_SOURCE_SEARCH in the Switch Framework (transaction SFW5), you can
search the sources of your Data Definitions via the menu entry "Search" > "Search..." >
"ABAP Source Search".

The Best-Run Businesses Run SAP

25

CORE DATA SERVICES ABAP - TOOLING FAQ

Error handling
My Data Definition failed to activate. Where is the Activation Log?
You can open the Activation Log of your Data Definition via the menu "Navigate" > "Open
Activation Log". Alternatively, you can open the log directly in the editor via the context
menu "Open with" > "Activation Log".

You can open another log within the Activation Log by pressing the CTRL key and clicking on
the hyperlink.

Topic continued ->

The Best-Run Businesses Run SAP

26

CORE DATA SERVICES ABAP - TOOLING FAQ


In addition to the Activation Log, you can also open the Activation Graph.

The Best-Run Businesses Run SAP

27

CORE DATA SERVICES ABAP - TOOLING FAQ

Where can I see the details about the problems reported in the Problems View?
You can view the descriptions of problems in the Problems View by selecting a problem and
choosing the context menu entry "Problem Description". The description will be displayed
in the ABAP Problem Description View. Prerequisite is, that a description has been
maintained for the problem.

The Best-Run Businesses Run SAP

28

CORE DATA SERVICES ABAP - TOOLING FAQ

Are there Quick Fixes for the problems reported in the Problems View?
Typically, if a quick fix exists for a problem reported in the Problems View, then the error
marker is decorated with a light bulb. In such cases you can trigger the quick fix by selecting
the problem and choosing "Quick Fix" in the context menu.

Alternatively, you can press CTRL+1 on the highlighted problem in the editor.

The Best-Run Businesses Run SAP

29

CORE DATA SERVICES ABAP - TOOLING FAQ

Can I debug the SELECT statement in my Data Definition?


No. The SQL statements are executed in the SQL engine of the underlying database. There
is no functionality in ADT to analyze the SQL execution (plan).

The Best-Run Businesses Run SAP

30

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I see which annotations are active for my Data Definition, including the
propagated annotations?
You can use the Active Annotations View (context menu in Data Definition source > "Open
With" > "Active Annotations") to investigate which annotations have been
propagated/inherited from the underlying data sources and which annotations are
currently active for your Data Definition.

The Best-Run Businesses Run SAP

31

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I test my Data Definition?


You can use the Data Preview in ADT to see which data is selected for the query
implemented in your Data Definition. Open your Data Definition and press F8. You can also
follow any public associations using the Data Preview's bread crumb.

The Best-Run Businesses Run SAP

32

CORE DATA SERVICES ABAP - TOOLING FAQ

How can I see the previous versions of my CDS entity or compare them with the
active version in another system?
Use the "Compare With" functionality in ADT to compare different versions of your CDS
object ("Revision History...") or local versions of your object ("Local History") which have
been automatically stored on your client while you edit the source. Open your CDS object
and select "Compare With" in the context menu.

Topic continued ->

The Best-Run Businesses Run SAP

33

CORE DATA SERVICES ABAP - TOOLING FAQ


You can also select an ABAP Project to compare your Data Definition with the active version
of the Data Definition in the corresponding ABAP system.

The Best-Run Businesses Run SAP

34

CORE DATA SERVICES ABAP - TOOLING FAQ

How do I change the package assignment of my CDS entity?


Select the CDS object in the Project Explorer and choose "Change Package Assignment" in
the context menu.

The Best-Run Businesses Run SAP

35

CORE DATA SERVICES ABAP - TOOLING FAQ

Can I rename my entity / SQL View after it has been transported?


No. To avoid inconsistencies in the transport landscape, you should not change the entity
name or the SQL View name of your Data Definition after it has been transported. You can
only safely change the names by deleting your definition and transporting the deletion.
Thereafter you can re-define your CDS View using the new names.

The Best-Run Businesses Run SAP

36

CORE DATA SERVICES ABAP - TOOLING FAQ

Help
Where can I find detailed information about the CDS tooling in ADT?
You can find detailed information about the CDS tooling in ADT via the menu "Help" > "Help
Contents" > "SAP - ABAP CDS Development User Guide".
Where available, you can also access context-specific information about the tool by clicking
on the help icon.

The Best-Run Businesses Run SAP

37

CORE DATA SERVICES ABAP - TOOLING FAQ

Where do I get more information about the CDS language?


Position the cursor on a keyword in your Data Definition and press F1. The ABAP Language
Help will be opened in a separate view.

The Best-Run Businesses Run SAP

38

CORE DATA SERVICES ABAP - TOOLING FAQ

Is there a list of all the keyboard shortcuts I can use in my CDS editors?
You can find a list of all the keyboard shortcuts via the menu "Help" > "Key Assist...". Begin
typing to search for a specific keyboard functionality.

The Best-Run Businesses Run SAP

39

CORE DATA SERVICES ABAP - TOOLING FAQ

Disclaimer
This document outlines our general product direction and should not be relied on in making
a purchase decision. This document is not subject to your license agreement or any other
agreement with SAP. SAP has no obligation to pursue any course of business outlined in this
document or to develop or release any functionality mentioned in this document. This
document and SAP's strategy and possible future developments are subject to change and
may be changed by SAP at any time for any reason without notice. This document is
provided without a warranty of any kind, either express or implied, including but not
limited to, the implied warranties of merchantability, fitness for a particular purpose, or
non-infringement. SAP assumes no responsibility for errors or omissions in this document,
except if such damages were caused by SAP intentionally or grossly negligent.

The Best-Run Businesses Run SAP

40

Вам также может понравиться