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.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to check whether a view is cds and get list of its field?

former_member625844
Participant
0 Kudos

Hello:

Given a table name. Is there a method to check whether it's a table or a CDS view and get a list of its all fields including alias? Thx.

I find a FM DP_GET_FIELDS_FROM_TABLE which can get all fields. But it use the SQL view name not the CDS name. So suppose given a SQL clause , how to first get the SQL view name of it then get the fields list.

4 REPLIES 4

0 Kudos

Hi loki_luo15

I dont think if method is their or not, There is some standards we have to following for creating the CDS view, you already have an idea How we declare the basic view, interface view and as well as composite view.

Regards,

kiran

sanilbhandari
Product and Topic Expert
Product and Topic Expert
0 Kudos

The below link should be useful to you.

https://wiki.scn.sap.com/wiki/display/BI/CDS+Views%3A+Tools+and+Tables

https://blogs.sap.com/2020/07/17/how-to-find-cds-views-by-just-knowing-the-field-name-in-sap-ecc-and...

The below video should also help you quite a bit

https://youtu.be/-AxCDysiMiE

Also refer the attached document

Thanks & Regards

Sanil Bhandari

matt
Active Contributor

Check if the view is in table DDLDEPENDENCY. Fields in DD03L, I think.

If in doubt, do and SQL trace (ST05), and then look at what you know is a CDS view in SE11. Then look at the trace and see which tables are hit.

Abdul_Waheed
Contributor
0 Kudos

Use table DDLDEPENDENCY, it maintains relationship between the CDS core entity and automatically generated database view as below.