Ansicht
Dokumentation

ABENCDS_DEFINE_VIEW_AS_INTERFACE - CDS DEFINE VIEW AS INTERFACE

ABENCDS_DEFINE_VIEW_AS_INTERFACE - CDS DEFINE VIEW AS INTERFACE

RFUMSV00 - Advance Return for Tax on Sales/Purchases   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- DEFINE VIEW ENTITY AS PROJECTION ON, Transactional Interface

$[@entity_annot1$]
$[@entity_annot2$]
...
$[@proj_view_annot1$]
$[@proj_view_annot2$]
...
DEFINE $[ROOT$] VIEW ENTITY projection_view
  PROVIDER CONTRACT TRANSACTIONAL_INTERFACE
    AS PROJECTION ON cds_entity $[AS alias_name$]
      { projection_list }


Additions

1. ... ROOT

2. ... AS alias_name

Effect

Defines a CDS transactional interface with the name projection_view in CDS DDL.

The projected entity cds_entity can be either a CDS view entity or a (deprecated). The projected entity must be part of a RAP BO: It must either be a root entity or contain a to-parent association. No other CDS entities or data sources are allowed as projected entity. Path expressions are not allowed for specifying the projected entity. One CDS entity can be used as basis for multiple CDS projection views.

The name of the CDS projection view projection_view is defined after the DEFINE VIEW ENTITY statement. The usual rules for ABAP Dictionary views apply to this name and it is not case-sensitive (it is transformed internally into uppercase letters). It can have a maximum of 30 characters and is in the namespace of all global types of an AS ABAP. The name of the DDL source and of the CDS entity must be identical.

A CDS transactional interface that uses the addition PROVIDER CONTRACT TRANSACTIONAL_INTERFACE must be part of a RAP business object. That means that the view must either be a root entity itself, or it must be part of a composition tree and reach a root entity via a composition.

Components

  • Header annotations specified before the statement DEFINE VIEW ENTITY are not inherited from the projected entity. It is possible, but not mandatory, to specify entity annotations @entity_annot or projection view annotations @proj_view_annot as header annotations.
  • The projection list projection_list defines the elements exposed as part of the interface.

Release Contracts

  • A transactional interface can be released for Contract C0.
  • A transactional interface should be released for Contract C1.
  • A transactional interface should not be released for Contract C2.

Notes

  • CDS access control defined for a CDS transactional interface must be defined symmetrically to the CDS access control for the projected entity. The behavior of the access control of the projected entity must be inherited.
  • No further clauses are possible. WHERE, UNION, and GROUP BY are not supported.

Example

The following CDS transactional interface is based on the CDS view entity DEMO_CDS_PURCH_DOC_M. The composition is redirected to the CDS transactional interface of the child entity.

Both parent and child entity should be releases for system-internal use under the C1 contract.

The following CDS transactional interface represents the child entity:



Addition 1

... ROOT

Effect

The keyword ROOT specifies that the transactional interface is the root entity of a composition tree. The transactional interface must always reflect the position of the projected entity in the composition tree: if the projected entity is a root entity, the transactional interface must be a root as well. If the projected entity is not a root, the projection view cannot be a root. In this case, the projected entity must contain a to-parent association.

A transactional interface must always either be a root entity itself, or it must be part of a composition tree and reach a root entity via an association.

Addition 2

... AS alias_name

Effect

Defines the name alias_name as alias name of the projected entity. The alias name can have a maximum of 30 characters. If no name is defined explicitly using AS, then the original name of the data source is used.






Addresses (Business Address Services)   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 9074 Date: 20240512 Time: 040259     sap01-206 ( 82 ms )