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.
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:
- Creation of ABAP Project
- Creation of ABAP Package
- 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.
- 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.