Association in cds view abap CDS Part 9 ABAP on HANA Course

SAP TECHNOMANIAC
8 Jul 202218:41

Summary

TLDRIn this video, the speaker explains the concept of associations in SAP and how they differ from joins. They demonstrate creating a CDS view using associations, replacing a left outer join, and discuss the advantages, such as lazy loading and efficiency in data modeling. The video covers cardinality between tables, ad hoc and exposed associations, and how associations work in data retrieval without forming joins until necessary. The speaker also explores SQL execution plans, showing when and how joins occur. Finally, they preview future topics like using associations in WHERE conditions and advanced cardinality scenarios.

Takeaways

  • 😀 Associations in CDS views establish a relationship between the source and target entities, similar to joins but with distinct differences.
  • 📊 Joins in data models form a relationship between source and target entities, but associations act as 'lazy joins,' only executing when needed.
  • 📝 Cardinality in associations defines the relationship between the source and target, such as one-to-many or one-to-one relationships.
  • 🔄 In this example, a sales order can have multiple line items, represented by a one-to-many (1..n) cardinality between tables VBAK (header) and VBAP (line items).
  • 💡 Associations are preferred over joins because they only activate when fields from the associated target entity are accessed, optimizing performance.
  • 🔍 The example replaces a left outer join with an association, demonstrating how the system understands fields from the source entity without needing specific field references.
  • 📊 SAP recommends prefixing association names with an underscore (_) to easily distinguish associations from other fields in SQL queries.
  • 🛠️ There are two types of associations: ad-hoc (used directly within the CDS view) and exposed (used when accessed in other CDS views or SQL queries).
  • 🚀 Exposed associations allow for flexible data retrieval across CDS views, enabling access to associated data without immediately forming a join.
  • 🧩 Using associations in a where condition requires additional understanding, as the join only occurs when the associated fields are accessed, referred to as 'join on demand.'

Q & A

  • What is an association in CDS views?

    -An association in CDS views represents a relationship between a source entity and a target entity, which can be a table, view, or another CDS entity. Associations are similar to joins but with key differences, like being 'lazy' or 'join on demand,' meaning they are not executed unless necessary.

  • How does an association differ from a join?

    -A key difference is that associations are 'lazy' or 'join on demand,' meaning the join will only form if fields from the target entity are accessed. In contrast, a join forms immediately when the tables are linked. This allows for optimized data retrieval in associations.

  • What is the importance of cardinality in an association?

    -Cardinality defines the relationship between the source and target entities. For example, in a 1-to-n cardinality, one record in the source entity can relate to many records in the target entity. This relationship is critical in defining how data is fetched between associated tables.

  • What are ad hoc and exposed associations?

    -Ad hoc associations are used directly in the select list or where clause, triggering a join immediately. Exposed associations are defined but not accessed, so they do not form a join unless accessed by another view or query. They are used for flexibility and deferred joins.

  • What happens if you don’t access fields from an association?

    -If you do not access any fields from the association, no join is formed, meaning the system will only fetch data from the source entity. This lazy loading of associations helps optimize performance by avoiding unnecessary joins.

  • Why does SAP recommend using an underscore before the association name?

    -SAP recommends using an underscore before the association name to easily identify that the association is being used in the CDS view. This naming convention helps differentiate between simple fields and fields coming from an association.

  • What is a path expression in an association?

    -A path expression in an association is the syntax used to access fields from the associated entity. For example, 'sourceEntity.association.field' allows you to access the 'field' from the associated target entity.

  • How do associations behave in a program when data is accessed?

    -When accessing data in a program from an association, the system forms the join only if you access fields from the associated entity. If you only retrieve data from the source entity, the join is not formed, optimizing performance.

  • What are the two types of association in CDS views?

    -The two types of association are ad hoc and exposed. Ad hoc associations are used directly in a select list or where clause, immediately forming a join. Exposed associations are defined but not used until accessed later, keeping the join deferred.

  • What does 'join on demand' mean in CDS views?

    -'Join on demand' means that the join between the source and target entities only forms when fields from the target entity are accessed. This feature of associations helps avoid unnecessary joins and improves query performance.

