Open Data Protocol
Open Data Protocol (OData) is a data access protocol initially defined by Microsoft. Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open Specification Promise. Version 4.0 is being standardized at OASIS,[1] and was released in March 2014.[2]
The protocol was designed to provide standard CRUD access to a data source via a website. It is similar to JDBC and ODBC although OData is not limited to SQL databases.
Architecture
OData is built on the AtomPub protocol and JSON where the Atom structure is the envelope that contains the data returned from each OData request. An OData request uses theREST model for all requests. Each REST command is a POST, GET, PUT, PATCH, or DELETE http request (mapping to CRUD) where the specifics of the command are in the url.
- GET: Get a collection of entities (as a feed document) or a single entity(as an entry document).
- POST: Create a new entity from an entry document.
- PUT: Update an existing entity with an entry document.
- PATCH: Update an existing entity with a partial entry document.
- DELETE: Remove an entity.
Any platform that provides support for HTTP and XML is enough to form HTTP requests to interact with AtomPub. The OData specification defines how AtomPub is used to standardize a typed, resource-oriented CRUD interface for manipulating data sources.
Typical Workflow When Creating a New User Interface:-
Architectural Stack for online Application:-
Service Builder – Data Model:-
Create / Model OData
Artifacts --
- Entity Types
- Entity Sets
- Complex Types
- Associations
- Association Sets
- Function Imports
-
Generation of runtime objects :-
Service implementation – CRUD methods:-
Direct navigation into the CRUD –
Methods--
- Create
- Read and Query
- Update
- Delete
Service Builder – runtime artifacts:-
ABAP classes for
- Model definition
- Service implementation
Service registration in the
backend
Service Builder – Result :-
/iwfnd/maint_service :-
Service document in the browser and entity types in
SEGW
$metadata document
http://<host>:<port>/sap/opu/odata/sap/ZCD204_EPM_LECTURE_SRV/$metadata
Summary - Transactions you should know as a developer
Gateway Service Builder - development flow in detail