Ansicht
Dokumentation

ABENCDS_F1_SQL_FUNCTIONS_NUMERIC - CDS F1 SQL FUNCTIONS NUMERIC

ABENCDS_F1_SQL_FUNCTIONS_NUMERIC - CDS F1 SQL FUNCTIONS NUMERIC

rdisp/max_wprun_time - Maximum work process run time   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- Numeric Functions

The following table shows the possible numeric SQL functions in a CDS view, plus the requirements made on the arguments. The meaning of the functions can be found under SQL Functions for Numeric Values.

Function Valid Argument Types Result Type
ABS(arg) INT1, INT2, INT4, INT8, DEC, CURR, QUAN, FLTP Data type of arg
CEIL(arg) INT1, INT2, INT4, INT8, DEC, CURR, QUAN, FLTP INT4, INT8 (if arg is of type INT8)
DIV(arg1, arg2) INT1, INT2, INT4, INT8, DEC, CURR, QUAN without decimal places. Data type arg1, where DEC, CURR and QUAN are implemented after INT4
DIVISION(arg1, arg2, dec) arg1, arg2: INT1, INT2, INT4, INT8, DEC, CURR, QUAN \lbr\lbr dec: integer numeric literal greater than or equal to 0 and not greater than the maximum value of 11 and the length of arg2 plus the number of decimal places of arg1 plus 1 DEC with dec decimal places. The length of the result is the length of arg1 minus the decimal places in arg1 plus the decimal places in arg2 plus dec. This value must not be greater than 31.
FLOOR(arg) INT1, INT2, INT4, INT8, DEC, CURR, QUAN Data type of arg for the integer types, else DEC without decimal places
MOD(arg1, arg2) INT1, INT2, INT4, INT8 Data type of arg1
ROUND(arg, pos) arg: INT1, INT2, INT4, INT8, DEC, CURR, QUAN \lbr\lbr pos: Literal, field of a data source or input parameter of type INT1, INT2, or INT4 Data type arg: here INT1 and INT2 are implemented after INT4.

Note

See Example.

Example

The following CDS view applies built-in numeric SQL functions in the SELECT list to columns of the DDIC database table DEMO_EXPRESSIONS. The program DEMO_CDS_SQL_FUNCTIONS_NUM uses SELECT to access the view.






ABAP Short Reference   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 9914 Date: 20240420 Time: 041816     sap01-206 ( 133 ms )