Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
Showing results for 
Search instead for 
Did you mean: 
Active Contributor
First part:

I created a cds view doing the needed join:
@AbapCatalog.sqlViewName: 'z_i_tabdevc'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'DDIC-Tables (+Structures) with associated Packages'
define view zz_i_tablesDevclas as select from dd02l
left outer join tadir
on dd02l.tabname = tadir.obj_name

left outer join tdevc on
tadir.devclass = tdevc.devclass
tabname as tableName,
tabclass as tableClass,
exclass ,
dd02l.as4user as lastChagedBy,
as4date as lastChangedAtDate,
as4time as lastChangedAtTime,

tadir.devclass as devPackage,


...and on top of that another one implementing the where clause:
@AbapCatalog.sqlViewName: 'z_i_noenhcat'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'DDIC-Tabellen mit fehlender Erweiterungskategorie'
define view zz_i_tablesNoEnhCat as select from zz_i_tablesDevclas
where exclass = '0'

I tested if it works like expected using the preview (F8) in AdT as well as the SQL-console.Then I switched back to my report.

I changed the typing to the CDS-view:
gty_data type zz_i_tablesnoenhcat

And the select as well:
* select * from dd02l
* into CORRESPONDING FIELDS OF table ct_data
* where tabname in so_tabna
* and exclass = 0

select * from zz_i_tablesNoEnhCat into CORRESPONDING FIELDS OF TABLE @ct_data
where tablename in @so_tabna .

...and - using the filter in the SALV table to only see "our" component - I was done!


- I made 2 separate views as I think the first one might be re-used in some other case, maybe. (And the extra view was very little overhead).
- not sure if I should have created yet another vie - a consumption view - to use in the report?!
- I won't do it (now) but it sure would be easy to build a FioriElements ListeReportApp on top of what I created (it is one of the benefits of this approach )
- it's not hard to do, it's only hard to get started - next time will be better, as I now have a reference
- naming the SE11 view part if the cds is not easy - so few characters! 😞

Do you use CDS-views already? How does it work for you?




Also, there is a 2.1-part:

Next part:
Labels in this area