cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in ABAP CDS View for annotation @Analytics.query: true

former_member212011
Participant
0 Likes
8,077

Hi,

I am trying to create a simple CDS view and using annotation @Analytics.query: true (this is a prerequisite to use the view in SAC as 2C* object) as purpose is to expose this CDS view to SAC, but getting below error while activating, what is this error about and how to fix it?

Checked multiple blogposts but could not find the exact resolution.

Note- when I remove the annotation @Analytics.query: true from my code I do not get any error and the view gets activated successfully.

Prerequisite-

https://apps.support.sap.com/sap/support/knowledge/en/2595552

Code-

@AbapCatalog.sqlViewName: 'ZDEMO_S4'

@AbapCatalog.compiler.compareFilter: true

@AbapCatalog.preserveKey: true

@AccessControl.authorizationCheck: #CHECK

@Analytics.query: true

@EndUserText.label: 'ZXDemo'

define view ZXDEMO as select from vbap{

vbeln as Order_No,

posnr as Item,

matnr as Material,

po_quan as PO_Qty

}

Error-

Error reading InfoProvider for CDS view 2CZDEMO_S4

Unknown CDS view: VBAP - only CDS view names allowed in FROM clause [Analytics]

Thanks and Regards,

Ravi

Accepted Solutions (0)

Answers (2)

Answers (2)

akashkannan22
Explorer
0 Likes

To create a model using CDS views in SAC, analytics.query: true annotation is not alone enough.

You also want to publish OData service in SAP GUI. And add Annotation, OData.pulish: true.


0 Likes

how were you able to fix this?

former_member212011
Participant

Hello Rahul,

Yes, you need to create 2 layers of CDS views-

First build a Cube View and on top of it build a Consumption view.

Once both the views are active, you will find a 2C* object created in the system.

Regards,

Ravi

NitinMore
Discoverer
0 Likes

Is it worked after adding @analytics.dataCategory: #CUBE annotation?

NitinMore
Discoverer
0 Likes
Hi, I have created a cube view also but still facing the issue, Is there any extra annotation required?