ABAP_CDS_DDL - CDS View Entity, Numeric Functions The following table shows the possible numeric SQL functions> in a CDS view entity>, plus the requirements made on the arguments. Function>Result>Valid Argument Types>Result Type> ABS(arg)>>Absolute amount of arg> INT1>>, INT2>>, INT4>>, INT8>>, DEC>>, CURR>>, QUAN>>, DECFLOAT16>>, DECFLOAT34>>, FLTP>>Data type of arg> CEIL(arg)>> Returns the first integer that is greater than or equal to the value of arg> DEC>>, DECFLOAT16>>, DECFLOAT34>> Data type of arg> DIV(arg1, arg2)>>The result of a division of arg1> by arg2> is rounded to an integer. The sign is assigned after the amounts are divided; positive if the arguments have the same sign, and negative if the arguments have different signs. ABAP_EXCEPTION arg2> has the value 0. INT1>>, INT2>>, INT4>>, INT8>>, DEC>>.Data type of the argument with the greatest value range DIVISION(arg1, arg2, dec)>> Division of arg1> by arg2>. The result is rounded to dec > decimal places. arg1>, arg2>: INT1>>, INT2>>, INT4>>, INT8>>, DEC>> lbr lbr dec>: integer numeric literal> greater than or equal to 0. Length must be suitable so that the total of 31 valid places is not exceeded. DEC>> with dec> decimal places. The length of the result must not be greater than 31. FLOOR(arg)>>Returns the largest integer number not greater than the value of arg>. Counterpart to CEIL>. DEC>>, DECFLOAT16>>, DECFLOAT34>>Data type of arg > MOD(arg1, arg2)>>Positive or negative integer remainder of the division of arg1> by arg2 >. arg1>: INT1>>, INT2>>, INT4>>, INT8>> lbr lbr arg2>: INT1>>, INT2>>, INT4>> Data type of arg1> ROUND(arg, pos)>>Rounded value of arg>. If pos> is greater than 0, the value is rounded to the position pos> on the right of the decimal separator. If this is not the case, position abs(pos)>+1 to the left of the decimal separator is rounded. This results in a 0 if the number of places is not sufficient. arg>: INT1>>, INT2>>, INT4>>, INT8>>, DEC>>, CURR>>, QUAN>>, DECFLOAT16>>, DECFLOAT34>> lbr lbr pos>: Literal>, field of a data source or input parameter> of type INT1>>, INT2>>, or INT4>> When arg> has data type INT1>, INT2>, or INT4>, then the result has data type INT4>. For all other data types, the result has the same data type as arg>. The following can be specified as the arguments arg>:
Literals> of a suitable type.
Session variables> of a suitable type.
Suitable fields> of a data source data_source>> of the current CDS view entity.
Path expressions> that identify a suitable field of a data source data_source>>.
Input parameters> from the parameter list parameter_list>>.
Reuse expressions> using $projection>
SQL-based scalar functions> (if they return a matching type)
The following built-in functions and expressions (if they return a matching type):