ERPClimb logoERPClimb
Login
All topics
RAP_CDS_ODATAbeginner

CDS Associations

Learn ABAP CDS associations as semantic relationships between entities, including ON conditions, cardinality, path expressions, exposed associations and their effect on generated SQL and consumers. Use this topic to model reusable relationships without confusing associations with free performance gains.

Overview

Learn ABAP CDS associations as semantic relationships between entities, including ON conditions, cardinality, path expressions, exposed associations and their effect on generated SQL and consumers. Use this topic to model reusable relationships without confusing associations with free performance gains.

Lessons in this topic

Interview questions covered

  • What is a CDS association, how is it declared, and how does it differ from a join?
  • A status text association returns duplicate rows in a list. The ON condition is only on the status code. What is wrong and how do you fix it?
  • Explain path expressions: what SQL do they generate, how do filtered paths work, and how are they written in ABAP SQL?
  • A list of orders must show the number of items and total item value per order. How do you model this in CDS without duplicates?
  • How are compositions declared in CDS for a RAP business object, and what must projections do with them?
  • What design rules do you follow for associations in an interface view layer?
  • A universal sales order view uses inner joins to customer, material and plant, and some orders disappear. How would you redesign it?
  • An OData list returns 2,400 rows where the business expects 800. How do you analyze it?
  • Users say a CDS-based report 'lost' some records. What are the possible causes related to associations, and how do you tell them apart?
  • You inherit a CDS model with many associations. What do you review before extending it?

How to study CDS Associations

CDS Associations has 5 lessons (1 beginner, 4 intermediate) with about 40 minutes of reading in total. Start with the lesson that matches your level, then read the real project scenario and common mistakes in each one before moving on. After the lessons, say the 10 interview questions out loud in your own words, then check yourself against the model answer in each question (shown once you open it). Use the 15 mock questions to check recall. Finish with the 1 code lab scenario: read the buggy code first, say what is wrong, and only then open the optimized version.

Mock test questions covered

Try answering each one before you open the mock test; the answer options and scoring are in the Mock Questions tab.

  • A margin report became wrong after a product description was added via a text association without a language condition. Why?
  • Attachments, supplier and approval history were all modeled as compositions of a request. Which should remain a normal association?
  • An OData list returns 2,400 rows where 800 are expected. What is the recommended first step?
  • Which ABAP SQL statement reads the customer name through the association _Customer of ZI_SalesOrder?
  • For an association defined in the base entity of a RAP business object to appear as a navigable OData $expand target in a projection service, what must typically be done in the projection view?
  • What best describes a 'filtered association' in ABAP CDS?
  • A CDS view uses a path expression such as '_Supplier.Country = \'DE\'' inside its WHERE clause. What does this pattern accomplish?
  • In the context of RAP business object modeling, how does a COMPOSITION relationship differ from a plain ASSOCIATION between two CDS entities?
  • Which statement correctly distinguishes an association's ON condition from a general filter condition placed in the view's WHERE clause?
  • In an association ON condition, a source field is referenced with $projection. What must be true?
  • An association is declared [0..1], but the target sometimes has two rows per key. What happens?
  • When an association with cardinality [0..*] is followed in a path expression that is used in an aggregated CDS view (using GROUP BY), what must a developer be careful about?
  • In ABAP CDS, which association declaration restricts the target instance count to at most one, but does not require that a target instance exists?
  • A consumption CDS view declares an association with cardinality [0..*] and then uses REDIRECTED TO on that association pointing to a more specialized projection entity. What is the primary purpose of REDIRECTED TO in this scenario?
  • What is a key conceptual difference between a CDS association and a classic explicit JOIN defined in the FROM clause?

Code lab scenarios

  • Correlated Subquery Instead of an Association in a CDS ViewA CDS view shows each travel with its booking count. It returns correct results but gets noticeably slower as the number of travels grows.

Related topics

Interview questions on this topic