cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

abap cds view: joins with one table on multiple condition

jan_turek
Active Participant
0 Kudos
184

Hi all,

In ABAP cds view I have the select from aufk with inner join from jest on aufk.objnr to get the order statuses on header level.

Then I have another join from afvc to get the operations.

Now I need another join from jest on afvc.objnr to get the statuses on operation level. The aim is to get all order operations, that match certain statuses on both header and operation level. So I would need something like this:

inner join jest on aufk.objnr = jest.objnr // status header
inner join jest on afvc.objnr = jest.objnr // status operation

How can I do multiple joins from one table on different conditions? Aliases? Nested joins?

thanks to all

 

Accepted Solutions (0)

Answers (1)

Answers (1)

keremkoseoglu
Contributor

Try this:

inner join jest as j1 on j1.objnr = aufk.objnr " header
inner join jest as j2 on j2.objnr = afvc.objnr " operation

 

jan_turek
Active Participant
0 Kudos
Hi keremkoseoglu,
jan_turek
Active Participant
0 Kudos
Hi keremkoseoglu, so that the solution is in aliases. Thanks, it works.