Outlines

00:00

👋 Introduction to Associations in SAP

The video begins with an introduction to associations in SAP. It explains how associations differ from joins, specifically left outer joins. The speaker introduces the concept of a CDS view and plans to demonstrate how associations work by replacing a left outer join with an association. The goal is to highlight how associations behave differently from joins when used in reports, particularly with sales order data.

05:01

🔗 Defining Associations and Cardinality

This section explains the fundamentals of associations, defining them as relationships between source and target entities, which can be tables, views, or entities. The speaker explains the concept of cardinality, specifically the 1-to-n relationship between sales order headers and line items, and how associations define these relationships. Associations are described as 'lazy joins,' which differ from traditional joins by executing only when needed.

10:02

💡 The Benefits of Associations Over Joins

Here, the speaker explains the flexibility of associations compared to left outer joins. They show how associations allow more efficient queries by only accessing necessary fields. Unlike joins, where specific fields must be mandatorily referenced, associations don’t require specifying the source entity in the select list. This flexibility makes associations more dynamic and reduces query overhead.

15:06

📊 SQL Query Differences: Associations vs. Joins

This paragraph compares how SQL queries are generated when using associations versus joins. The speaker demonstrates that with associations, the join is only formed when fields from the associated entity are used, unlike with left outer joins where the join always forms. Two types of associations are introduced: ad hoc and exposed associations, with recommendations on naming conventions to differentiate them from standard fields.

🔄 How Associations Are Accessed in CDS Views

The focus here is on how to use associations in CDS views and how associations behave similarly to left outer joins when data is accessed from both entities. The speaker walks through the process of accessing data from an association and how using fields from the associated entity triggers the join. This paragraph introduces the concept of 'path expressions' to access data from associated entities.

⚙️ Exposed Associations and 'Join on Demand'

This section covers the concept of exposed associations, where the join only occurs when fields from the associated entity are accessed, leading to the 'join on demand' behavior. The speaker demonstrates that if no fields from the associated entity are used, no join is formed. This behavior optimizes performance by avoiding unnecessary joins until needed.

🧪 Testing Associations in a Program

The speaker transitions to testing the association within a report program. They show that when only fields from the header table are accessed, no join is formed, confirming the lazy join behavior of associations. By enabling SQL trace, the speaker checks whether the join is formed, revealing that it is not unless fields from the line items are accessed.

🔍 Exploring Join Formation and Execution Plan

In this paragraph, the speaker demonstrates how, after accessing fields from the associated entity (line items), the join is formed. They explain how the SQL trace and execution plan show the join between the header and line item tables. The paragraph concludes by reiterating that associations allow 'join on demand' functionality, which optimizes query execution based on the data accessed.

📖 Summary and Next Steps in Understanding Associations

The video wraps up with a recap of the key points about associations, particularly how they differ from joins, their 'lazy join' nature, and how they are used in CDS views. The speaker hints at the next video, which will cover more advanced topics, including using associations in WHERE conditions and how cardinality impacts their behavior. They also encourage viewers to like, subscribe, and share the content.

Mindmap

Keywords

💡Association

In the context of this video, an association refers to the relationship between two data entities, such as tables or views, in SAP CDS (Core Data Services). Unlike joins, associations are 'lazy', meaning they only form relationships when necessary (on-demand). This allows for more efficient data retrieval in certain cases. Associations can be either ad-hoc or exposed, depending on their usage in a CDS view.

💡Join

A join is a SQL operation used to combine rows from two or more tables based on a related column. In the video, joins are compared to associations, which serve a similar purpose but behave differently. For example, a left outer join always forms a relationship between two tables, while an association only forms when data from the related table is explicitly accessed.

💡Cardinality

