cancel
Showing results for 
Search instead for 
Did you mean: 

Calling CDS Views or Database Maintenance Views from an AMDP

former_member318841
Participant
0 Kudos

I have a CDS View that is a join of three tables that emulates a database maintenance view that exists on our system. Both the CDS view and the database view return the same results (yes!). Now I am trying to use either of them in an AMDP. I get the same error for either. I am attaching snapshots of the database maintenance view, my CDS view that emulates the database view,and the AMDP, with its error, for both usage attempts.

This is the original maintenance view's joins

These are the fields returned.

This is the CDS view I wrote to emulate the database maintenance view. Both views work on their own.

This is the AMDP using the original database view and the error.

This is the same AMDP only using the CDS View. The RETURN is just a filler at this point; if I take the IT_GRPFLTR select out, the AMDP works fine with the accompanying Table Function. I am just attempting to expand by adding an additional selection, which will eventually be used by the RETURN statement.

Thank you for the assist.

Accepted Solutions (1)

Accepted Solutions (1)

former_member302041
Contributor

If you want to access CDS from AMDP then you must access "sqlViewName" of CDS view which is "ZDSN004_GRPF2" in your case instead of ZDSN... /DSN... tables.

However it is not recommended to access that way (see horst.keller blog here https://blogs.sap.com/2018/04/03/abap-managed-database-objects-and-how-to-access-them/).

Answers (0)