You are on page 1of 2

What is CDS?

CDS is semnaticaly rich data definition language. It provides as easy to understand and reusable
tool that ABAP developers utilize to execute the code push down paradigm.

TASK:

Get the id, name and respective zip code of the home address for all employees in org-unit
4711.

SQL:

Select * from employee into table lt_empl where org_unit = 4711.

LOOP at lt_empl into lwa_empl.

Write lwa_empl-id.

Write lwa_empl-name.

Select * from address into table lt_addrs where id = lwa_empl-id.

LOOP at lt_addrs.

IF lt_addrs-type = ‘HOMEADDR’.

Write zipcode.

ENDIF.

CDS

Select id,name, homeadress-zipcode from employee where orgunit = 4711.

CDS is semantically rich domain specific language.

It is combination of DDL (Data Definition Language) , QL(Query Language) and DCL(Data Control
Language).

CDS is not written in ABAP but the objects reside in abap data dictionary. It is combination of open sql
and variour list of annotations.

Basic/Interface type of views hit the row data of your tables.

Consumption views are used by odata/ analytics programs will use.


How to know whether we are creating a basic view or consumption view.

@VDM.viewType : BASIC

If I want to use this table in analytic purpose, then I need to tell it is dimension type of table.

@semantics annotations will tell which field we are describing.

If we want to expose the data, there should be a key present.

Creating Consumption View:

If we have multiple basic type views and if we want to connect them we need associations between
them.

SQL view name can be only 16 characters in length.

You might also like