Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Data Definitions →  ABAP CDS - DDL for Data Definitions →  ABAP CDS - DEFINE VIEW →  ABAP CDS - SELECT →  ABAP CDS - SELECT, Built-In Functions →  ABAP CDS - sql_functions 

ABAP CDS - coalesce

Other versions: 7.31 | 7.40 | 7.54

Syntax


... COALESCE( arg1, arg2 ) ...

Effect

Coalesce function in a SELECT statement of a CDS view. The coalesce function returns the value of the argument arg1 (if this is not the null value), else it returns the value of the argument arg2. The arguments can be literals, fields of a data source, input parameters, built-in functions, or expressions of data types CHAR, SSTR, CLNT, LANG, NUMC, CUKY, UNIT, DATS, TIMS, FLTP, DEC, CURR, QUAN, INT1, INT2, or INT4 or INT8.

The data types of both arguments must either match of the data type of one argument must represent the full value of the other data type. The result has the dictionary type of the argument with the greater value range.