Ansicht
Dokumentation

ABENCDS_TYPING - CDS TYPING

ABENCDS_TYPING - CDS TYPING

ABAP Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

- typing

... dtype $| data_element  ...

Effect

Types elements or parameters of CDS entities in CDS DDL. The following is typed:

  • Elements of CDS entities:

  • Input parameters of CDS entities

Typing can be specified either directly with dtype using a built-in data type in ABAP Dictionary, or using the name of a data element data_element. The table below shows the possible options for dtype and their meanings. The last two columns indicate whether the typing is possible for elements or input parameters.

dtype Built-In Data Type in ABAP Dictionary Element Parameter
abap.accp(6) ACCP (only in a table function) x -
abap.char( len ) CHAR with length len x x
abap.clnt$[(3)$] CLNT x x
abap.cuky$[(5)$] CUKY x x
abap.curr(len,dec) CURR with length len and with dec decimal places x x
abap.d16n$[(16)$] DECFLOAT16 x x
abap.d34n$[(34)$] DECFLOAT34 x x
abap.datn$[(8)$] DATN x x
abap.dats$[(8)$] DATS x x
abap.dec(len,dec) DEC with length len and with dec decimal places x x
abap.fltp$[(16,16)$] FLTP x x
abap.geom_ewkb GEOM_EWKB x -
abap.int1$[(3)$] INT1 x x
abap.int2$[(5)$] INT2 x x
abap.int4$[(10)$] INT4 x x
abap.int8$[(19)$] INT8 x x
abap.lang$[(1)$] LANG x x
abap.numc( len ) NUMC with length len x x
abap.quan(len,dec) QUAN with length len and with dec decimal places x x
abap.raw(len) RAW with length len x x
abap.rawstring RAWSTRING x -
abap.sstring(len) SSTRING with length len x x
abap.string STRING x -
abap.timn$[(6)$] TIMN x x
abap.tims$[(6)$] TIMS x x
abap.unit$[(2$|3)$] UNIT with length 2 or 3 (standard length) x x
abap.utcl$[(27)$] UTCLONG x x

len and dec must be used to specify values for the length and decimal places of the respective generic types. The values specified here in parentheses must be within the value ranges allowed by ABAP Dictionary. For data types with fixed lengths and decimal places, it is possible, but not mandatory to specify the predefined value for length and decimal places. The exception in this regard is abap.accp: this type has the predefined length of 6, which must always be specified in parentheses. For data_element, every ABAP Dictionary data element whose built-in type is listed in the table above can be specified.

Note

Currently, only elementary data types are supported and no structured or tabular parameters.

Example

The following CDS view entity has two input parameters. p_date is typed with data element DEMODATE and p_num is typed with the built-in data type DEC with a specified length and number of decimal places.

The program DEMO_CDS_PARAMETER_TYPE accesses the view using the following SELECT statement:

SELECT id, col_date, col_num
       FROM demo_cds_parameter_type_ve( p_date = @sy-datlo,
                                        p_num  = '1.234' )
       INTO TABLE @DATA(result).






ABAP Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 18185 Date: 20240424 Time: 040031     sap01-206 ( 77 ms )