HANA XS ODATA

HANA XS ODATA: OData is a resource-based web protocol for querying and updating data. OData defines operations on resources using HTTP commands (for example, GET , PUT , POST , and DELETE ) and specifies the uniform resource indicator (URI) syntax to use to identify the resources.

Expose data residing in SAP HANA via Odata services

Introduction: HANA XS ODATA

The articles Introduction to OData Service and OData Architecture explain the basics of OData.
In the article Introduction to SAP HANA XS, we also explained that SAP HANA XS can be used to expose data from Tables, Views and Modeling Views to UI layer.
In HANA XS, there are major 2 ways to expose data the data to clients – OData and XSJS. In this article we will talk about OData.
In this article we will explain

  • How OData service works in SAP HANA?
  • What is XSOData (OData file in HANA)?
  • SAP HANA OData Framework.

Note: For XSJS, read the article SAP HANA XSJS Service

OData Service in SAP HANA:

An OData service exposes data stored in database tables or views as OData collections for analysis and display by client applications.

The client can be web browser, or SAPUI5 application or HTML5 application or any other application which supports OData.

An OData service for SAP HANA XS is defined in a text file with the file suffix .xsodata, for example, OdataSrvDef.xsodata.

The XSODATA services are great because they provide a large amount of functionality with minimal amounts of development effort.

Important points on HANA OData Service (XSODATA):

  • SAP HANA XS currently supports OData version 2.0
  • OData defines operations on resources using RESTful HTTP commands (for example, GET, PUT, POST, and DELETE).
  • Data is transferred over HTTP

XSOData Examples:

An OData service for SAP HANA XS is defined in a text file with the file suffix .xsodata

The file must contain at least the entry

service {

}

The following example shows how to include a reference to a table in an OData .

service {

“mySchema”.”myTable” as “MyTable”;

}

You can also expose Attribute, Analytic and Calculation view using XSOData.

Suppose there is a calculation view called “Sales” in a package “sap.hana”, then the service will be like:

service {

“sap.hana”::”Sales” as “Sales”;

}

Read-only XSOData Service: (HANA XS ODATA)

By default, all entity sets in an OData service are writeable, that is they can be modified with a CREATE, UPDATE, or DELETE requests.

However, you can prevent the execution of a modification request by setting the appropriate keyword (create, update, or delete) with the forbidden option in the OData service definition.

The following example of an OData service definition for SAP HANA XS shows how to prevent any modification to the table myTable that is exposed by the OData service.

service {

“mySchema”.”myTable” as “MyTable”

create forbidden

update forbidden

delete forbidden;

How to consume HANA XS OData service in SAP Netweaver Gateway

Step-by-Step Procedure

  • Related Posts

    सबसे लोकप्रिय परियोजना प्रबंधन सॉफ्टवेयर कौन सा है? -2024

    सबसे लोकप्रिय परियोजना प्रबंधन सॉफ्टवेयर कौन सा है? -2024 व्यापार की तेज गति वाली दुनिया में, कुशल परियोजना प्रबंधन सफलता के लिए यह बहुत ज़रूरी है। सही Project. मैनेजमेंट सॉफ़्टवेयर चुनने से…

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You Missed

    Part IV: SAP Fiori Tutorial. How can I modify the Fiori Launch Pad’s default language if it’s not English?

    • By Varad
    • October 10, 2024
    • 2 views
    Part IV: SAP Fiori Tutorial. How can I modify the Fiori Launch Pad’s default language if it’s not English?

    Part V of the SAP Fiori Tutorial: Complete Implementation of the My Inbox – Purchase Order Approval System

    • By Varad
    • October 9, 2024
    • 3 views
    Part V of the SAP Fiori Tutorial: Complete Implementation of the My Inbox – Purchase Order Approval System

    Display & Download PNG JPG PDF Document in SFiori Client Android with 3rd Party App for Zoom/additional options

    • By Varad
    • October 8, 2024
    • 3 views
    Display & Download PNG JPG PDF Document in SFiori Client Android with 3rd Party App for Zoom/additional options

    Configuring SAP GUI Transaction in Fiori Launchpad

    • By Varad
    • October 7, 2024
    • 2 views
    Configuring SAP GUI Transaction in Fiori Launchpad

    OOP Report Applying ALV Tree Combination and Splitter

    • By Varad
    • October 6, 2024
    • 2 views

    SAP Fiori Tutorial. Part VI. How to Troubleshoot SAP Fiori Errors?

    • By Varad
    • October 5, 2024
    • 2 views
    SAP Fiori Tutorial. Part VI. How to Troubleshoot SAP Fiori Errors?