Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Get records based on a another table that has a range (ABAP CDS)

0 Kudos

Hi Experts,

Need your help. I have been tasked of retrieving records based on another table whose value are in a range. Please see below example. This is for ABAP CDS, not ABAP.

Table 1 is the list of Codes. Table 2 is the ranges (the number of records in this table can change). I have to retrieve the list of codes based on the ranges as shown the expected result.

I have tried retrieving the ranges in Table function and using them as a dynamic where condition but this only works if i have only 1 record in table 2.

In ABAP, this would easily be done in a loop but in ABAP CDS there is no looping.

Any thoughts or suggestions?

Thank you in advance!

Erwin Formaran


Active Contributor

Your question will be easier to read if you embed the image instead of defining it as an hyperlink, like this:

0 Kudos

Thanks Sandra, I have updated the question. I missed this option when I created it.