Built-in Functions in ABAP SQL

Now that you learned that you can use expressions in ABAP SQL and ABAP CDS in exactly the same way, what about the built-in functions? Can you use them in ABAP CDS, too?
Let's have a closer look.

- Numeric Functions
For all numeric functions the answer is "yes". They are all supported in ABAP CDS as well.
- String Processing
Most of the string processing functions are also supported. There are a few which are only available in ABAP SQL, mostly related to regular expressions. A detailed list can be found in the ABAP keyword documentation.
- Date and Time Processing
The most restrictions exist in the area of data and time processing functions. Here, the generic functions (IS_VALID( ), ADD_DAYS( ), DAYS_BETWEEN( ), and so on) are only available in ABAP SQL. In ABAP CDS, you have to use the type-specific variants, that is, the corresponding functions starting with DATS, DATN, TIMS, TSTMP, and so on.
In addition, the functions to extract information from a date or time field are not supported in ABAP CDS, that means, you cannot use functions WEEKDAY( ), EXTRACT_MONTH( ), and so on in ABAP CDS. See the ABAP keyword documentation for a complete list.
Let's have a look at some examples.