Cardinality defines the relationship between entities, specifically how many entries in one table (source) relate to entries in another table (target). In the video, the example is given of a sales order (header) and line items, where one sales order may have many line items, hence a cardinality of '1 to n'. This concept is important for understanding how associations function in SAP CDS.

💡Lazy Join

Lazy join, in the context of associations, means that the join between two entities does not occur until it is needed. The video explains that associations behave this way, only forming when data from the target entity is accessed, unlike traditional joins that form immediately. This concept highlights the efficiency of associations in certain data modeling scenarios.

💡Ad-hoc Association

An ad-hoc association refers to an association that is defined and used directly within a CDS view’s select list or where clause. It behaves similarly to a traditional join, forming when needed based on the query. In the video, this is demonstrated by selecting fields directly from the associated entity to form the join.

💡Exposed Association

An exposed association is one that is defined in a CDS view but not immediately used in the query. The join only forms when the association is accessed in another CDS view or SQL query. The video explains that this type of association is efficient because it doesn't form unnecessary joins until data from the related entity is explicitly required.

💡Path Expression

A path expression in SAP CDS is the syntax used to access fields from an association. The video illustrates this concept by showing how fields from the associated entity are accessed using the association's name followed by a dot (.) and the field name. Path expressions are crucial for retrieving data from associations.

💡Left Outer Join

A left outer join is a type of SQL join that returns all records from the left table and the matched records from the right table. In cases where there is no match, NULL values are returned for the right table's columns. The video compares this with associations, explaining how an association can be used to achieve a similar result but with potentially better performance.

💡SQL Create Statement

An SQL Create Statement in the context of the video refers to the SQL code generated when a CDS view is activated. This statement shows how the associations or joins are handled in the background. The video demonstrates this by showing how a different SQL create statement is formed when using associations versus traditional joins.

💡Where Condition

The where condition is used in SQL queries to filter data based on specific criteria. The video mentions that associations can also be used in where conditions to form joins on demand, depending on the fields accessed. This adds flexibility and efficiency in querying data from multiple entities in SAP CDS.

Highlights

Introduction to associations and how they differ from joins in SAP CDS views.

Associations are referred to as 'lazy joins' as they do not execute unless explicitly accessed.

The importance of cardinality in defining the relationship between source and target entities.

Example of replacing a left outer join with an association to improve data modeling efficiency.

Associations can be used with various entities such as tables, DDIC, CDS views, and normal views.

SAP recommends using an underscore before association names for clarity in SQL or CDS views.

Ad hoc associations are triggered when fields from the target entity are accessed in the CDS view.

Exposed associations allow associations to be exposed without forming a join unless the data is accessed.

Associations are join-on-demand, meaning they only execute when a field from the target entity is explicitly used.

Demonstration of creating a CDS view with an association, replacing a left outer join, and executing in a report program.

Understanding of SQL create statement to view native SQL query formed using associations.

Associations can form left outer joins by default, with specific scenarios triggering inner joins.

Explanation of path expressions used to access fields from associations, critical for join formation.

Utilizing ST05 trace to analyze execution plans and verify if joins are formed with associations.

Preview of the next video focusing on associations used in WHERE conditions, cardinality, and join formation specifics.

Transcripts

play00:00

hello everyone welcome to sap techno

play00:02

maniac in this video we will learn about

play00:04

the association we'll talk what is the

play00:07

association and how it is different from

play00:09

the joints and what are the types of the

play00:11

association

play00:13

we will create one cdsu with this

play00:15

association and we will try to call this

play00:17

particular cds view in one of our report

play00:20

program and we will see how it is

play00:23

behaving different differently with the

play00:24

different different kind of association

play00:26

let's get started

play00:29

to understand the association i will use

play00:31

same cds entity which we have created in

play00:34

my last video

play00:36

so in my last video we we saw how left

play00:39

outer join work with the too many and

play00:41

two one so we we were having the short

play00:44

stable as a vba k and we were doing the

play00:46

left outer join with the vbap

play00:48

in this video we will replace this left

play00:51

