SAP CDS COND EXPR TYPES V1



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS_DDL - DDIC-Based View, cds_cond, Comparable Types
The following tables show which built-in data types in ABAP Dictionary can be compared with each other in a condition of a ABAP_CDS_V1_VIEW .
ITOC

Comparisons with Fields of Data Sources
The following table shows the possible combinations of data source fields data_source on the left side (lhs) with data source fields on the right side (rhs) of comparisons. lhs/rhsINT1INT2INT4 INT8DECCURR QUANDECFLOAT16DECFLOAT34 FLTPCHARSSTRINGNUMC CLNTLANGDATS TIMSDATNTIMNUTCLONG ACCPUNITCUKY RAW
INT1xxxxxxxxxx-------- ------
INT2xxxxxxxxxx-------- ------
INT4xxxxxxxxxx-------- ------
INT8xxxxxxxxxx-------- ------
DECxxxxxxxxxx-------- ------
CURRxxxxxxxxxx-------- ------
QUANxxxxxxxxxx-------- ------
DECFLOAT16xxxxxxxxxx------ --------
DECFLOAT34xxxxxxxxxx------ --------
FLTPxxxxxxxxxx-------- ------
CHAR----------xxxlxxx- --xxx-
SSTRING----------xx--x-- ---xxx-
NUMC----------x-ll-ll- ------
CLNT----------l-lx---- ------
LANG----------xx--x--- ------
DATS----------x-l--x-- ------
TIMS----------x-l---x- ------
DATN-----------------x ------
TIMN------------------ x-----
UTCLONG----------------- --x----
ACCP----------xx------ --x---
UNIT----------xx------ ---x--
CUKY----------xx------ ----x-
RAW------------------ -----l
There are no restrictions for combinations using x.
In combinations using l, the lengths of the compared columns must match exactly.

Comparisons with Parameters
The following table shows the possible combinations of data source fields data_source on the left side (lhs) with parameters on the right side (rhs) of comparisons . lhs/rhsINT1INT2INT4 INT8DECCURR QUANDECFLOAT16DECFLOAT34 FLTPCHARSSTRINGNUMC CLNTLANGDATS TIMSDATNTIMNUTCLONG ACCPUNITCUKY RAW
INT1xxxxxxxxxx-------- ------
INT2xxxxxxxxxx-------- ------
INT4xxxxxxxxxx-------- ------
INT8xxxxxxxxxx-------- ------
DECxxxxxxxxxx-------- ------
CURRxxxxxxxxxx-------- ------
QUANxxxxxxxxxx-------- ------
DECFLOAT16xxxxxxxxxx------ --------
DECFLOAT34xxxxxxxxxx------ --------
FLTPxxxxxxxxxx-------- ------
CHAR----------xxxlxxx- ---xx-
SSTRING----------xx--x-- ----xx-
NUMC----------x-ll-ll- ------
CLNT----------l-lx---- ------
LANG----------xx--x--- ------
DATS----------x-l--x-- ------
TIMS----------x-l---x- ------
DATN-----------------x ------
TIMN------------------ x-----
UTCLONG----------------- --x----
ACCP----------xx------ ------
UNIT----------xx------ ---x--
CUKY----------xx----- -----x-
RAW------------------ -----l
There are no restrictions for combinations using x.
In combinations using l, the lengths of the compared operands must match exactly.

Comparisons with Literals
The following table shows the possible combinations of data source fields data_source on the left side (lhs) with literals on the right side (rhs) of comparisons. The data types of literals are determined by their content (as described here) and only the data types shown in the table are possible. lhs/rhsINT1INT2INT4 INT8FLTPCHAR NUMC
INT1xv-----
INT2xxv----
INT4xxxv---
INT8xxxv---
DECxxxxd--
CURRlllld--
QUANlllld--
DECFLOAT16xxxx---
DECFLOAT34xxxx---
FLTP-------
CHAR-----mm
SSTRING-----m-
NUMC------l
CLNT------l
LANG-----ll
DATS------l
TIMS------l
ACCP------l
UNIT-----m-
CUKY-----m-
RAW-------
There are no restrictions for combinations using x.
For the combination using v, the literal value must be within the following value range:
Comparison of INT1(lhs) with INT2(rhs): between 0 and 999.
Comparison of INT2(lhs) with INT4(rhs): between -99 ,999 and +99,999.
Comparison of INT4(lhs) with INT8(rhs): between -9 ,999,999 ,999 and +9,999,999,999.
Comparison of INT8(lhs) with INT8(rhs): between -9 ,223 ,372,036,854,775,808 and +9,223,372,036,854,775,807.
For combinations using m, the length of the literal cannot be greater than the column.
For combinations using d, the length of the literal and the number of decimal places cannot be greater than the length and number for the column.
For combinations using l, the length of the literal must be equal to the length of the column.