cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA XS Engine OData - get M_SYSTEM_OVERVIEW

Former Member
0 Kudos

Hey Guys,

I want to create a OData or JSON "Monitoring Service" (Using the internal Views in SCHEMA "SYS"). I created a User with all possible Authorizations...

My hello.xsodata looks like this:

service {

"SYS::M_SYSTEM_OVERVIEW";

}

But I get some activation errors:

Description Resource Path Location Type

[40136] Unknown object name "SYS::M_SYSTEM_OVERVIEW". test.xsodata


and

TestOData:systemview.hdbschema Schema name SYS is not equal to object name systemview. Please delete the object and create a new one that matches the schema name. Do not change the schema name in this object.

My systemview.hdbschema looks like that:

schema_name="SYS";


Is there anybody out there, help me sing my song ?!

Thanks and best regards

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>My systemview.hdbschema looks like that:

> schema_name="SYS";

hdbschema is for creating a new schema. SYS is an existing standard schema, why would you need to create it?

>My hello.xsodata looks like this:

> service {

> "SYS::M_SYSTEM_OVERVIEW";

> }

Your syntax is wrong.  The :: is the separate between a namespace and a table. You have a schema and a table. There the separator should be a period. Plus this is a view so you will manually have to specific the keys.

Here is the correct syntax:

service {

"SYS"."M_SYSTEM_OVERVIEW" keys("SECTION","NAME");

}

Former Member
0 Kudos

Hi Thomas,

Thanks for your reply.

I have to admit, I am completely new to develop OData stuff (in general developing WebServices or something similar - Therefore OS Level scripting work really good ). I thought the Engine needs to know what schema is needed, this was my misunderstanding of the definition file.

My thinking was that this is defined by *.hdbschema... But japp your explanation does make sense

OK now there are no errors by activating this files...

Output is now:


<service xml:base="http://host:8011/TestOData/hello.xsodata/">

   <workspace>

      <atom:title>Default</atom:title>

      <collection href="M_SYSTEM_OVERVIEW">

         <atom:title>M_SYSTEM_OVERVIEW</atom:title>

      </collection>

   </workspace>

</service>

So again for the n00b... How do I get some data out of this service via URL respectively WebBrowser?

Second question: Is it possible to set more than one view in this Service (if this makes sense at all...)?

Thanks a lot

Daniel

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>So again for the n00b... How do I get some data out of this service via URL respectively WebBrowser?

Just add the entity name to the end of the URL.

>Second question: Is it possible to set more than one view in this Service (if this makes sense at all...)?

Sure, just define multiple entities in your XSODATA file.

You will find more details on these basic questions in the online help:

SAP HANA Developer Guide for SAP HANA Studio - SAP Library

Former Member
0 Kudos

Hi Thomas,

japp I already had a look to the dev guide... and did a "rebuild" of the examples in this pdf. But someone has to build me a bridge so that I can understand what happened here.

I call the URL http://host:8011/TestOData/hello.xsodata/systemoverview

And I get this output:

What I expected:

best regards

Daniel

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The default format for OData is Atom+XML which the browser is showing as an RSS feed. 

Look at the raw response, change the browser settings to display not as RSS or use Chrome if you want to see the data directly.

You can also use the URL parameter $format=json to get the data back in JSON format instead of Atom+XML.

Answers (0)