Personal Insights
DDIC-objects that miss an enhancement-category – part 2 – use CDS-views!
First part: https://blogs.sap.com/2020/08/31/task-find-ddic-objects-that-miss-an-enhancement-category-part-1/
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,
tdevc.component
}
…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!
Thoughts:
– 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?
best
Joachim
Edit:
Also, there is a 2.1-part: https://blogs.sap.com/2020/09/03/ddic-objects-that-miss-an-enhancement-category-part-2.1-cds-view-more-info-dd02l-sqltab/
I've started with CDS views. They are still strange to me. I tend to stack them on top of each other like you did in this example. (Two views) I keep thinking that I'll be able to reuse what I've created. Sadly, I have not had a lot of time on FIORI apps. So using my CDS views are within an ABAP type UI.
My recent project is workflow! It's been awhile and I'm looking forward to it. But now I'll step away from CDS views for a bit. I think. I could use them........... I'm thinking now and that's dangerous.
Thank you for both blogs!
Michelle
Note: I dicided not to ditch /FIS/i_tablesNoEnhCat and instead select from /FIS/i_tablesDevclas directly.
(With an added
).
...that way, I can use my report no only to look at/find "no enhancement category" but also for use cases like that:
I have some tables + structures (zz_myApp*), what's their enhancement-category?
> Note: I dicided not to ditch /FIS/i_tablesNoEnhCat and instead select from /FIS/i_tablesDevclas directly.
Oh, it seems something went wrong when I wrote that sentence:
it should be:
Note:I dicided not to use /FIS/i_tablesNoEnhCat[...]
or:
Note: I dicided to ditch /FIS/i_tablesNoEnhCat [...]
("not to ditch" is wrong an confusing...)
As I just stumble over
-> This will be better with CDS view entities - no SE11 name needed any more!
https://blogs.sap.com/2020/09/02/a-new-generation-of-cds-views-cds-view-entities/