Skip to Content

With SAP NW ABAP 7.4 SP5 the first instalment of Core Data Services (CDS) support in ABAP was delivered (see New Data Modeling Features in SAP NW ABAP 7.4 SP5). Since CDS is a relatively new technology, new features are constantly being added. Below is a short overview of which features were released with which SAP NW ABAP version and support package. For details about the features you should check out the 7.40 ABAP Keyword Documentation, 7.50 ABAP Keyword Documentation and 7.51 ABAP Keyword Documentation.

 

ABAP Core Data Services (ABAP CDS)

SAP NW ABAP SQL Joins SQL Set Operations SELECT Clauses
7.4 SP5
  • INNER JOIN
  • LEFT OUTER JOIN
  • RIGHT OUTER JOIN
  • UNION
  • UNION ALL
  • WHERE
  • GROUP BY
  • HAVING
  • AS
7.4 SP8
7.5
7.51
  •  CROSS JOIN

 

 SAP NW ABAP Literals Arithmetic Operators Conditional Expressions
7.4 SP5
  • In SELECT list, e.g. ‘literal’ AS fieldName
  • As RHS value
  • +
  • *
  • Boolean Operators
    • NOT, AND, OR
  • Comparison Operators
    • BETWEEN, = , <>, <, >, <=, >=, LIKE
    • IS [NOT] NULL**

** Only in WHERE conditions

7.4 SP8
  • / (Float-based division)
7.5
7.51
  • Function as RHS value

 

 SAP NW ABAP Aggregate Functions Numeric Functions String Functions
7.4 SP5
  • AVG( [DISTINCT] )
  • MAX
  • MIN
  • SUM( [DISTINCT] )
  • COUNT( [DISTINCT] )
  • COUNT( * )
  • CEIL
  • MOD
  • SUBSTRING
  • LPAD
7.4 SP8
  • ABS
  • DIV (Integer-based division)
  • DIVISION (Decimal-based division)
  • FLOOR
  • ROUND
  • CONCAT
  • REPLACE
7.5
  • CONCAT_WITH_SPACE
  • INSTR
  • LEFT
  • LENGTH
  • LTRIM
  • RIGHT
  • RPAD
  • RTRIM
7.51
  • AVG( [AS] ) to specify return type
  •  FLTP_TO_DEC
  • UPPER
  • LOWER

 

SAP NW ABAP Byte String Functions Date and Time Functions Other Functions
7.4 SP5
  • CAST to built-in DDIC types, e.g.: abap.fltp
7.4 SP8
  • COALESCE
  • CURRENCY_CONVERSION
  • UNIT_CONVERSION
  • DECIMAL_SHIFT
7.5
  • BINTOHEX
  • HEXTOBIN
  • DATS_DAYS_BETWEEN
  • DATS_ADD_DAYS
  • DATS_ADD_MONTHS
  • DATS_IS_VALID
  • TIMS_IS_VALID
  • TSTMP_IS_VALID
  • TSTMP_CURRENT_UTCTIMESTAMP
  • TSTMP_SECONDS_BETWEEN
  • TSTMP_ADD_SECONDS
  • CAST
    • to data elements, e.g. CHAR80
    • can be nested
7.51
  • ABAP_SYSTEM_TIMEZONE
  • ABAP_USER_TIMEZONE
  • TSTMP_TO_DATS
  • TSTMP_TO_TIMS
  • TSTMP_TO_DST
  • DATS_TIMS_TO_TSTMP
  • CAST
    • PRESERVING TYPE
    • SSTRING to other types
    • CLNT, LANG, TIMS, UNIT to data elements of type CHAR and SSTRING
    • CHAR, SSTRING, NUMC to ACCP and vice versa
    • Aggregate function as operand

 

SAP NW ABAP Conditional (CASE) Expressions Extensibility (Unmanaged) Associations
7.4 SP5
  • “Simple” CASE (behaves like switch statement)
  • Nested CASE statements
$EXTENSION.* (support for database table extensions)
  • Path expressions in
    • SELECT list
    • FROM clause
    • WHERE clause
    • HAVING clause
  • Filter conditions in path expressions, e.g.: Products._Texts[ langu = ‘EN’ ] as english_name
7.4 SP8
  • “Searched” CASE (behaves like if … else if)

EXTEND VIEW**

** Added elements cannot be input parameters, path expressions or aggregate expressions

7.5
  • CASE expressions can be used as operands in CAST functions

EXTEND VIEW**

** Input parameters, path expressions and conversion, date and time functions can be added/used

7.51
  • Function as RHS value

EXTEND VIEW**

** Views with aggregate functions, GROUP BY clauses and UNIONs can be extended

  • Association definitions in views with UNIONs
  • Default filters for associations (WITH DEFAULT FILTER)
  • Cardinality “to many” ( *: ) can be specified in path filters

 

SAP NW ABAP Session Variables Input Parameters Other
7.4 SP5
  • KEY elements
7.4 SP8
  • Input parameters on most DBs**

