SAP CDS PV PROVIDER CONTRACT



Get Example source ABAP code based on a different SAP table
  


• PROVIDER CONTRACT ABAP_CDS_PROJ_VIEW
• TRANSACTIONAL_QUERY ABAP_CDS_TRANS_QUERY
• ANALYTICAL_QUERY ABAP_CDS_ANALYTICAL
• TRANSACTIONAL_INTERFACE ABAP_CDS_PROJ_INTERFAC

ABAP_CDS_DDL - PROVIDER CONTRACT

ABAP_SYNTAX
... PROVIDER CONTRACT ${ TRANSACTIONAL_QUERY
$| TRANSACTIONAL_INTERFACE
$| ANALYTICAL_QUERY $} ...
$| ${ $} ...

ABAP_ALTERNATIVES:
1 ... PROVIDER CONTRACT
2 ... ${ $}

What does it do?
The provider contract specifies the scenario in which a CDS projection view is used. The scenario determines in which runtime a CDS projection view is executed and which features are available. It is recommended that the provider contract is always specified to ensure that the appropriate, runtime-specific syntax checks are applied.
It is also possible, but not recommended, to leave out the provider contract. Projection views without provider contract are handled similarly to transactional projection views, but there are some minor differences in the syntax checks applied.

ABAP Alternative 1 ... PROVIDER CONTRACT ...

ABAP Addition
1 ... TRANSACTIONAL_QUERY
2 ... TRANSACTIONAL_INTERFACE
3 ... ANALYTICAL_QUERY

What does it do?
Currently, the following provider contracts are available:
TRANSACTIONAL_QUERY
TRANSACTIONAL_INTERFACE
ANALYTICAL_QUERY
Child entities within a CDS composition tree inherit their parents' provider contract and the specification of a provider contract for a child entity is not allowed. As soon as a projection view contains a to-parent association or a redirection to a parent entity, a provider contract must not be set.



Latest notes:

Further provider contracts are planned to be released in the near future.
NON_V5_HINTS
ABAP_HINT_END

ABAP Addition

What does it do?
Specifies a CDS projection view as transactional query. Transactional queries are intended for modelling the projection layer of a RAP business object. A transactional projection view must always be part of a business object. That means it must either be a root entity itself, or it must be part of a composition tree that contains a root entity.
The feature set focuses on specializing the RAP BO operations of the underlying business object.
The runtime for transactional queries is mainly the RAP query engine, but also the RAP transactional engine.

ABAP_EXAMPLE_VX5
The following CDS projection view defines the provider contract TRANSACTIONAL_QUERY.
DDLS DEMO_CDS_PV_PARENT
Its child entity derives the provider contract from the parent entity. It does not specify a separate provider contract:
DDLS DEMO_CDS_PV_CHILD
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
Specifies a CDS transactional interface. CDS transactional interfaces serve as stable public interface layer in a CDS data model. They are typically used in the context of the ABAP RESTful Application Programming Model to provide the basis for a RAP BO interface. CDS transactional interfaces have a restricted feature set. They only support projecting elements and associations from the projected entity. It is recommended that release contracts C1 and, optionally, also C0 are added.

ABAP_EXAMPLE_VX5
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 are release for system-internal use (C1 Contract).
DDLS DEMO_CDS_TRANS_INTERFACE_ROOT
The following CDS transactional interface represents the child entity:
DDLS DEMO_CDS_TRANS_INTERFACE_CHILD
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
CDS analytical projection views are intended for modelling analytical queries within a CDS data model. An analytical projection view must always be part of an analytical object and the projected entity must be an analytical cube view or an analytical dimension view. The feature set is restricted to the capabilities of the runtime of the analytical engine. The runtime for analytical queries are analytical engines, such as ABAP Analytical Engine or Online Analytical Processing (OLAP).
See also: CDS Projection View, Analytical Queries

ABAP_EXAMPLE_VX5
The following CDS projection view defines the provider contract ANALYTICAL_QUERY.
DDLS DEMO_ANALYTICAL_QUERY
ABAP_EXAMPLE_END

ABAP Alternative 2 ... ${ $}

What does it do?
It is possible, but not recommended, to leave out the provider contract. The default provider contract, if no provider contract is set explicitly , is TRANSACTIONAL_QUERY. The same features are available as for transactional queries and a projection view without provider contract can be used in the same scenarios. However, there are some minor differences in the syntax checks applied. The differences are listed in topic CDS projection view, no contract .