outer zone with the association

play00:53

then first thing what is this

play00:54

association

play00:56

association is the relationship between

play00:58

the source

play01:00

entity i can say source entity and it

play01:03

can be anything like the table it can be

play01:05

ddic cds view it can be cds entity it

play01:08

can be normal view

play01:10

anything it can be and the

play01:12

target it's a relationship between the

play01:14

source entity and the target entity

play01:17

but the zone also doing the same thing

play01:19

it's also relations between the source

play01:21

and target entity but there is a

play01:24

minor difference i can tell but it due

play01:27

to this minor difference we can achieve

play01:29

a lot of things in our

play01:32

in in our data modeling i can say

play01:35

so what is that minor difference the

play01:37

associations are

play01:40

or we can say it is

play01:42

lazy zoin

play01:44

so how it will work to understand this

play01:46

first we will see in the system itself

play01:48

so uh what i will do i will replace this

play01:50

left outer join with the association so

play01:54

instead of using the left outer join i

play01:56

will use association to use association

play01:58

you have to use association keyword then

play02:00

you have to give the cardinality

play02:02

so the cardinality basically it is the

play02:05

relationship between the source and

play02:07

target it always talks about the time

play02:11

currently the relationship between the

play02:13

sales order and sales of the header

play02:15

table and line and line item table is

play02:17

like that

play02:18

the header table for one entry in the

play02:20

header table that can be the end number

play02:22

of entry in the line item table and

play02:24

number means it can be one day entry or

play02:26

it can be two three and up to n number

play02:29

any number can be the

play02:31

entries in the vba because one sales

play02:33

order can have the n number of line item

play02:35

but at least one line item will be there

play02:37

in the sales order so cardinality should

play02:39

so in this case it should be one to star

play02:43

so it is telling that in the

play02:46

how many line item can be there for one

play02:48

entry in the

play02:49

vba table

play02:51

how many lines from in the vbap table

play02:53

will be there for one entry in the vba

play02:55

table so it's a cardinality defines for

play02:58

the target only here not for the source

play03:02

so you can see the cardinality then we

play03:04

have to define

play03:05

this we have to define association to

play03:07

this particular vbap and we have to give

play03:10

some on condition what is the condition

play03:12

that same is it how we are doing in the

play03:15

zone only

play03:17

so i what i did

play03:19

instead of using the left outer join i'm

play03:21

using simple association i have given

play03:23

the cardinality what is the relationship

play03:25

between the source and target entity and

play03:27

i have given the condition and i'm using

play03:30

some of the fills from this particular

play03:34

particular

play03:36

table means first shows entity not i'm

play03:39

not using

play03:40

any fill from the target entity i'm only

play03:43

using the fields from the source entity

play03:45

so you can see

play03:46

so one more thing i just want to add

play03:48

over here if you don't use this alias

play03:51

name here and you try to access this

play03:55

particular sales order and kuna directly

play03:57

you can access directly but in the in

play03:59

case of the join we have to define

play04:01

mandatory if you are using vba here so

play04:03

we have to define vba dot mandatorily

play04:06

but here for the

play04:08

source entity it is not mandatory to use

play04:11

the particular

play04:15

in the control here it's mandatory but

play04:18

in the select spell list we no need to

play04:20

define that where we are getting from it

play04:23

it is it system will understand by

play04:25

default you are getting from the short

play04:27

entity this particular two fields so as

play04:29

of now i go to the

play04:31

this particular two fields from the vba

play04:34

let me activate this cds view

play04:37

and let me see what will be the

play04:40

code will be executed in the native form

play04:42

native hana phone what is the code got

play04:45

executed to create this particular uh

play04:48

cds view so to see this we have to right

play04:51

click and create so as

play04:54

sql create statement so in this c in

play04:56

this statement you can see

play04:58

it's a simple s it's a simple select

play05:00

like statement where we are getting the

play05:02

data uh where we are getting only the

play05:05

vbl and kuna it's added one mandate

play05:08