** Use ABAP API cl_abap_dbfeatures=>use_features to check if your DB supports CDS views with input parameters

7.5
  • $session.user (sy-uname)
  • $session.client (sy-mandt)
  • $session.system_language (sy-langu)
  • Input parameters on AnyDB
  • TABLE FUNCTION**

** SAP HANA only

7.51
  •  $session.system_date (sy-datum)
  • Metadata Extensions (separate annotation “files”)

 

SAP NW ABAP  “Core” Annotations Further Information
7.4 SP5
  • End-user Texts
  • (Implicit) Client Handling
  • SAP Buffering
  • Reference Fields for amounts/quantities
ABAP CDS in Release 7.40, SP05
7.4 SP8
  • Data Aging
  • Compiler (compare filter conditions of path expressions to reduce number of JOINs)
ABAP CDS in Release 7.40, SP08
7.5
  • Environment.systemField (assign ABAP system fields as default values to input parameters). Possible values:
    • #CLIENT (sy-mandt)
    • #SYSTEM_DATE (sy-datum)
    • #SYSTEM_TIME (sy-uzeit)
    • #SYSTEM_LANGUAGE (sy-langu)
    • #USER (sy-uname)
ABAP CDS in Release 7.50
7.51
  • Enhanced client-handling (@ClientHandling replaces @ClientDependent)
  • Specify key fields of CDS database view (@AbapCatalog.preserveKey)
  • NULL values for annotations
ABAP CDS in Release 7.51
To report this post you need to login first.

10 Comments

You must be Logged on to comment or reply to a post.

  1. Julian Phillips

    Hi Chris,

      I attended your session at Teched Barcelona this year (it was really good!) on ABAP in Eclipse, and in your session – and in several others the technology of CDS views was raised as a way to be prepared for switching to HANA for customers not on HANA yet; or at least that’s how it appeared to me.

    We would like to use the CDS view technology in our Oracle ECC system (7.40 SP09), however we are concerned that if we convert a large number of our SQL selections to CDS that this may constrain the choice of which HANA License we can choose in the future. It was raised by our senior architect that usage of the CDS views may force us to accept an Enterprise HANA license (if this is the case we are instructed not to use CDS). Apparently there are many specific restrictions for usage on HANA that affect which license you must use. Are you aware (or do you know someone who is) if it is possible to migrate CDS views from Oracle to HANA (and then support them once on HANA) without having to accept an enterprise HANA license?

    Note I’m also planning on writing a blog on usage of CDS views from my own perspective, and I think any answer that you or your colleagues can provide will be good input to it.

    kind regards,

    Julian

    (0) 
    1. Christiaan Edward Swanepoel Post author

      Hi Julian,

      here again you need to differentiate between the ABAP implementation of the CDS specification (ABAP CDS) and the native implementation in HDB (HANA CDS). See Horst’s blog for details: CDS – One Concept, Two Flavors

      ABAP CDS and HANA CDS development objects are currently independent of each other.

      You can model your data and develop your code pushdown with ABAP CDS on AnyDB. ABAP CDS objects are the same as any other ABAP development objects. If you can develop ABAP, then you are good to go as far as ABAP CDS is concerned. Even when you migrate to SAP HANA. Your existing ABAP CDS views will work out of the box (since they are “open”). The only difference might be, that your ABAP CDS views might run a little faster on HDB ;-).

      If you implement HANA CDS in the future (as opposed to ABAP CDS), then this is native HANA development. I am not an expert on license questions so I’d suggest you pose this question to a qualified SAP (HANA) representative, e.g. via: Get Connected . Like I said above, this only becomes relevant when you implement HANA CDS. If you are doing ABAP development, then I strongly suggest you only use ABAP CDS since ABAP CDS ensures that the CDS objects are optimally integrated into the ABAP development environment (including lifecycle) and ABAP runtime.

      Kind regards

      Chris

      (0) 
      1. Julian Phillips

        Hi Chris,

        It seems I’ve had my notifications disabled, hence my lack of reply – sorry! thanks for your reply, we are currently only planning on using the ABAP CDS views – and so it sounds to me like we are ok from a license perspective, which is great news! I can get creating views for our main SQL statements – and put some of that great teched knowledge into practice. Note I posted a message via Get Connected – just in case their answer is different. If so I will update here too.

        As for me switching to Springboks, oh dear! where to start? Has hell frozen over recently? I’d say Boks were quite lucky in the last 5 minutes of that world cup match, although on the whole they probably deserved the victory, Wales are by far the best team when we don’t have 15 first choice player injuries (in my opinion)! I have to say the game I enjoyed the most from the world cup was a South Africa game – against Japan I think…

        Thanks once again,

        //Julian

        (0) 
  2. walker cabay

    Good overview!

    The syntax of the DDL and of the DCL of the ABAP CDS comprises elements of the general DDL and DCL of SQL. In addition, the syntax makes it possible to define annotations and associations. The syntax and semantics basically match the general CDS concept.

    This Blog is very Helpful, thanks!

     

    (0) 

Leave a Reply