SAP NEWS-751-ABAP CDS



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS in ABAP Release 7.51
ITOC

ABAP_MODIFICATION_NN Client Handling

The new annotation @ClientHandling specifies the client handling of CDS views and CDS table functions. It replaces the annotation @ClientDependent and makes it obsolete.

ABAP_MODIFICATION_NN Expressions and Functions

The following enhancements have been implemented:
CAST expression
In a CAST expression, operands of the types SSTRING can now be cast to types other than themselves and back. Here, the type SSTRING behaves like the data type CHAR.
In a CAST expression, operands of the types CLNT, LANG, TIMS, and UNIT can now be cast to the types CHAR and SSTRING. Here, the target type must be specified as a data element.
In a CAST expression, the data types CHAR, SSTR, and NUMC can now be cast to ACCP, and the other way round.
Aggregate expressions can now be used as operands in a CAST expression.
New Functions
The following additional string functions are now supported: UPPER and LOWER
The following additional date/time functions are now supported: ABAP_SYSTEM_TIMEZONE, ABAP_USER_TIMEZONE, TSTMP_TO_DATS, TSTMP_TO_TIMS, TSTMP_TO_DST, and DATS_TIMS_TO_TSTMP
A new built-in conversion function FLTP_TO_DEC can be used to convert arguments of type FLTP to packed numbers.
An addition AS dtype can now be specified for the aggregate expression AVG to determine the data type of the return value.
Conditions
Built-in functions can now be specified on the right side of a cond_expr condition of a WHERE condition, an ON condition, a filter condition , or a complex case distinction.
In cond_expr conditions, fields of data sources of the type ACCP can now be compared with fields of the same type, and with literals of the type NUMC.
The following changes have been made:
In CAST expressions to data elements, the restriction no longer applies that the data type, the length, and the number of decimal places of operand and target data type must match precisely. This restriction can now be applied as an optional restriction using the new addition PRESERVING TYPE. This addition specifies explicitly that casts are to be applied to the semantic properties of a data element. PRESERVING TYPE suppresses the syntax warning that handles casts of identical technical types.

ABAP_MODIFICATION_NN Cross Join

As well as an inner and outer join, it is now possible to use a cross join in a SELECT statement.

ABAP_MODIFICATION_NN CDS Associations

The following changes have been made:
Associations can now be published for union sets formed with UNION. In this case, special rules apply.
WITH DEFAULT FILTER can be used to specify a default filter condition for an association. This condition is used as a filter condition in a path expression if no condition is specified for the association here.
In a path expression, *: can be used to declare an association as a non-unique association explicitly.

ABAP_MODIFICATION_NN Session Variables

When a CDS view is accessed using AB_SQL , it is possible to access the new session variable $session.system_date in which the values of the system field sy-datum are available.

ABAP_MODIFICATION_NN CDS View Extensions

The statement EXTEND VIEW can now be used to extend the following CDS views too:
CDS views with aggregate expressions and a GROUP-BY clause
CDS views with a UNION clause for union sets
For enhancements of the GROUP-BY clause and UNION clauses, the existing CDS view must contain the new annotation array AbapCatalog.viewEnhancementCategory[ ] with suitable values. The value #NONE of this annotation array can be used to prevent any enhancements being made to a CDS view using CDS view enhancements .

ABAP_MODIFICATION_NN Annotations

The following changes have been made:
Annotation for Key Fields The new view annotation AbapCatalog.preserveKey can be used to override the default behavior of the addition KEY for defining key fields of a CDS view. If the annotation is specified with the value true, the key fields defined using KEY are also used for the associated CDS database view.
Null Values of Annotations For each element annotation that is not part of an annotation array , the special value null can be specified (without quotation marks). This means that the annotations are ignored in the evaluation with class CL_DD_DDL_ANNOTATION_SERVICE by default.

ABAP_MODIFICATION_NN Metadata Extensions

Metadata extensions are new CDS objects that allow CDS annotations for a CDS entity to be created and transported separately from their DDL source code . Metadata extensions are included by default in the evaluation of annotations with the class CL_DD_DDL_ANNOTATION_SERVICE.
Metadata extensions are created using the DDL statement ANNOTATE VIEW. Each metadata extension is linked to a layer, such as a branch, customer, or partner, which determines the priority.

ABAP_MODIFICATION_NN Access Control

The following enhancements have been implemented in CDS access control:
As well as conditional access rules , there are now also full access rules and inherited access rules.
There is a new operator ?= for access conditions, which checks not only for a specified value but also the initial value or the null value.
A new user condition compares the value of an element of a CDS entity with the current user name.

ABAP_MODIFICATION_NN Key Fields

The following changes have been made:
The key fields of a CDS view that are defined with KEY must now, like the key fields of a CDS table function, be placed without gaps at the start of the SELECT list.
The new view annotation AbapCatalog.preserveKey can be used to override the default behavior of the addition KEY for defining key fields of a CDS view. If the annotation is specified with the value true, the key fields defined using KEY are also used for the associated ABAP_CDS_MNG_VIEW .