Skip to Content

OData Service in SAPUI5 Application on HANA Cloud Platform

Hi everybody,

I'm pretty new to SAP HANA Cloud Platform and have a big problem with my application. I wrote a SAPUI5 application which is currently running on HANA Cloud Platform. The app has a normal database schema. I created via a database-tunnel a connection to the schema and created a database and filled it with data. What I wanna do now is to connect my SAPUI5 application with this database table. I want to receive the data as a odata service but this doen't work. I read something about creating a .xsodata file which has the following structure:

service namespace "myNamespace" {

"SCHEMANAME"."TABLENAME"

as "TABLE_ALIAS";

}

The SCHEMANAME is exactly the name of the schema how it is named on SAP HANA Cloud Platform. The table name is the name how the table is named in the schema.

Just for your information... the .xsodata file is inside a folder in my SAPUI5 application. When I create the oData Model I call the url of the application -> .xsodata.

Doesn't work at all... Can somebody help me solving this issue?

Looking forward to your answers!

Greetings

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Nov 20, 2013 at 08:10 AM

    Hi,

    what have you exactly done? I have my custom schema "NEO_XXXXX..." and in this is my table. Afterwards I created a repository and checked this out. Then I created a normal XS-Project. In this XS-Project there are the following files:

    - .xsapp --> no content

    - .xsaccess

    {

    "exposed" : true

    }

    - .xsprivileges

    { "privileges" :

    [ { "name" : "Basic", "description" : "Basic usage privilege" } ]}

    - .odata.xsodata

    service{

    "NEO_XXXXX..."."TABLE_NAME";

    }

    - model_access.hdbrole

    role pMYUSERtriall.MYPACKAGE::model_access {

    catalog schema "NEO_XXXX...": SELECT, UPDATE, INSERT, DELETE;

    }

    - application_access.hdbrole

    role pMYUSERtrial.MYPACKAGE::application_access {

    application privilege: pMYUSERtrial.MYPACKAGE::Basic;

    }

    After activating these objects, calling the SQL Statement you wrote and calling my odata.xsodata service I get again

    Service exception: insufficient privilege.

    What have I made wrong? ...

    Looking forward to your help.

    Greetings

    Stef

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 19, 2013 at 04:24 PM

    Hi,

    here is a small status update! I made it now to call the .xsodata file. I don't have a problem with calling the .xsodata/ and also not with calling .xsodata/$metadata

    But when I try the following: .xsodata/DETAIL I receive the following message:

    Service exception: insufficient privilege.

    I also tried then to build up a .hdbrole file with the following content:

    role pMYUSERtrial.MYPACKAGE::schema_role {

    catalog sql object "NEO_MYSCHEMA"."MYTABLE" : SELECT,UPDATE,INSERT,DELETE;

    }

    After activating all the files I try to call the following:

    call "HCP"."HCP_GRANT_ROLE_TO_USER"('pMYUSERtrial.MYPACKAGE::schema_role', 'MYUSER');

    But I can't because I get an error saying "insufficient privileges" ... By the way ... I work with the SAP HANA Cloud Platform Trial

    I really hope that somebody can help me solving this problem...

    Greetings

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 14, 2015 at 07:46 PM

    HI,

    I have followed all steps mentioned above to create odata service on hcp. i have also executed both sql commands which executed successfully but if i try to run odata file then it gives page not found error on hcp,

    please help me to resolve this issue.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2015 at 05:20 AM

    HI,

    I have followed all steps mentioned above to create odata service on hcp. i have also executed both sql commands which executed successfully but if i try to run odata file then it gives page not found error on hcp,

    please help me to resolve this issue.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2016 at 01:46 PM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.