In CDS views with exposed associations, the system implements join on demand, meaning no join is executed when only base table columns are requested, but a LEFT OUTER JOIN is automatically triggered when columns from the exposed association are accessed using the syntax 'association_name\column_name', as demonstrated through SQL trace analysis in ST05 transaction code.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
101 - ABAP on HANA - CDS View - Types of Association - Exposed Association Part3Added:
Hello everyone. We will continue that topic about on Hana and currently we are covering CDS view and in the last few videos we started with the concept of associations in CDS view. So firstly we understood what association is, what is the need of the association, what is the syntax of the association. We covered the types of association and in the last two videos we started with exposed association.
Yes, exposed association is completely completely join on demand. We understood the meaning of each and every point of the exposed association and in the last video we started with the practical part of that same. And as a part of that we took two tables VBAK VBAP.
The complete association, the entire association is added as a single element into the selection list or we can say element list. Then I simply executed this CDS view. We are able to see the output from VBAK table. The best part is in Eclipse ADT itself you can navigate to the association and I show you that part also. Now we will further dig down into that topic. I will go to SAP GUI.
I will create a program. In that program firstly I will fetch the data or I will say I'll say I will go for that data of V B A K. See, here in this particular CDS view, yes, we have the columns of V B A K and V B A P is entirely exposed.
We expose this association. So, in the first scenario, I will go for that data only of V B A K. Then, I will go for V B A K V B A P both and I will show you. In the first case, there is no join, but in the second case, there will be a join because it is join on demand. So, simple thing, you will further get a more detailed understanding how internally system is going for join on demand. So, I will create a program.
I will go to SC38 transaction code.
This is our demo eight program.
Yes.
I will go to create.
I will give the title to the program.
To display the sales order details.
I'll go for type as executable program.
I will save into package.
I'll save into transport request.
Now, I will write a select query.
First scenario, I will only go for V B A K column so that I can show you that there is no join in that case.
Because this is our base of that topic itself, join on demand.
To overcome the limit to overcome that disadvantages of the join is we have a concept of association.
I'm writing select. Suppose I will go for VBELN ERDAT. I'm going for two columns.
From This is our name of the CDS view.
We have only one artifact that is our actual CDS view.
Into table.
@data LT_DATA.
You all know in new syntax the column names are separated by comma.
Now, I will simply display.
I will go to a back object patterns.
Sorry, there is no instance.
This is our class.
And I will go for method display.
Yes, I will simply uncomment.
This is our internal table.
I will activate this program.
So, first scenario only VBAK column.
Now, I will simply simply activate the SQL trace. You all know we have a transaction code ST05.
If you do not have knowledge of the same, no problem. Whatever is required at this point of time, I will explain that part. If you want a more detailed understanding, you can learn from performance tools playlist.
This is our ST05 transaction code.
And the SQL trace check box is activated. I'm firstly activating that trace.
So, I activated that trace.
That trace is activated for my ID 920.
Why I'm noting the name? So, if required, I can filter this based upon time.
So, 920.
I'm running this program. I activated that trace.
Now, whatever I will do at this point of time, it will be simply simply traced by SAP. The trace will simply simply or capture all these things, whatever I'm doing.
I'm going for run.
And this SQL query, yes, system will capture.
I'm running.
Two columns, yes.
Now, I'm deactivating that trace.
So, in between this activate and deactivate, whatever the SQL queries are executed, system will simply will simply show me, yes.
I will go for display trace.
Yes, 920 to 921. Okay, we'll go for this time.
And your system will show by default.
Now, I will filter based upon program name because that is good because I need to check for my program.
This is our I will go for okay.
Now you can see this is our CDS view. We have a select query from the CDS view. But if I will show you the statement have you seen this no join at all? Yes.
See, if you are going for association concept in the first scenario, we are only going for VBAK, then why why join should execute and it is performance effective. But if rather than association, you are going for join you are going for VBAK columns only, but still still system will show you the join here. Yes, because system will execute the join on multiple tables and performance will be limited at that point of time because CDS view will not give the desired result in less interval of time. Yes. So now you can see there's no join at all. Yes. Now we will go for next scenario and I will show you join on BP.
Now. Now I will go for BPAP. Now you all know BPAP completely is exposed entire association is exposed. How you can refer to the columns of the exposed association? I mentioned in the slide also. How how? You have to go for backslash. It is mentioned. Yes.
You have to go for backslash.
backslash and what is the prefix?
backslash Then you need to simply simply go for association name. What is our association name? We provide underscore B if you remember alias name underscore B.
Is our association name S 4 V B A P.
Now, suppose I want to go for post not column.
Anyone can ask in that interview yes, this is one of the important question.
Okay, you are saying you exposed the association, but how do you refer the columns of the exposed association while writing the SQL query? Simple answer is you have used backslash name of the association then hyphen whatever the column because we can refer to any column. Suppose now I will go for mat in our column.
Suppose this is mat in our column.
I will check the syntax.
Now I will activate.
Now you can see we are going for V B A K V B A P both both. Now join should trigger. Ideally it should trigger now.
Yes, it should trigger because it is join on demand.
Now I will go for the activation of that trace again.
Because I need to go now activate that trace and deactivate.
I'm activating that trace.
Yes, 925 for my user ID.
Now I'm running this particular program.
Now you can see V B A P S post not mat in our.
Now I will deactivate that trace.
Now I will display that trace.
Yes, 925 we'll go from there.
I will filter based upon my program name.
Now you can see we have the CDS view, yes.
Now if I will show you this.
Now you can see we have a join here now.
You can see we are going for select VBELN ERDAT, POSNR, MATNR from this. Have you seen left outer join is mentioned, yes.
This is join on demand, yes, and this is what we want, yes. This is what we want in terms of association. So what is the summary of this particular video? In this video we further dig down into that topic, yes. Firstly, I took the columns only for VBAK table. I activated that trace, I deactivated that trace, and I showed you we have only only single we only have that select query, but there is no join at all. We are have a select query for VBAK only in the CDS view, yes, we have VBAK, yes. After that, yes, what I did, I simply specified the columns of VBAK. How you will specify the columns of VBAK?
backslash your association name, whatever the association you name you provided, yes.
Hyphen what is the column name you want to take, yes. I specified two columns, I activated that trace, deactivated that trace, I run that program again, then I showed you we are able to see that join here, and this is completely completely a join on demand. Now in the next video we'll further dig down into this particular topic, and you can simply understand it is one of the topic in which interviewer can ask any number of questions based upon the answers which you are providing. Yes. 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











