Ansicht
Dokumentation

ABENCDS_F1_CUSTOM_ASSOCIATION - CDS F1 CUSTOM ASSOCIATION

ABENCDS_F1_CUSTOM_ASSOCIATION - CDS F1 CUSTOM ASSOCIATION

CL_GUI_FRONTEND_SERVICES - Frontend Services   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

- DEFINE CUSTOM ENTITY, association

... ASSOCIATION $[ [min..max] $] TO target ON cds_cond
                $[ WITH DEFAULT FILTER cds_cond $] ...


Additions

1. ... [min..max]

2. ... ON cds_cond

3. ... WITH DEFAULT FILTER cds_cond

Effect

Defines a CDS association in the element list of a CDS custom entity. The CDS association uses an ON condition to associate the current CDS entity with the association target target. The association target can be a CDS view entity, a CDS hierarchy, another CDS custom entity, a CDS abstract entity, a , a DDIC database table, or a DDIC database view.

The syntax is similar to the syntax of the addition ASSOCIATION in the SELECT statement of a CDS view entity with the following differences:

  • The addition AS _assoc is not used. The CDS association is declared using the name _assoc in the element list of the CDS custom entity, after which the addition ASSOCIATION is specified in the element list.
  • There are further restrictions regarding the syntax of the ON condition (see below).

A CDS association defined using the addition ASSOCIATION in the element list of a CDS custom entity is always exposed. It cannot, however, be used in any SQL path expressions, either in ABAP CDS or in .

Note

A CDS association of a CDS custom entity cannot be used anywhere where it could produce instances of join expressions.

Example

The following DDL source code shows a CDS custom entity that exposes a CDS association with another CDS custom entity:

Addition 1

... [min..max]

Effect

The same rules apply as described in topic CDS DDL - CDS View Entity, ASSOCIATION.

Addition 2

... ON cds_cond

Effect

When specifying the ON condition, the following rules apply:

  • The fields of the association target must be prefixed by the name of the CDS association (prefix _assoc. separated by a period).
  • Fields that are listed in the SELECT list of the current view entity must be prefixed with $projection.

The following rules apply to the operands and syntax of the ON condition:

  • As relational operators, comparison operators are allowed as well as BETWEEN, LIKE, IS NULL, IS INITIAL.
  • The Boolean operators NOT, AND and OR are allowed.
  • lhs can be a field of one of the two data sources data_source of the CDS association. If a comparison operator is used as operator, then lhs can also be an untyped literal.
Typed literals are currently not supported at this position.
  • rhs can be a field of both data sources data_source of the CDS association, an untyped literal, or a session variable. if the operator LIKE is used, then rhs must be an untyped character literal.
  • Path expressions are not allowed.
  • CDS DDL expressions are not allowed.

Stricter rules exist for CDS custom entities that are used as queries in the context of the ABAP RESTful Application Programming Model. See the development guide for the ABAP RESTful Application Programming Model, section Query.

Addition 3

... WITH DEFAULT FILTER cds_cond

Effect

The same rules apply as described in topic CDS DDL - CDS View Entity, ASSOCIATION.






CPI1466 during Backup   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 9371 Date: 20240425 Time: 080245     sap01-206 ( 94 ms )