client field additional and there is no

play05:10

vbap table at all here but instead of

play05:13

this if i would have used the inner zone

play05:16

left outer zone here and i left

play05:20

outer join

play05:26

in this case you can see now

play05:28

it's mandatory to give here we have to

play05:30

give the vba k dot where it is coming

play05:32

from

play05:34

otherwise it is giving me error so

play05:36

that's okay but now i will see this sql

play05:39

create statement then you will see

play05:42

the zoning

play05:43

happen we we have we are not only

play05:46

hitting the vba table to create this

play05:48

statement we are hitting the vbap table

play05:50

as well and we are creating the zone

play05:53

this particular based on the sales order

play05:55

but in the case of the association it

play05:57

didn't happen

play05:58

so

play05:59

here i want to tell there is a two kind

play06:01

of association

play06:03

so first is the

play06:04

ad hoc association and second is the

play06:07

exposed association we will call this

play06:09

association name is item underscore item

play06:12

so sfp recommend

play06:14

us to use underscore before the

play06:16

association name

play06:18

because whenever we will use this

play06:20

particular association in another cds

play06:22

view or

play06:24

sql statement

play06:26

then we can easily understand this is

play06:28

coming from the association not from the

play06:29

simple simple field list to

play06:31

differentiate between them we should use

play06:34

this underscore and asset recommend us

play06:37

to use underscore

play06:38

with the association name

play06:41

so you can see uh i didn't use here any

play06:43

other field

play06:44

so if i want to use now this field here

play06:48

control v

play06:49

dot

play06:51

before that let me replace again with

play06:53

this association

play06:56

and let me tell this association one to

play06:58

start

play07:00

association two with vbap

play07:03

and in this case what i will do i will

play07:05

get some field instead of the previously

play07:07

i didn't get some filled then i saw the

play07:10

sql query statement and in that case

play07:13

what i was getting there there was no

play07:15

vbap at all but as soon as i get some

play07:17

filled from here control c

play07:21

control v dot poisoner i get

play07:24

as soon as as soon as i got some field

play07:27

from this particular

play07:29

association and if i try to see the sql

play07:32

statement

play07:33

it will form a zone that is laughed

play07:36

after joined so you can see

play07:39

most of the time association from the

play07:41

left of the join there are some of some

play07:42

other scenario there are the sum of

play07:44

scenario which i will explain

play07:46

it will form

play07:47

in a zone as well we have either we have

play07:49

to convert that left outer zone to inner

play07:51

join and if we access this particular

play07:54

cds entity in another cds directly is a

play07:57

source that time also it will form in a

play07:59

zone that we will see

play08:01

but before seeing that first thing

play08:04

normally whenever we are creating the

play08:06

association it converted into the left

play08:08

outer zone so obviously the relationship

play08:10

between table like that one to n so it

play08:12

will form the left outer zone and we

play08:15

will get the some data not only from the

play08:17

vba table and we will get some data from

play08:20

the item table let me activate this one

play08:22

control f3 and do the

play08:25

affect to see the data how the data is

play08:27

coming from this particular association

play08:30

so you can see

play08:32

uh we we go to the data header data

play08:35

sales order owner and this from the

play08:38

line item this is working like a zone

play08:40

only if i use left outer join the same

play08:42

result i will get but there is one

play08:44

important thing over here

play08:46

this is azo now whatever i have

play08:48

explained this is called the ad hoc

play08:50

association advance means we have

play08:52

whatever the

play08:53

association which we have defined in the

play08:55

cds view which we have used in this

play08:58

particular

play08:59

filled list or we can use in where

play09:01

condition as well that also i will

play09:03

explain when to use and what is the all

play09:05

are the condition to use in the where

play09:07

condition this particular association

play09:09

before that

play09:11

if i will use

play09:13

i will not use any field from this

play09:16

particular association and just i will

play09:18

give the association name in the filled

play09:21

list

play09:22

and i will activate this one and now i

play09:25

will try to see this particular sql

