Skip to Content
avatar image
Former Member

Subquery or Subselect is possible in ABAP CDS?

Hi, experts.

I want to use subquery, subselect concepts in my ABAP CDS.

What I want to do is similar to SQL below.

select

name,

round(sum(amount_paid) / (select amount_paid from order_items) * 100.0, 2) as pct

from order_items

group by 1

order by 2 desc;

-> to calculate percent of revenue each items

SELECT *

FROM flights

WHERE origin in ( SELECT code FROM airports WHERE elevation > 2000);

-> using subquery in where clause

I'm not sure whether this concept is available in ABAP CDS.

Or do I make additional view and use join or association?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Mar 13, 2017 at 11:06 AM
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 18 at 07:11 AM

    Hi,

    No, sub-queries are not supported in CDS views as of now.

    Regards,

    Deo

    Add comment
    10|10000 characters needed characters exceeded