Exposed association is a join-on-demand mechanism in ABAP CDS views where the entire target table is added as a single element to the element list, meaning the SQL join is only constructed when columns from the exposed association are actually used in a query. The key prerequisite is that the key field used for association must be part of the selection list. The main benefits include: (1) ability to use any column of the exposed association in select queries using the syntax 'association_alias.column_name', (2) navigation capability through Eclipse ADT to access associated data, and (3) the ability to create views on top of views that have exposed associations, allowing access to all columns of the underlying table.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
99 - ABAP on HANA - CDS View - Association Types - Exposed Association Part1Added:
Hello everyone, we will continue the topic about on HANA and currently we are covering CDS view and in the last video we started with the concept of association in CDS view. So firstly we covered why why or what is the need of association in CDS view. we covered.
Yes. Whenever you are going for multiple tables, if you have a CDS view which has multiple tables. Yes. At that time we have the join between the tables. Yes.
But there's no way to restrict the join.
Even if you require the data for less tables in a particular scenario but the join condition will execute on all the tables. So to overcome this particular problem SAP introduced the concept of association. What is association? It is just like a join only but it is join demand. Demand means whenever we will fetch the data from a particular table at that time only the join condition or we can say association will trigger between those table for rest of the tables association will not trigger at all and we will get a good performance.
After that we covered the syntax. Yeses how you can go for association. What is the syntax for the same? Suppose we took the example. Suppose we have VBA AK and VBA table. Now you all know previously we used join. Now we are going for association. So what is the syntax for the same? So we have the first table.
Yes, we can say it's a data source. We need to use association to and we are passing the second data source or we can say second table. This cardality is optional. If you don't know what the cardinality you need to pass, just pass one which works in all the scenarios.
After that, yes, we are passing the join condition. This is the element list.
Yes. And this is the alias for VBA. And this is the alias for VBAK. It's optional. If you want to create, you can go. If you want to go for alias, you can create else it is optional. Now before we move on to next topic as a part of association I will go for few terminology here because we will use those terminology. Suppose in this current scenario we have two tables VBA.
So in terms of association how we will go for the various terminology. This is our source association or we can simply say source entity. This is our target association or we can simply say target entity. This is the alias of the source entity or we can say source association.
This is the alias name of the target association or target entity. This is the field. This is the field we on which we are going for join. This is the field of the source association. This is the field of the target association and this is your element list or we can say this is our field list. Now we will proceed further and in this particular video we will start with the types of association or you can simply understand whatever the next four to five videos we will cover based upon this association types of association you you might get lots of questions in the interview from these particular videos only. So we will cover two types of association.
One is exposed association and another one is adog association. Now firstly we will start with exposed association.
Now whenever interviewer is asking just tell us what is the difference between join and association. So you will simply say yes association is join on demand.
Whenever you have the demand at that time only the join will execute else it will not execute or we can say association with execute else it will not execute. Yes. Then the interviewer will ask the next question. Okay. Tell me which type of association is join on demand association. So the answer is exposed association. In the next videos we will also learn that ADOC association is joined on demand or not but as of now we are targeting on exposed association.
So exposed association is completely completely a join on demand association.
Now what is exposed association? What is the generic meaning of exposed? Suppose many times we say yes you are exposed.
You are completely exposed. It means we are able to see the complete picture of that particular person. Same thing is here in case of exposed association.
The entire association is added as a single element into the element list.
We'll simply understand word by word. In case of exposed association, the entire association is added as a single element into the element list.
Just see here we have VBA AK and VBA the entire association. What is the alias for VBA? What is the alias for VBA? It's B. The entire association is added as a single element. Have you seen I added as a single element into the element list. This is your element list. So in case of exposed association the entire association. Yes, this is our association. This is the alias of the target association. So entire association is added as a single element. This is single element into the element list and I have put the comment also exposing an association. So if someone ask you what do you mean by exposing a association?
Exposing a association means we are passing the entire association. We are passing the complete VBA. What is the alias for VBAP? It's B. We are passing the entire association as a single element into the element list. We'll proceed. What is the benefit of the same? Yes. Now whenever we are exposing the association yes we expose this association that's why at the initial level I use the various terminology this is source association this is target association anyways at this point of time we have only two tables so in case of exposed association yes the SQL create statement ment does not create the join close. Just see in this current scenario we have two tables VBA AK VBA but rather than join we have used association and it is your exposed association because the entire association is added as a single element into the element list. entire we have added the entire association. If I will write suppose B dot postnar B domatinar you all know what is postnar or matinar they are the columns of VBA table at that time we are not exposing the entire association and this current scenario we exposed the complete association as a single element complete VBA table whenever you are exposing the association it will not create a join suppose if I will show you if I'm selecting this and I will right click and if I will go for simply simply show SQL create statement this is extremely important part if I will go for this you can see We are not able to see any join.
We have two tables. Yes. VBA ak VBA. But whenever we are seeing the SQL create statement, what is the SQL in the SQL?
We are not able to see the join. Join.
Now at what time join will create?
Whenever we will simply simply use this exposed association at that time only the join will construct. It means whenever we will use the columns of this particular association at that time only the join will construct. It means whenever I will select the columns from this particular association at that time only the join will trigger that's why it is called as join on demand. Have you seen at this point of time we have two tables we have exposed association and I have showed you yes we there is no join at all at this point of time so at what time join will trigger yes join will trigger only whenever I'm using the columns of this particular association so join will only trigger at that point only. Yes. Else join will not trigger or you can say association will not trigger. Yes. So that's why it is called as join on demand. Now I will move on to next part.
You can see join will only only construct whenever the consumer will use this exposed association. Now that's why it is called as join on demand. Now we have the next thing. Whenever you are going for exposed association, what is the prerequisite?
The key field which we used to associate must be the part of selection. See this is your selection. This is your selection. And which key field you used to ex you used to associate? Which key field we used to associate? VBN VB AK VBN we used to associate. So this must be the part of your selection. And suppose if I'm not selecting this, if I'm commenting this, if I'm commenting, system will simply simply give me the error. Suppose if I'm commenting this, I'm sorry.
Suppose I'm commenting this. So I will simply get a error. Yes, the column is not in the selection list. So what is the prerequisite? Anyone can ask okay you worked on exposed association then tell us what is the prerequisite of the same. So the answer is yes the key column which you are using for association must be the part of your selection list.
Now I will come on to the next point and so many things will be covered automatically or clear. Now what is the next thing? Why why exposed association is powerful and how it is helpful. So in case of exposed association we can use any column of the exposed association in the select query using the prefix backslash with the association name. The first most important benefit of exposed association is we can use any column of the exposed association in the select query. Suppose just see this particular CDS view. We exposed this association.
But we expose this association means we exposed this BBA. Have you seen whenever I'm writing a select query I'm able to use the postnar column and how how I use the post postnar column I need to use backslash what is the association name or we can say what is our alias for the target association name B and we are simply specifying post now just see we exposed the entire higher association and VBA table has so many columns. I can use any column in the select list.
Whenever I will use any column in the select list at that time only the join will trigger association will trigger else it will not trigger at all. That's why it is called as join on demand. So the bus first benefit of exposed association is you can use any column of the exposed association in the select query. Then interviewer will ask okay just tell us how you use the column of the exposed association. The answer is backlash association name and hyphen but the column you want to use association name is I'm talking about alias. Yes. Now we will go for next most important benefit and I will show you also from the Eclipse add itself we can navigate to association. This will give you guaranteed 100% clarity. Anyways we need to go for practical. In this video we are just covering the theory part.
Suppose I'm running this particular CDS view.
I'm running this particular CDS view.
I'll just run. Okay. Firstly, I will activate. Suppose there's some change.
This is activated. Now I will run. Most important part.
I run this. Have you seen we are only able to see the columns of VBAK VBAK table. This is what it is join on demand. Yes, at that time join has not triggered association has not triggered because we are not going for any column of VBA nothing. So suppose now I want to go for association I want to go for VBA column now. So how how I will do? I'm doing this through Eclipse AD only.
Suppose for this particular 34 I'm going for follow association. Now I'm going for association. So it means at this point of time only the association will trigger else it is not triggering. That's why it is called as join on demand. At this point of time now I'm requesting for VBA.
If I'm going for association if I will go for double click you can see for 34 number sales order now I'm able to see the item data all columns of VBAs VBAN post matina you all know this is your VBA. So the most important benefit of exposed association is from the ADT itself you can go for the navigation of the association and just now I showed you the navigation. Now third thing suppose we are creating another CDS view. Suppose I'm creating another CDS view using this particular CDS view.
Have you seen in this particular CDS view we have a exposed association suppose I'm using this CDS view and I'm creating another CDS view you can see into this particular CDS view I'm using this CDS view whenever I'm using this CDS view have you seen I'm able to I'm able to go for all columns of the VBA table. I just put this particular view name dot B. What is B? B is your VBA. It means into this particular view I'm able to go for all columns of the VBA table. So this is called as view on top of another view. Just see how important it is. You created one view, you have a exposed association. It means you have the all the columns of that particular table. Suppose if you are creating another view and using that particular view, it means all column you can access into that particular view also. Suppose if I'm running this particular view if I'm running you will be able to see we have this VBN suppose now I'm going for exposing sorry we are going for association have you seen the same thing we are able to do into this particular view also so what is the third most important benefit serious view define on the basis of the view that expose the association. It means we are defining another view using a view which has the exposed association can also use any column of the exposed association. This is simply defining view on top of other views. So what is the summary of this particular video? In this video we started with first type of association that is exposed association and you can simply understand you might face so many questions in the next you might face so many questions in the interview whatever we are covering so far and in this particular video I just explained the theory part of the exposed association when practical will be there in the next video. You will get more clarity.
Now in case of exposed association, we are exposing the entire association.
Entire means complete full. We are exposing the entire association as a single element into the element list. We have exposed the complete association entire association it means complete BBA table whenever you are going for exposing an association exposed association it is completely a join on demand because I simply selected and showed you this create statement also SQL create there's no join as of now because We are not using any column of this VBA table as of now. After that I show you yes it is completely completely a joined on demand and this is how it is joined on demand. After that what is the prerequisite? Whenever you are going for exposing an association, the key field which we used to associate must be the part of selection.
This key field of VBAK, this key field which we are using to associate, we are asserting which particular table VBA must be the part of selection. And I showed you also if you are not using system will simply give the error. After that what are the important advantages you can tell the interviews. In case of exposed association you can use any column of the exposed association in the select query. You just need to pass back slash association name whatever the column you want to use hyphen that column name. Association name is we are talking about alias. Second most important advantage you can tell to the interviewer that from Eclipse add itself I can navigate to association and I showed you also first time. Yes only VBAK column then I showed you the association. Yes. Third most important advantage you can say yes. Suppose if you are creating another view and you are using that view which has the exposed association the same columns of the exposed association you can use in this view also. So it is just mean you are simply creating a view on top of other views. Now in the next video we will go for practical part. We'll do the practical of exposed association. Then we will come on to adop association.
Extremely extremely important video from the interview perspective. So that's it in this video. Thank you.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 viewsโข2026-05-28
How agent o11y differs from traditional o11y โ Phil Hetzel, Braintrust
aiDotEngineer
450 viewsโข2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation๐ฏโ
LearnwithSahera
1K viewsโข2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 viewsโข2026-05-29
Search Algorithms Explained in 60 Seconds! ๐ค๐จ
samarthtuliofficial
218 viewsโข2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 viewsโข2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 viewsโข2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 viewsโข2026-06-01