play09:28

create statement

play09:33

so you can see

play09:35

we we have used the association name but

play09:38

we didn't access any field from this

play09:40

particular association

play09:42

then the zone didn't form at all so that

play09:45

is the reason we call the association

play09:47

join on demand

play09:49

until and unless we will not access any

play09:52

field from this particular association

play09:55

the join will be not formed

play09:58

so join how to access the uh access to

play10:01

any field from the particular assertion

play10:03

using the dot we have to give the path

play10:05

expression whatever we will do after

play10:07

this dot and blah blah blah some fill

play10:09

value if you are using some other

play10:11

association then field value

play10:13

this particular thing called the path

play10:16

expression if you read asset standard

play10:18

documentation it will help sometimes we

play10:20

will not understand what is the path

play10:21

expression it is the whatever we are

play10:23

giving after dot we are getting that

play10:26

particular failed value it might be that

play10:27

we have another association then another

play10:29

association then the field value like

play10:31

that this particular thing is called

play10:33

this chain is called the path expression

play10:35

this also we will see but basically

play10:38

if i am not accessing this particular

play10:40

field in this particular select list

play10:43

the join is not forming and this this

play10:46

particular association is called exposed

play10:49

association we are exposing this

play10:51

particular association

play10:53

so that whenever this particular cdhvu

play10:56

is called in some other select statement

play10:59

or

play11:00

in some other cdsu we can use the fields

play11:03

from this particular association and as

play11:06

soon as we will use the fields from this

play11:08

select statement then zone will form so

play11:11

that is the reason

play11:12

this association is called join on

play11:15

demand

play11:16

so what i will do now

play11:18

let me activate this one control f3

play11:22

and let me execute and see the data

play11:24

again

play11:33

if you see we got the two data

play11:35

but

play11:36

in the data preview also we can still

play11:38

see the associated data i want to see

play11:40

the association associated data with the

play11:43

this particular sales order what you

play11:44

have to do you have to right click on

play11:46

that and you have to click on the follow

play11:48

association so how many associations are

play11:50

there is up now we have only one

play11:51

association if we have multiple

play11:53

association it will give all the options

play11:55

so one to start i just double click on

play11:57

that so it will give much give me the so

play12:00

11 number size order what a large the

play12:02

line item is there the query will be

play12:03

executed so you can see for this sales

play12:06

order we have two line item

play12:08

10 and 20 line items are there so i got

play12:11

the data from the association itself so

play12:14

let me call this particular

play12:16

cdsu entity one in the my one of the

play12:19

program

play12:20

and see how this particular

play12:22

association is behaving when we are

play12:25

accessing the data from this association

play12:28

and when we are not accessing the data

play12:30

from this association so i have already

play12:33

programmed like

play12:34

which we have created in my last video

play12:37

so we'll use same program

play12:40

let me open it here itself

play12:43

so what i will do instead of getting all

play12:45

the data first i will get only sales

play12:48

order and vba key

play12:55

so in this case i am getting only two

play12:56

field let me see

play12:59

in the back end what native sql query

play13:01

got executed and the the join formed or

play13:05

not when i'm accessing the data from

play13:07

this particular thing when we did the

play13:09

left outer join the join form because

play13:12

because of one to n relationship between

play13:13

the table the join form if you've

play13:15

watched my last video you already know

play13:17

what is one to n and n to one relations

play13:20

relationship when we are using the left

play13:21

outer one so if the table relationship

play13:24

between

play13:25

the

play13:25

left hand side and right hand side table

play13:27

one two and and we are using the

play13:30

in left outer join in that case the join

play13:33

always forms but in this case we use the

play13:36

association instead of using the

play13:39

zoin and the relationship between the

play13:41

table is 1 to n so what will happen i

play13:44

and the one more important thing i am

play13:46

not accessing the data from the item

play13:47

table let me activate this one control

play13:50

f3

play13:53

and do

play13:54

f9

play13:57

obviously i will get the data i know i'm

