Ansicht
Dokumentation

ABENCDS_UNTYPED_LITERAL_V2 - CDS UNTYPED LITERAL V2

ABENCDS_UNTYPED_LITERAL_V2 - CDS UNTYPED LITERAL V2

rdisp/max_wprun_time - Maximum work process run time   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

- CDS View Entity, Untyped Literal

... 'character_literal'$|numeric_literal ...

Effect

Untyped literal in a SELECT statement of a CDS view entity. It is either a character literal or a numeric literal:

  • Untyped character literal
A character literal 'character_literal' is a character string enclosed in quotation marks. If the character string consists exclusively of digits, the data type of the literal is NUMC. If this is not the case, the data type is CHAR. When activated, the length of the corresponding field in the database system is set to a size at least as large as the actual length of the literal. A character literal can have a maximum of 1333 characters.
  • Untyped numeric literal
A numeric literal numeric_literal is a series of digits between 0 and 9. It can be directly prefixed by a + or - sign and can contain a decimal point (.) after the first digit. A numeric literal without a decimal point is handled as a field of the type INT1, INT2, INT4, or INT8, depending on the value. A numeric literal with a decimal point is a floating point number of type FLTP. The value of a numeric literal must be within the value range of the valid types.

Literals can be used at all operand positions where this is documented.

Notes

  • 0.5 is a valid numeric literal, but .5 is not.
  • Byte-like literals are currently not supported.
  • The built-in conversion function FLTP_TO_DEC can be used to convert literals with a decimal point to a packed number.
  • Literals can be of data type CHAR, NUMC, INT1, INT2, INT4, INT8, or FLTP. If an operand expects input of any other data type, then a literal is not possible in this operand position. There are a few exceptions to this rule, for example, some date and time conversion functions accept literal input which is then interpreted as date or time data type. These exceptions are mentioned in the documentation of the respective functions.

Example

The CDS view entity demonstrates various literals at operand positions while making use of the database table SPFLI. The program DEMO_CDS_LITERALS_VE uses SELECT to access the view entity.






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 4916 Date: 20240511 Time: 202424     sap01-206 ( 66 ms )