cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization error after activating odata service

Former Member
0 Kudos

Hi Experts,

NOTE.....I am using sap hana trail version

I  created trial account and  created odata service to expose my own data from table.

But when i am trying to see content of my table data after activating  it getting error as

can anyone help me

Thanks,

pavan

Accepted Solutions (0)

Answers (1)

Answers (1)

anton_levin
Active Contributor
0 Kudos

Hi Pavan,

I think you miss the respective SELECT permission for your catalog schema NEO_

This should be specified in your .hdbrole file. See an example here [1]

...

catalog schema "<NEO_schema_name>": CREATE ANY, DROP, INDEX, SELECT, INSERT, UPDATE, DELETE;

...

Regards,

Anton

[1]

Former Member
0 Kudos

Hi Anton,

Thanks for reply,

I will show  the complte steps how i created odata services

NOTE... I am using sap hana trail version

TABLE;

table.schemaName = "NEO_xxxxxxxxx";

table.tableType = COLUMNSTORE; // ROWSTORE is an alternative value

table.columns =

[

    {name = "VBELN";  sqlType = VARCHAR; length = 10;comment = "sales document";},

    {name = "ERDAT";  sqlType = DATE;comment = "Date on which record is created";},

    {name = "ERZET";  sqlType = TIME;comment = "entry time";},

    {name = "ERNAM";  sqlType = VARCHAR;length = 12;nullable=false;comment = "name of the person who created the object";},

    {name = "AUDAT";  sqlType = DATE; nullable = false;comment = "Document date(Date received/sent)";},

    {name = "VBTYP";  sqlType = VARCHAR ; length = 1;nullable = false;comment = "SD Document Category"; },  

    {name = "AUART";  sqlType = VARCHAR;length = 4; nullable = false;comment = "Sales Document Type"; },

    {name = "AUGRU";  sqlType = VARCHAR;length = 3; nullable = false;comment = "Order reason(reason for the business transaction)";},

    {name = "VKORG"; sqlType = VARCHAR;length = 4; nullable = false;comment = "SALES ORGANIZATION"; } ,

    {name = "DISTR"; sqlType = VARCHAR;length = 2; nullable = false ;comment = "DISTRUBATION CHANNEL";},

    {name = "SPART"; sqlType = VARCHAR; length = 2;nullable = false;comment = "DIVISION";},

    {name = "KUNNR"; sqlType = VARCHAR;length = 10; nullable = false ;comment = "CUSTOMER NUMBER";}];

   

    //,

table.primaryKey.pkcolumns = ["VBELN"];

.XSACCESS;

{

     "exposed" : true, 

     "default_file": "index.html"

}

.XSPRIVILGES;

{

"privileges" :

[

  { "name" : "Basic", "description" : "Basic Usage privilege" }

]

}

HDBROLE;

role p077272trial.hanaxs.trailProject::WorkshopAdminRole2 {

          catalog schema "NEO_XXXXXXX": SELECT, UPDATE, INSERT, DELETE;

}

XSODAT;

service {

          "NEO_XXXXXXXX"."p077272trial.hanaxs.trailProject.data::VBAK" as "Samples";

}

ROLES;

call "HCP"."HCP_GRANT_ROLE_TO_USER"('p077272trial.hanaxs.trailProject::WorkshopAdminRole2','p077272')

call "HCP"."HCP_GRANT_SELECT_ON_ACTIVATED_OBJECTS"

call "HCP"."HCP_GRANT_ACTIVATED_ROLES"

After activating it showing insufficient privilges

please help me to fix this problem

Thanks,

pavan

anton_levin
Active Contributor
0 Kudos

Hi Pavan,

looks ok to me at first glance. Maybe you could setup a minimalistic example first? Having a flat structure - all necessary files: .xsapp, .xsaccess, .xsprivileges, .hdbrole, .xsodata under p077272trial.hanaxs and also manually create a test table with mock data under NEO_ schema, so that xsodata service look as simple as possible. Something like:


service { "NEO_XYZ"."TESTTABLE"; }

This might help to understand what is the problem with your setup.

Regards,

Anton