play13:59

not interested in the data i just want

play14:01

to activate the st05 trace

play14:04

and see

play14:05

activate trace this with the filter

play14:09

and let me give this particular program

play14:11

name

play14:12

and the activate the trace

play14:15

and let me execute this program now

play14:20

f9

play14:23

and deactivate the trace

play14:27

and display this particular trace

play14:31

execute it

play14:33

and the select this particular we have

play14:36

called this program only and inside this

play14:38

program we call this consumption view

play14:40

and we want to see the execution plan

play14:43

so you can click on that and you can see

play14:45

the execution plan so you you can see

play14:48

join didn't form because we didn't get

play14:50

the data from the

play14:52

item table but in case of laughed out as

play14:54

one the join formed

play14:56

but what i will do now

play15:05

and

play15:06

since the join didn't form

play15:09

we didn't get any data from vb ap table

play15:12

and for each

play15:13

vba table if i do f9 again and see the

play15:17

console result there is a no duplicate

play15:20

entries for the sales order which we are

play15:22

having the multiple line item but now

play15:25

what i will do i will access the data

play15:27

from this particular association how to

play15:29

access the data

play15:31

from the association you have to use

play15:36

backwards sorry and you have to do

play15:38

control space

play15:39

before that the comma should be there

play15:44

and there it will show you the there is

play15:46

one association and you want to access

play15:48

some data dot control space you can do

play15:50

you have to give this path as expression

play15:52

this is called path expression

play15:58

ah in this case i think we have to give

play16:00

date

play16:01

dot will not work we have to use this

play16:04

posner

play16:11

i got one field from the path expression

play16:14

so i am getting that particular item

play16:16

increase the cardinality so it is

play16:18

telling the increasing the cardinality

play16:20

means previously we got one data the

play16:22

identity will obviously it will get the

play16:24

change let me activate control f3

play16:29

let me do

play16:34

f9 before doing f9 let me activate the

play16:38

trace so i did f9 i got the

play16:41

let me clear out the console

play16:43

that will be better

play16:45

uh let me

play16:47

go to the st05 come back and activate

play16:51

this trace again so i can see the how

play16:54

the zone is happening activate trace

play16:56

with filter and i will give only this

play16:58

particular program name to x

play17:00

activate the trace and now i will

play17:02

execute this particular program i will

play17:05

do f9

play17:06

so you can see i got the data

play17:09

uh for sales order number 11 you can see

play17:11

we have multiple line item previously we

play17:13

will be we were having only single line

play17:15

item because join didn't form in this

play17:17

case since we have access the data from

play17:20

the line item table the join got formed

play17:23

let me deactivate the trace

play17:25

and the display trace

play17:31

see the execution plan of this

play17:33

particular

play17:34

query

play17:36

if you see this particular execution

play17:38

plan let me close this console

play17:40

and let me analyze little bit this one

play17:43

so you can see

play17:44

uh that we are the join is happening on

play17:47

the vbap and we will be ak and vb ap

play17:50

table and we are getting the data from

play17:52

both the table

play17:56

so you can see it's now join on demand

play17:58

when we access the data

play18:00

from

play18:02

item association then only zoning is

play18:04

happening otherwise there is

play18:06

no joint

play18:07

in this video we have learned about the

play18:09

basics of association in my next video

play18:12

we'll see how we can use these

play18:15

associations in our where condition if

play18:17

we are using in where condition what is

play18:18

the prerequisite

play18:20

and

play18:22

when this particular association will

play18:24

form in a zone instead of left outer

play18:26

zoin

play18:27

not only that we will talk about

play18:29

cardinality as well before going to that

play18:31

video please like this video subscribe

play18:34

this channel and share these videos with

play18:36

others as well thank you and happy

play18:39

learning

Rate This

5.0 / 5 (0 votes)

関連タグ
SAPCDS ViewsAssociationsJoinsData ModelingCardinalityABAPHANAProgrammingSales Order
英語で要約が必要ですか?