Skip to Content
Author's profile photo Gowrisankar M

Exposing AnalyticView as odata in SAP HANA Cloud Platform (Trial Account)

Exposing Analytic view as odata–>Please follow below mentioned steps to expose your analytic view as Odata, which is present in the HCP Trial.

Step 1:- Create your Analytic View in HANA trial account.

Step 2:- As per the privileges assigned to the developers in the trial HANA account,only calculation views can preview the data.

So we need to convert the analytic view into a calculation view by creating a dummy Calculated Column – Attribute as shown below:-


Step 3:- Open the SQL console and run below command to provide Select Rights for Activated Modeled Views. [Now you can see your view in _sys_BIC–>Column views]  CALL “HCP”.”HCP_GRANT_SELECT_ON_ACTIVATED_OBJECTS”;

Step 4:- Create a XSodata file for exposing analytical view as odata like mentioned below,

service namespace “”


    “XXXXXXXtrial.gowri::ANA” as “Ana” keys generate local “new”

    aggregates always;


Step 5:- create a role, to access your created model.

role xxxxxxxxtrial.gowri.mynew.role::model_access {

sql object xxxxxxxtrial.gowri:CD.analyticview : SELECT;

sql object xxxxxxxtrial.gowri:ANA.analyticview : SELECT;



Step 6:- Grant created role to your user by running below query,

call “HCP”.”HCP_GRANT_ROLE_TO_USER”(‘xxxxxxxtrial.gowri.mynew.role::model_access’, ‘xxxuseridxx’)


Now check your exposed analytic view as odata via browser.


Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Karthik Ravikumar
      Karthik Ravikumar

      Hi Gowrisankar,

      Thanks for the detailed steps. I have created an Analytical View with trial Account followed by XSOdata service. When I activate the service, I get the error "Files cannot be written into the repository root package". Is it really necessary to create roles in this case? especially Step 3 and Step 6. If so can you please provide the detailed steps.  I also have the HANA DB user access.