Basic CDS View


Understanding a Basic CDS View:

  1. In Top part of a basic CDS, annotations are mentioned. Annotations make CDS view semantically rich. Every CDS annotation has a different meaning. If you need to take a look at available annotations, just type @ in the top part of CDS and press Control + Space.
  2. CDS starts with DEFINE/EXTEND syntax and gives CDS a Structured Object name.
  3. After name of CDS, SELECT query is initiated and JOINS are defined beforehand
  4. Inside curly braces, projection list(fields to be selected) is provided
  5. An individual field can be associated with special semantic meaning using annotations
  6. Inbuilt functions can be used inside CDS which effectively helps in Code Push Down.
  7. ‘Where’ conditions for CDS query can be mentioned just below projection list which filters the data and reduces selection effort
  8. A “Group By” clause can be added if aggregation(sum, count etc.) is used in query
  9. A selection can be UNIONed with another select using UNION ALL/DISTINCT clause. All projections of UNION should be the similar i.e. number of field selection, their type and sequence must be same!


Steps to Check, activate and check data:

  • Once CDS Editing is complete, a syntax check(Ctrl + F2) can be done. In case of any error, Problem view in Eclipse can be used to see errors present in CDS view.
  • Once errors are fixed, CDS can be activated(Ctrl + F3).
  • CDS can be checked for data after activation. For checking data, right click on DDLS object in Project Explorer view > Open With > Data Preview

Data preview is a feature-rich editor where following actions can be done:

  1. Filters can be set of Fields
  2. Number of entries can be checked
  3. SQL console can be opened directly from here where query can be fired on CDS or any table/view of SAP to check data accuracy
  4. Columns can be selected which user needs see at a time
  5. Data can be exported to local desktop
  6. Data can be refreshed if number and sequence of CDS projection is not changed
  7. Maximum number of rows can be set which reduces load of database



Leave a Reply