Skip to Content
Technical Articles
Author's profile photo ARPAN PARNAMI

ABAP CDS VIEWS simplified – PART 1

INTRODUCTION:

 

ABAP Core Data Service Views also known as ABAP CDS Views. There are so many limitations in SE11 views but we can come out of all the limitations and create a powerful views with the help of ABAP CDS Views.

In general SE11 views and ABAP CDS Views both will create a database views at the backend. When we try to access these views as a table in the ABAP code, this code will be executed at the database level.

Hence, SE11 views and ABAP CDS Views both will implement code push-down, In-spite of this, CDS views has many advantages in CDS views.

 

Below are the comparison between SE11 views and ABAP CDS Views:

SE11 Views CDS Views
1. It can be created from SAPGUI or Eclipse.
2. Calculated column are not possible.
3. Input Parameters are not possible.
4. Only Join is possible.
5. Grouping and aggregation are not possible.
6. Annotations are not possible.
1. It can only be created from Eclipse platform only.
2. Calculated columns are possible.
A. Operator
B. CDS Function
C. CASE Expression D. Aggregated Functions
3. Input parameter are allowed.
A. In calculated Columns
B. For filtering data
4. Join and Union both are possible.
5. Grouping and aggregation are possible.
6. Annotation can be used to provide more metadata information to individual fields and Views.

 

Basic ABAP CDS View creation:

Below are the prerequisite knowledge required to create a ABAP CDS View:

  1. Creation of ABAP Project
  2. Creation of ABAP Package
  3. ABAP programming

I have already created the ABAP Project and ABAP Package in the HANA Development perspective and below are the screen shot of these object.

  1. ABAP Project

2. ABAP Package

 

Note: Make sure that you should create a ABAP package inside the ABAP project.

 

I am demonstrating the ABAP CDS view creation using SPFLI table with all the fields of it.

 

Step1. Right click on the ABAP Package and select new ABAP repository object and navigate to                   Core Data Services, select the Data Defination and provide a name to CDS view.

 

Step2 and Step 3. Please provide a suitable name based on your project’s naming                   convention. Click on next and select the Transport request as shown below:

Step 4. Select the template based on your requirement and Click finish. I am selecting Define View template since I am creating a ABAP CDS view with all the fields of Database table SPFLI.

Step5. As soon as you click on the finish, Below code will appears. Please refer the screen shot for explanation.

Step6: Below is the logic for CDS views.

 

Step7. Activate it and click on data preview option.

 

Step8. Click on data preview to view the data of this CDS view.

 

With this example, we have completed the First part of ABAP CDS VIEWS simplified.

 

Please like and comment on it if you find it helpful.

Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo H. Rayilla
      H. Rayilla

      Good one to start off with ABAP CDS! Good luck with the next one Arpan:)

      Author's profile photo ARPAN PARNAMI
      ARPAN PARNAMI
      Blog Post Author

      Thank you

      Author's profile photo Suleyman Dogu
      Suleyman Dogu

      It is too comprehensible for learning CDS. I am looking forward to seeing your new parts.

      Author's profile photo ARPAN PARNAMI
      ARPAN PARNAMI
      Blog Post Author

      Thank you for your positive response.

      Author's profile photo Chetan Adhikari
      Chetan Adhikari

      Great and simplified explanations. Looking forward for your next article. Thanks.

      Author's profile photo Burak Yuce
      Burak Yuce

      Thanks for the article. Good job!

      Author's profile photo Rocio Camus
      Rocio Camus

      Great and simplified explanations.  Thanks !!

      Author's profile photo Bushair Alkatib
      Bushair Alkatib

      Great work. I understand the ABAP CDS work with anyDB especially IBM Db2.

      Thanks a lot

      Author's profile photo M.A Hossain
      M.A Hossain

      Looking forward to seeing your new parts.

      Author's profile photo Keith Osberg
      Keith Osberg

      As an old dog trying to keep up with the new things - excellent ... thank you

      Author's profile photo Saurav Sinha
      Saurav Sinha

      Very well written bro... Good job!!