Rule Definition
When two CDS views refer to each other through a call, the result is a circular dependency. Neither CDS views can function without the other, and so neither is reusable without the other. This can cause unpredictable behaviors.
Redesign May eliminate these dependencies to prevent problems during activation.
Remediation
If there are circular relationships among CDS VIEWS, the partitioning is not clear and should be redesigned.
Violation Code Sample
@AbapCatalog.sqlViewName: 'TEST1'
define view test_view1 as
select from
test_view2
{ * }
@AbapCatalog.sqlViewName: 'TEST2'
define view test_view2 as
select from
test_view1
{ * }
-----------------------------------
@AbapCatalog.sqlViewName: 'TEST1'
define view test_view1 as
select from
table1
association to test_view2 as _assoc1
on table1.field = _assoc1.field
{ _assoc1,
field }
@AbapCatalog.sqlViewName: 'TEST2'
define view test_view2 as
select from
table2
association to test_view3 as _assoc2
on table2.field = _assoc2.field
{ _assoc2,
field }
@AbapCatalog.sqlViewName: 'TEST3'
define view test_view3 as
select from
test_view1
{ _assoc1.field }
Reference
https://www.sap.com/documents/2019/01/0e6d5904-367d-0010-87a3-c30de2ffd8ff.html
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenddic_cds_cycle_problems.htm
Related Technologies
Technical Criterion
Architecture - Multi-Layers and Data Access
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.