2
3/13/2017 SAP NetWeaver Gateway and OData SAP NetWeaver Gateway SAP Library http://helplegacy.sap.com/saphelp_gateway20sp09/helpdata/en/2f/d48687c1e14e87915d41e595a4285d/content.htm 1/2 SAP NetWeaver Gateway and OData By exposing SAP Business Suite functionality as RESTbased OData (Open Data Protocol) services, SAP NetWeaver Gateway enables SAP applications to share data with a wide range of devices, technologies, and platforms in a way that is easy to understand and consume. Using REST services provides the following advantages: Obtain human readable results; you can use your browser to see what data you will get. Use stateless applications Receive related pieces of information, one leading to another. Use standard GET, PUT, POST, DELETE, and QUERY. If you know where to GET data, you know where to PUT it, and you can use the same format. What Is OData and Why Do we Use It? OData is a Web protocol for querying and updating data, applying and building on Web technologies such as HTTP, Atom Publishing Protocol (AtomPub), and RSS (Really Simple Syndication) to provide access to information from a variety of applications. It is easy to understand and extensible, and provides consumers with a predictable interface for querying a variety of data sources. AtomPub is the standard for treating groups of similar information snippets as it is simple, extensible, and allows anything textual in its content. However, as so much textual enterprise data is structured, there is also a requirement to express what structure to expect in a certain kind of information snippet. As these snippets can come in large quantities, they must be trimmed down to manageable chunks, sorted according to adhoc user preferences, and the result set must be stepped through page by page. OData provides all of the above as well as additional features, such as feed customization that allows mapping part of the structured content into the standard Atom elements, and the ability to link data entities within an OData service (via “…related…” links) and beyond (via media link entries). This facilitates support of a wide range of clients with different capabilities: Purely Atom, simply paging through data. Hypermediadriven, navigating through the data web. Aware of query options, tailoring the OData services to their needs. OData is also extensible, like the underlying AtomPub, and thereby allows the addition of features that are required when building easytouse applications, both mobile and browserbased. OData for SAP Products SAP NetWeaver Gateway uses OData for SAP Products, which contains SAPspecific metadata that helps the developer to consume SAP business data, such as descriptions of fields that can be retrieved from the SAP ABAP Dictionary. The following are examples of OData for SAP applications: Humanreadable, languagedependent labels for all properties (required for building user interfaces). Freetext search, within collections of similar entities, and across collections using OpenSearch. OpenSearch can use the Atom Syndication Format for its search results, so the OData entities that are returned by the search fit in, and OpenSearch can be integrated into AtomPub service documents via links with rel=”search”, per collection as well as on the top level. The OpenSearch description specifies the URL template to use for searching, and for collections it simply points to the OData entity set, using a custom query option with the name of “search”. Semantic annotations, which are required for applications running on mobile devices to provide seamless integration into contacts, calendar, and telephony. The client needs to know which OData properties contain a phone number, a part of a name or address, or something related to a calendar event. Not all entities and entity sets will support the full spectrum of possible interactions defined by the uniform interface, so capability discovery will help clients avoiding requests that the server cannot fulfill. The metadata document will tell whether an entity set is searchable, which properties may be used in filter expressions, and which properties of an entity will always be managed by the server.

Sap net weaver gateway and o data - sap netweaver gateway - sap library

Embed Size (px)

Citation preview

Page 1: Sap net weaver gateway and o data - sap netweaver gateway - sap library

3/13/2017 SAP NetWeaver Gateway and OData ­ SAP NetWeaver Gateway ­ SAP Library

http://help­legacy.sap.com/saphelp_gateway20sp09/helpdata/en/2f/d48687c1e14e87915d41e595a4285d/content.htm 1/2

SAP NetWeaver Gateway and OData By exposing SAP Business Suite functionality as REST­based OData (Open Data Protocol) services, SAPNetWeaver Gateway enables SAP applications to share data with a wide range of devices, technologies, andplatforms in a way that is easy to understand and consume.Using REST services provides the following advantages:

Obtain human readable results; you can use your browser to see what data you will get.Use stateless applicationsReceive related pieces of information, one leading to another.Use standard GET, PUT, POST, DELETE, and QUERY. If you know where to GET data, you knowwhere to PUT it, and you can use the same format.

What Is OData and Why Do we Use It?

OData is a Web protocol for querying and updating data, applying and building on Web technologies such asHTTP, Atom Publishing Protocol (AtomPub), and RSS (Really Simple Syndication) to provide access toinformation from a variety of applications. It is easy to understand and extensible, and provides consumerswith a predictable interface for querying a variety of data sources.AtomPub is the standard for treating groups of similar information snippets as it is simple, extensible, andallows anything textual in its content. However, as so much textual enterprise data is structured, there isalso a requirement to express what structure to expect in a certain kind of information snippet. As thesesnippets can come in large quantities, they must be trimmed down to manageable chunks, sorted accordingto ad­hoc user preferences, and the result set must be stepped through page by page.OData provides all of the above as well as additional features, such as feed customization that allowsmapping part of the structured content into the standard Atom elements, and the ability to link data entitieswithin an OData service (via “…related…” links) and beyond (via media link entries). This facilitates supportof a wide range of clients with different capabilities:

Purely Atom, simply paging through data.Hypermedia­driven, navigating through the data web.Aware of query options, tailoring the OData services to their needs.

OData is also extensible, like the underlying AtomPub, and thereby allows the addition of features that arerequired when building easy­to­use applications, both mobile and browser­based.

OData for SAP Products

SAP NetWeaver Gateway uses OData for SAP Products, which contains SAP­specific metadata that helpsthe developer to consume SAP business data, such as descriptions of fields that can be retrieved from theSAP ABAP Dictionary. The following are examples of OData for SAP applications:

Human­readable, language­dependent labels for all properties (required for building user interfaces).Free­text search, within collections of similar entities, and across collections using OpenSearch.OpenSearch can use the Atom Syndication Format for its search results, so the OData entities thatare returned by the search fit in, and OpenSearch can be integrated into AtomPub service documentsvia links with rel=”search”, per collection as well as on the top level. The OpenSearch descriptionspecifies the URL template to use for searching, and for collections it simply points to the ODataentity set, using a custom query option with the name of “search”.Semantic annotations, which are required for applications running on mobile devices to provideseamless integration into contacts, calendar, and telephony. The client needs to know which ODataproperties contain a phone number, a part of a name or address, or something related to a calendarevent.Not all entities and entity sets will support the full spectrum of possible interactions defined by theuniform interface, so capability discovery will help clients avoiding requests that the server cannotfulfill. The metadata document will tell whether an entity set is searchable, which properties may beused in filter expressions, and which properties of an entity will always be managed by the server.

Page 2: Sap net weaver gateway and o data - sap netweaver gateway - sap library

3/13/2017 SAP NetWeaver Gateway and OData ­ SAP NetWeaver Gateway ­ SAP Library

http://help­legacy.sap.com/saphelp_gateway20sp09/helpdata/en/2f/d48687c1e14e87915d41e595a4285d/content.htm 2/2

Most of the applications for “light­weight consumption” follow an interaction pattern called “view­inspect­act”, “alert­analyze­act”, or “explore & act”, meaning that you somehow navigate (or are led) toan entity that interests you, and then you have to choose what to do. The chosen action eventuallyresults in changes to this entity, or entities related to it, but it may be tricky to express it in terms ofan Update operation, so the available actions are advertised to the client as special atom links (with anoptional embedded simplified “form” in case the action needs parameters) and the action is triggeredby POSTing to the target URI of the link.