Technical Articles
Feature Matrix: Data Modeling with ABAP Core Data Services
This page offers an overview of all available CDS DDL features. It can be used like a cheat sheet to look up features and their release dates. It also offers links to data sources with further information on each feature. It will be updated regularly to always reflect the current ABAP CDS DDL feature scope. | Last update: 2023-08 |
Contents:
- CDS entities
- CDS user-defined types
- CDS user-defined functions
- CDS associations (regular, compositions, and to-parent)
- Joins
- Clauses
- Operands and expressions
- Operands
- Typed literal
- Untyped literal
- Field
- Parameter
- Session variable
- Expressions
- Arithmetic expression
- Aggregate function
- Case distinction (simple and complex)
- Cast expression (including new casts since release 7.55)
- Reusing expressions from the SELECT list with $projection
- Relational operators
- Path expressions
- Amounts and quantities in expressions
- Built-in functions
- Numeric functions
- String functions
- Coalesce function
- Conversion functions (type conversion, unit and currency conversion, date and time conversion)
- Operands
- CDS system entities
- CDS tuning objects
- CDS entity extensions
- Development pipeline
- Documentation resources
- ABAP Learning Resources
1. CDS entities
The following CDS entities are available in release ABAP Platform 2022 for data modeling.
Note: Column Release lists three release numbers. The first one refers to the ABAP release, the second one to the kernel release and the third one to the ABAP Platform Classic release.
CDS entity type | ABAP CDS statement | Purpose | Release | Further info |
CDS view entity
|
DEFINE VIEW ENTITY |
|
7.55 7.80 2020 |
|
CDS projection view of type transactional query | DEFINE VIEW ENTITY PROVIDER CONTRACT TRANSACTIONAL_QUERY AS PROJECTION ON |
|
7.54 7.76 1909 |
|
CDS projection view of type transactional interface | DEFINE VIEW ENTITY PROVIDER CONTRACT TRANSACTIONAL_INTERFACE AS PROJECTION ON |
|
7.57 7.86 2022
|
|
CDS projection view of type analytical query | DEFINE TRANSIENT VIEW ENTITY PROVIDER CONTRACT ANALYTICAL_QUERY AS PROJECTION ON |
|
7.57 7.86 2022 |
|
CDS table function | DEFINE TABLE FUNCTION |
|
7.50 7.61 1511 |
|
CDS hierarchy | DEFINE HIERARCHY |
|
7.53 7.73 1808 |
|
CDS custom entity | DEFINE CUSTOM ENTITY |
|
7.54 7.75 1909 |
Docu |
CDS abstract entity | DEFINE ABSTRACT ENTITY |
|
7.53 7.70 1809 |
|
CDS DDIC-based view (obsolete) | DEFINE VIEW |
|
7.40 SP05 7.41 |
|
Did you know?
- Check our Data Source Matrix to learn how to combine data sources in CDS: Data sources after FROM and association targets.
- CDS entities are like chameleons: even after you’ve activated and transported an entity, you can change the type of your CDS entity. For example, you have a CDS view and want to convert it into a custom entity for specialization. Or you want to convert an abstract entity into a view to have more options. As long as the consumers are not affected, just change the syntax and activate and transport the changed object.
2. CDS user-defined types
CDS Simple Types
CDS simple types define elementary data types natively in ABAP CDS. A CDS simple type can be enriched with metadata using CDS annotations. The syntax statement for defining a CDS simple type is DEFINE TYPE.
Example:
@EndUserText.label: 'This is a simple type'
define type myType : abap.char(5);
- Available since ABAP release 7.91.
- Abap Keyword Documentation: CDS Simple Types
- ABAP Data Models Guide: Simple Types | SAP Help Portal
- Blog Post: ABAP CDS Releases CDS-Native Data Types: CDS Simple Types | SAP Blogs
CDS Enumerated Types
CDS enumerated types make the concept of enumerations available in ABAP CDS.
With a CDS enumerated type, you can define a fixed set of predefined constants. Variables or data objects typed with an enumerated type only accept one of the predefined values as input. Any wrong input leads to an error message. Thus, enumerations contribute to type safety and data consistency.
The syntax statement for defining a CDS enumerated type is DEFINE TYPE … ENUM.
Example:
@EndUserText.label: 'CDS enum type with base type char'
define type DEMO_CDS_ENUM_CHAR : abap.char(1) enum
{
initial_value = initial;
first_value = 'A';
second_value = 'B';
}
- Available since ABAP release 7.93
- ABAP Keyword Documentation: CDS Enumerated Types
- ABAP Data Models Guide: Enumerated Types | SAP Help Portal
- Release News 2308: Enumerations in ABAP CDS | SAP Blogs
3. CDS user-defined functions
SQL-based scalar functions
An SQL-based scalar function is a user-defined function that accepts multiple input parameters and returns exactly one scalar value. A scalar function allows developers to encapsulate complex algorithms into manageable, reusable code that can then be used in all operand positions of CDS view entities that expect scalar values. A scalar function is linked with an AMDP function in which it is implemented using SQLScript.
A SQL-based scalar function consists of three repository objects:
- CDS scalar function definition defined in ABAP CDS using DEFINE SCALAR FUNCTION.
- A CDS scalar function implementation reference that binds the scalar function to a runtime engine and to an AMDP function implementation.
- An AMDP method that implements the CDS scalar function as database function in SQLScript.
Example:
CDS scalar function definition:
define scalar function DEMO_CDS_SCALAR_RATIO
with parameters
portion: numeric
total : type of portion
returns abap.decfloat34;
CDS scalar function implementation reference:
AMDP function implementation:
METHOD execute BY DATABASE FUNCTION
FOR HDB
LANGUAGE SQLSCRIPT
OPTIONS READ-ONLY.
result = portion / total * 100;
ENDMETHOD.
- Available since ABAP release 7.93
- ABAP Keyword Documentation: CDS SQL-based scalar functions
- ABAP Data Models Guide, Scalar Functions | SAP Help Portal
- Blog Post: ABAP CDS Release News 2308 – CDS Scalar Functions Implemented by AMDP | SAP Blogs
4. CDS associations
Associations describe the relationships between CDS entities. They define a join that is instantiated only when fields are retrieved from the associated entity.
Use cases of CDS associations and how they are transformed into joins are documented here. Moreover, there’s a blog post: From Open SQL Joins to CDS Associations | SAP Blogs.
Types of associations:
Regular, not specialized CDS association
- Available since ABAP release 7.4 SP5.
- Available in CDS view entities, CDS projection views, CDS custom entities, CDS abstract entities, and CDS DDIC-based views.
- Docu
- Syntax:
ASSOCIATION [ OF {EXACT ONE | MANY | ONE} TO {EXACT ONE | MANY | ONE} ]
TO target [AS _assoc]
ON cds_cond
[ WITH DEFAULT FILTER cds_cond ]
CDS composition
- Specialized CDS association that defines the current entity as parent and the composition target as child.
- Available since ABAP release 7.75, ABAP Platform Classic 1809 SP01.
- Available in CDS view entities, CDS projection views, CDS custom entities, CDS abstract entities, and CDS DDIC-based views.
- Docu
- Syntax:
COMPOSITION [ OF {EXACT ONE | MANY | ONE}
TO {EXACT ONE | MANY | ONE} ]
target [AS _compos]
Association to parent
- Specialized CDS association that defines the current entity as child and the association target as parent. The child depends on the parent and cannot exist without the parent. For example, a sales order item (composition child) always belongs to a sales order header (composition parent).
- Available since ABAP release 7.75, ABAP Platform Classic 1809 SP01.
- Available in CDS view entities, CDS projection views, CDS custom entities, CDS abstract entities, and CDS DDIC-based views.
- Docu
- Syntax:
ASSOCIATION TO PARENT target [AS _assoc] ON $projection.cds_cond
5. Joins
In ABAP CDS, the following join types are available for modeling relationships between CDS entities:
Join type | Available as of |
Inner join | 7.4 SP05 |
Left outer join | 7.4 SP05 |
Right outer join | 7.4 SP05 |
Cross join | 7.51 |
6. Clauses
Note: Column Release lists three release numbers. The first one refers to the ABAP release, the second one to the kernel release and the third one to the SAP BTP ABAP Environment release.
Clause | Function | Release | Further info |
WHERE | Defines a filter condition. | ABAP release 7.4 SP5 | Docu |
GROUP BY | Groups the rows in the result set by their content. Required as soon as there are aggregate expressions. | ABAP release 7.4 SP5 | Docu |
HAVING | Can be used together with GROUP BY to specify a further filter condition. | ABAP release 7.4 SP5 | Docu |
EXCEPT |
Returns all distinct rows of the first result set that are not part of the following result sets. |
7.56 7.85 2108 |
Docu |
INTERSECT |
Returns all distinct rows that are part of all result sets. |
7.56 7.85 2108 |
|
UNION |
Merges the result sets of all queries. |
ABAP release 7.4 SP5 |
7. Operands and expressions
7.1 Operands
Note: Column Release lists three release numbers. The first one refers to the ABAP release, the second one to the kernel release and the third one to the SAP BTP ABAP Environment release.
Operand | Explanation | Release | Further info |
Typed literal |
Data types: Int1, int2, int4, int8, dec, decfloat16, decfloar34, fltp, char, string, sstring, raw, rawstring, numc, clnt, lang, dats, datn, tims, timn, utcl, curr, cuky, quan, unit. Syntax: abap.dtype’value’ Example: utcl’2020-01-02 23:59:59,1234567′ |
7.56 7.83 2102 |
Docu |
Untyped literal |
Data types: char, int1, int2, int4, int8, fltp. Note: Typed should be preferred over untyped! |
ABAP release 7.4 SP5 | Docu |
Field | Field of a data source of the current entity. Alias name using AS. If several data sources, prefix recommended. | ABAP release 7.4 SP5 | Docu |
Parameter | Input parameter from the parameter list. | ABAP release 7.4 SP8 | Docu |
Session variable | System fields that can be accessed with the syntax $session.<name>. Similar to ABAP system fields (sy-<name>). The following session variables are available:
|
ABAP release 7.5, some were added later | Docu |
7.2 Expressions
Arithmetic expressions
- Available since ABAP release 7.4 SP5
- Docu
Operator | Meaning |
+ | Addition |
– | Subtraction |
* | Multiplication |
/ | Division |
Aggregate functions
- Available since ABAP release 7.4 SP5
- Docu
Function | Meaning |
MAX (ALL | DISTINCT arg) | Returns the greatest value of arg. |
MIN (ALL | DISTINCT arg) | Returns the least value of arg. |
AVG (ALL | DISTINCT arg) | Average value of arg. Must be specified with the addition AS dtype. |
SUM (ALL | DISTINCT arg) | Sum of arg. |
COUNT (DISTINCT arg) | The number of distinct values of arg is counted. |
COUNT(*) | The number of rows in the result set is counted. |
Case distinction
- Simple case is available since ABAP release 7.4 SP5
- Searched case is available since 7.4 SP8
- New in release kernel release 7.89 | ABAP release 7.57 | SAP BTP ABAP Environment 2208: THEN ELSE NULL is available to explicitly define the null value as return value if no matches are found.
- Docu
A case expression in ABAP CDS always returns exactly one value, depending on the conditions. The simple case expression compares an expression to several other expressions for equality:
CASE operand
WHEN operand1 THEN result1
[WHEN operand2 THEN result2]
...
[{ELSE resultn | ELSE NULL}]
END
The complex case expression (aka ‘searched case’) evaluates N independent conditions. The first case to be evaluated to TRUE returns the result. If none of the conditions are true, the result is determined by the ELSE branch:
CASE WHEN cds_cond1 THEN result1
[WHEN cds_cond2 THEN result2]
[WHEN cds_cond3 THEN result3]
...
[{ELSE resultn | ELSE NULL}]
END
Cast expression
- Data type conversion
- Available since ABAP release 7.4 SP5, but the cast matrix has been extended over time.
- Docu (including full cast matrix)
- Syntax:
-
CAST( <expression> AS <datatype> [PRESERVING TYPE])
- New casts since ABAP release 7.55
-
FROM TO SSTRING DEC, CURR, QUAN, INT1, INT2, INT4, INT8, DECFLOAT16, and DECFLOAT34 CHAR DEC, CURR, QUAN, INT1, INT2, INT4, INT8, DECFLOAT16, and DECFLOAT34 DATS DEC, CURR, QUAN, INT1, INT2, INT4, INT8, DECFLOAT16, and DECFLOAT34 TIMS DEC, CURR, QUAN, INT1, INT2, INT4, INT8, DECFLOAT16, and DECFLOAT34 DECFLOAT16 CHAR DECFLOAT34 CHAR FLTP DEC, CURR, QUAN, INT1, INT2, INT4, INT8, DECFLOAT16, and DECFLOAT34
Reusing expressions from the SELECT list
- $projection.elementName reuses an expression from the SELECT list in another operand position of the same CDS entity. This enables further processing of calculated fields and avoids the workaround of building a view stack for that purpose.
- Available since ABAP release 7.56 | kernel release 7.84 | SAP BTP ABAP Environment 2105
- Docu
- Example:
-
define view entity DEMO_CDS_EXPRESSION_REUSE as select from demo_expressions { //arithmetic expression abap.decfloat34'123.45E6' as arith, $projection.arith * 2 as arith_reuse, //cast expression cast(char1 as abap.numc(10)) as cast1, coalesce($projection.cast1, numc2) as cast_reuse, //built-in function abs(dec1) as builtIn, cast($projection.builtIn as abap.int4) as builtIn_reuse, }
Relational operators
Operator | Meaning | Release |
= | Equal | ABAP release 7.4 SP5 |
<> | Not equal | ABAP release 7.4 SP5 |
< | Less than | ABAP release 7.4 SP5 |
> | Greater than | ABAP release 7.4 SP5 |
<= | Less than or equal to | ABAP release 7.4 SP5 |
>= | Greater than or equal to | ABAP release 7.4 SP5 |
[NOT] BETWEEN | Interval comparison | ABAP release 7.4 SP5 |
LIKE | Pattern comparison | ABAP release 7.4 SP5 |
IS [NOT] NULL | Identifies the null value | ABAP release 7.4 SP5 |
IS [NOT] INITIAL | Identifies initial values | ABAP release 7.73 |
Path expressions
Path expressions can be used to include fields from associated sources in the field list of the CDS entity. A path expression can also go over several levels. It is also possible to add attributes to the evaluation of the associations, for example to filter or to define the join type.
Example:
_Items[1:currency <> 'EUR'].material = 'WOOD'
Amounts and quantities in expressions
Amount and quantity handling in expressions in ABAP CDS has been overhauled since ABAP release 7.56 | kernel release 7.84 | SAP BTP ABAP Environment 2105. See the following blog post for details: ABAP CDS Cheat Sheet: Amounts and Quantities in ABAP CDS | SAP Blogs.
7.3 Built-in functions
Numeric functions
Function | Description | Release |
ABS(arg) | Positive absolute value of arg. | ABAP release 7.4 SP8 |
CEIL(arg) | Rounding up arg to the nearest integer | ABAP release 7.4 SP5 |
DIV(arg1, arg2) | Integer part of the division | ABAP release 7.4 SP8 |
DIVISION(arg1, arg2, dec) | arg1 divided by arg2 rounded to dec digits | ABAP release 7.4 SP8 |
FLOOR(arg) | Rounding down arg to the nearest integer | ABAP release 7.4 SP8 |
MOD(arg1, arg2) | Remainder of division of arg1 by arg2 (modulus) | ABAP release 7.4 SP5 |
ROUND(arg,pos) | Commercial rounding of arg, pos decimal places | ABAP release 7.4 SP8 |
String functions
Function | Description | Release |
CONCAT(arg1,arg2) | Concatenate arg1 and arg2. | ABAP release 7.4 SP8 |
CONCAT_WITH_SPACE(arg1, arg2, spaces) | Concatenate strings arg1 and arg2. The number of blanks specified in spaces is inserted between arg1 and arg2. | ABAP release 7.5 |
INSTR(arg,sub) | Position of the first occurrence of sub in arg. | ABAP release 7.5 |
LEFT(arg,len) | Left part of arg of length len. | ABAP release 7.5 |
LENGTH(arg) | Length of the string arg. | ABAP release 7.5 |
LOWER(arg) | Converts the string arg to lower case letters. | ABAP release 7.51 |
LPAD(arg,len,src) | Filling arg from left with src up to len. | ABAP release 7.4 SP5 |
LTRIM(arg,char) | Remove all occurrences of a character char from the left of arg, e.g. leading 0 or blank. | ABAP release 7.5 |
REPLACE(arg1, arg2, arg3) | Replaces arg2 in arg1 with arg3. | ABAP release 7.4 SP8 |
REPLACE_REGEXPR( PCRE => pcre, VALUE =>arg1, WITH => arg2, RESULT_LENGTH => res,optional:[OCCURRENCE], [CASE_SENSITIVE], [SINGLE_LINE], [MULTI_LINE], [UNGREEDY]) |
Replaces the Perl Compatible Regular Expression (PCRE) pcre in the string arg1 with the character string arg2. Only available in CDS view entities. |
ABAP release 7.57 kernel release 7.81 SAP BTP ABAP Environment 2208 |
RIGHT(arg,len) | Right part of arg of length len | ABAP release 7.5 |
RPAD(arg,len,src) | Filling arg from right with src up to len. | ABAP release 7.5 |
RTRIM(arg,char) | Remove all occurrences of a character char from the right of arg, e.g. trailing 0 or blank. | ABAP release 7.5 |
SUBSTRING(arg,pos,len) | Substring arg from the position pos with length len. | ABAP release 7.4 SP5 |
UPPER(arg) | Converts the string arg to upper case letters. | ABAP release 7.51 |
Coalesce function
The coalesce function checks for null values.
Syntax:
COALESCE( arg1, arg2 )
It checks whether arg1contains a null value. If yes, then it returns the value of arg2. If no, then it returns the value of arg1. If both arg1and arg2are null, then the null value is returned.
Available since ABAP release 7.4 SP08
Conversion functions
Type conversion functions
- Cover special data types that cannot be handled using a cast expression
- Docu
Function | Description | Release |
FLTP_TO_DEC( arg AS dtype ) | Converts arg of data type FLTP to a packed number. | ABAP release 7.51 |
BINTOHEX( arg ) | Converts a byte string arg to a character string. | ABAP release 7.5 |
HEXTOBIN( arg ) | Converts a character string arg to a byte string. | ABAP release 7.5 |
Unit and currency conversion functions
- Functions for converting between units and between currencies.
- Docu
- ABAP CDS Cheat Sheet: Amounts and Quantities in ABAP CDS | SAP Blogs
Function | Description | Release |
UNIT_CONVERSION | Performs a unit conversion | ABAP release 7.4 SP8 |
CURRENCY_CONVERSION | Performs a currency conversion | ABAP release 7.4 SP8 |
GET_NUMERIC_VALIE | Returns the numeric value of a currency or quantity field without its currency or unit key. |
ABAP release 7.56 Kernel release 7.83 SAP BTP ABAP Environment 2102 |
CURR_TO_DECFLOAT_AMOUNT | Converts a currency field of data type CURR into a currency field of data type DECFLOAT34. |
ABAP release 7.56 Kernel release 7.83 SAP BTP ABAP Environment 2102 |
Date and time conversion functions
- Perform operations with dates, times, and timestamps.
- Docu
Function | Description | Release |
DATN_DAYS_BETWEEN(date1,date2) | Calculates the difference between date1 and date2. | ABAP release 7.54 kernel release 7.77 SAP BTP ABAP Environment 1908 |
DATN_ADD_DAYS(date,numdays) | Adds numdays days to date. | ABAP release 7.54 kernel release 7.77 SAP BTP ABAP Environment 1908 |
DATN_ADD_MONTHS(date,nummonths) | Adds nummonths months to date. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
DATS_IS_VALID(date) | Determines whether date contains a valid date. | ABAP release 7.5 |
DATS_DAYS_BETWEEN(date1,date2) | Calculates the difference between date1 and date2. | ABAP release 7.5 |
DATS_ADD_DAYS(date,numdays,on_error) | Adds numdays days to date. | ABAP release 7.5 |
DATS_ADD_MONTHS(date,nummonths,on_error) | Adds nummonths months to date. | ABAP release 7.5 |
TIMS_IS_VALID(time) | Determines whether time contains a valid time. | ABAP release 7.5 |
UTCL_CURRENT() | Generates a UTC time stamp (data type UTCLONG). | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
UTCL_ADD_SECONDS(utcl,numseconds) | Adds numseconds seconds to the timestamp utcl. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
UTCL_SECONDS_BETWEEN(utcl1,utcl2) | Calculates the difference between utcl1 and utcl2. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
TSTMP_IS_VALID(tstmp) | Determines whether tstmp contains a valid time stamp. | ABAP release 7.5 |
TSTMP_CURRENT_UTCTIMESTAMP() | Generates a UTC time stamp (data type DEC). | ABAP release 7.5 |
TSTMP_SECONDS_BETWEEN(tstmp1,tstmp2,on_error) | Calculates the difference between tstmp1 and tstmp2. | ABAP release 7.5 |
TSTMP_ADD_SECONDS(tstmp,numseconds,on_error) | Adds numseconds seconds to the timestamp tstmp. | ABAP release 7.5 |
ABAP_SYSTEM_TIMEZONE(clnt,on_error) | Returns the current system time zone. | ABAP release 7.51 |
ABAP_USER_TIMEZONE(user,clnt,on_error) | Returns the current user time zone. | ABAP release 7.51 |
TSTMP_TO_DATS(tstmp,tzone,clnt,on_error) | Extracts the local data for the time zone specified in tzone from a time stamp tstmp. | ABAP release 7.51 |
TSTMP_TO_TIMS(tstmp,tzone,clnt,on_error) |
Extracts the local time for the time zone specified in tzone from a time stamp tstmp. |
ABAP release 7.51 |
TSTMP_TO_DST(tstmp,tzone,clnt,on_error) |
Extracts the daylight saving time marker for the time zone specified in tzonefrom a time stamp tstmp. |
ABAP release 7.51 |
DATS_TIMS_TO_TSTMP(date,time,tzone,clnt,on_error) |
Constructs a time stamp from date and timein the time zone tzone. |
ABAP release 7.51 |
TSTMPL_TO_UTCL(tstmpl,on_error,on_initial) | Converts a time stamp from data type TIMESTAMPL to UTCLONG. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
TSTMPL_FROM_UTCL(utcl,on_null) | Converts a time stamp from data type UTCLONG to TIMESTAMPL. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
DATS_TO_DATN(dats,on_error,on_initial) |
Converts a date from data type DATS to data type DATN. |
ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
DATS_FROM_DATN(datn,on_null) | Converts a date from data type DATN to data type DATS. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
TIMS_TO_TIMN(tims,on_error) | Converts a time from data type TIMS to data type TIMN. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
TIMS_FROM_TIMN(timn,on_null) | Converts a time from data type TIMN to data type TIMS. | ABAP release 7.54 Kernel release 7.77 SAP BTP ABAP Environment 1908 |
Expressions and built-in functions can be nested within each other. The expression matrix has been enhanced in the past releases.
Example:
- Nesting of case and cast
- Substring with cast, parameter, and arithmetic expression as operands
- Nesting of case with another case.
case cast( _a.char1 as char3)
when substring( cast( 'AA' as char2), $parameters.p1, 2*2) then 'text1'
when case 'a' when 'b' then 'c' end then 'text2'
else NULL
end as CaseExp
8. CDS system entities
- CDS system entities are CDS entities delivered with an ABAP Platform that implement basic functionality, similar to ABAP system classes.
- Can be used as data source in other CDS entities or in ABAP SQL.
- Available since ABAP release 7.56 | kernel release 7.84 | SAP BTP ABAP Environment 2105
- Docu
System entity | Description |
SERIES_GENERATE_DATE |
CDS table function that creates a table with a series of dates. |
SERIES_GENERATE_INTEGER |
CDS table function that creates a table with a series of numbers. |
SERIES_GENERATE_TIME |
CDS table function that creates a table with a series of times. |
SERIES_GENERATE_TIMESTAMP |
CDS table function that creates a table with a series of time stamps. |
Example: Creating a series of dates using the CDS system entity SERIES_GENERATE_DATE:
FINAL(current_date) = sy-datum.
FINAL(one_year_later) = current_date + 365.
SELECT * FROM series_generate_date( step = 30,
from_value = @current_date,
to_value = @one_year_later )
ORDER BY element_number
INTO TABLE @FINAL(date_series_gen).
cl_demo_output=>display( date_series_gen ).
Returns a series of dates:
9. CDS tuning objects
- A CDS tuning object is a CDS object defined with CDS DDL in ADT that defines technical properties of a CDS entity.
- Currently, there is only one type of CDS tuning object available: the CDS entity buffer.
- A CDS entity buffer is defined using DEFINE ENTITY BUFFER ON.
- Available since ABAP release 7.57 | kernel release 7.87 | SAP BTP ABAP Environment 2202
- ABAP Keyword Documentation about CDS Tuning Objects
- Tuning Objects | SAP Help Portal
- Buffering CDS View Entities | SAP Blogs
10. CDS entity extensions
Note: Column Release lists three release numbers. The first one refers to the kernel release, the second one to the SAP BTP ABAP Environment release and the third one to the ABAP release.
Statement | Can be used for | Available since |
---|---|---|
EXTEND VIEW ENTITY |
|
7.87 | 1911 | 7.55 |
EXTEND CUSTOM ENTITY | CDS custom entity | 7.89 | 2208 | 7.57 |
EXTEND ABSTRACT ENTITY | CDS abstract entity | 7.84 | 2105 | 7.56 |
EXTEND VIEW | CDS DDIC-based view | ABAP release 7.40, SP08 |
- ABAP Keyword Documentation about CDS Entity Extensions
- ABAP Core Data Services: New syntax for extending CDS entities | SAP Blogs
11. Development pipeline
What can you expect to see in future releases? The following features appeared in my crystal ball. But hey: no guarantee, no legal claims to be made:
- CDS aspects: Reusable artifacts in CDS. CDS aspects allow decomposing entity definitions into parts with different lifecycles, in this way enabling separation of concerns. The approach is borrowed from disciplines like aspect-oriented programming.
- CDS table entities: Similar to database tables defined in ABAP Dictionary, CDS table entites define structured data types in ABAP CDS. Syntax: DEFINE TABLE ENTITY.
Just can’t get enough of feature tables? The ABAP Keyword Documentation contains feature tables that list all available syntax statements plus release dates. Check them out!
12. Documentation resources
- ABAP Keyword Documentation: ABAP – Core Data Services (ABAP CDS)
- ABAP Data Models development guide: ABAP Data Models | SAP Help Portal
13. ABAP learning resources
You can acquire more skills on the modern ABAP programming available on SAP BTP and SAP S/4HANA in the SAP Learning Journeys, such as
More role-based learning resources and opportunities to get certified are available in one place on the SAP Learning site: SAP Learning
Nice blog. However, I call this product documentation and expect this on help.sap.com
How about adding a "cross-release" section there?
This is a condensed version of the ABAP Keyword Documentation with the intention to give an overview of all features, without too many details.
The ABAP Keyword Documentation is an F1 Help and we know from a survey that people do not read it top-down, but topic-wise.
Yes you are right, there should be a Development Guide on SAP Help Portal with all this info. We are working on it
F1 is great and the preferred way, I agree.
As background, many of us are building apps that need to run on several releases. That’s why such “what works where” details are essential - especially if topics are changing rapidly as visible above.
Hi Marc Bernard
here you go:
Feature tables for the complete ABAP language plus release date are currently under construction.
Thank you for this post. It's truly helpful.
This might be a beginner question, but what do each of the 3 releases indicate?
For example, for typed literals, there are 7.56, 7.83 and 2102. I assume 7.83 is about ABAP release and 2102 is about BTP ABAP Environment, but what is 7.56?
Best regards,
Mio
Hi Mio,
good point, I should have explained that. Release numbers can be so confusing.
I have added the release info for each feature directly in the text.
Typed literals are available since ABAP release 7.56 (on-premise), kernel release 7.83, SAP BTP ABAP Environment 2102.
Release info in the ABAP Keyword Documentation is available here.
Hope this helps.
Best regards
Andrea
Hi Andrea,
Thanks for your reply and updating the content. Now it's clear to me.
Also, the ABAP keyword Documentation you shared is very helpful.
Very nice blog. Thank you!! Andrea to share this knowledge with so much of detail 🙂
Hi Andrea,
it i a very good and helpful blog. Thank you for documenting it so thoroughly and making it available to us.
Hi Andrea,
Do we have any function to get the Date from the UTCL type? Like UTCL_TO_DATE or TSTMP_FROM_UTCL(without long details) or any other approach to get a date from UTCL type.
thanks,
Chandra
Hi Chandra,
tstmp_to_dats( cast(tstmpl_from_utcl(utcl_current(), 'NULL') as abap.dec(15,0)), 'CET', $session.client, 'NULL') as DateExtract
This works for a CDS view entity.
Best
Andrea
perfect! Thank you.
great post. Will be a go to place for me for any recall/future updates. 🙂