What does it do? Defines a CDS scalar function definition ScalarFunction> as a CDS scalar function> in the CDS FDL>. The name ScalarFunction> must follow the naming conventions for dictionary types>. The following additional rules apply:
The name can be up to 26 characters long. Four characters are reserved for the suffix of the scalar function implementation reference>.
The name must not start with the prefix QCM>.
The first, second, third, and last character of the name must not be an underscore (_>).
A CDS scalar function is located in the namespace of all global types> of an AS ABAP. Optionally, a list of input parameters pname1 >, pname2>, ... can be declared using the addition WITH PARAMETERS>. These also define the input parameters of the AMDP scalar function. There is no limit to the number of input parameters. The typing of these input parameters is explained in the topic TITLE >. The name of an input parameter must comply with the naming rules for names>. Furthermore, it cannot contain any slash (/) characters and cannot be a reserved name in ABAP Dictionary. All reserved names that cannot be used are specified in the DDIC database table TRESE> >. The evaluation of names is not case-sensitive. Each parameter name must be unique. Blanks in the comma-separated parameter list are ignored and can be omitted. RETURNS> defines the data type of the scalar return value. The topic TITLE > explains how the return value can be typed.
ABAP_USE CDS scalar functions are available in CDS view entities> in operand positions that expect scalar values, similar to built-in functions. In particular, they can be specified in the following operand positions:
As the right-hand side of a join ON-condition of a CDS view entity as documented in the topic TITLE >.
As an element in the element list of a CDS view entity, as documented in the topic TITLE >.