What is OData in SAP? (2024)

OData is an Open Data Protocol used in web technologies. OData is used by SAP to make SAP data accessible to other platforms so that the non SAP users can also access this data to develop web applications, websites, mobile apps, etc.

OData is used to create RESTful APIs.

OData is first introduced by Microsoft now it is being used for web applications, mobile applications etc.

OData fetches the data from one or many database and tables with the help of select, insert, delete or modify statements. It is based on the HTTP framework. In other words in the application layer, we have an internal table and that internal table data is passed out through OData to HTTP.

In a single HTTP request, you can get both the data and metadata or table structure and you can also do CRUD-Q operations which mean that you can Create the data on the database, Request the data, Update the data, Delete the data or you can perform various Queries operations on the database over the internet.

What is OData in SAP? (1)

What is REST?

REST means REpresentational State Transfer. It is a kind of software architecture for the World Wide Web.

What is the need for Odata service in SAP?

OData service is used in the SAP gateway to connect with non SAP platforms.

There are three types of OData services

  1. OData ABAP services -> For ODATA ABAP services the backend server is SAP ECC/CRM/SRM.
  2. OData HANA services-> For ODATA HANA services the backend server is SAP HANA.
  3. OData External services-> For OData External services the backend server is Non SAP servers /External servers.

What are the uses of Odata services?

The job of ODATA services is to fetch data from the database and table to OData services through SQL Statements,

And from ODATA services the data is displayed on the front end application screen like SAP UI5 or FIORI screen in the form of some screen elements like Tables, Graphs, Dropdowns, Radio buttons Checkboxes etc.

The front end services like SAP UI5 or FIORI screen will be the same for all ODATA services whether it is ODATA services for ABAP or HANA or External services.

What is OData in SAP? (2)

What is SAP Netweaver Gateway?

SAP Netweaver Gateway is a technology that offers connectivity to SAP applications using any programming language or model without the need for SAP knowledge by using REST services and OData protocols.

In other words, SAP Netweaver is a technology which helps devices, environments or platforms to access SAP using OData services. It convertsthe internal table into OData format. In other words, SAP Gateway is like a medium for the outside world to connect with SAP and transfer data to or from SAP.

What is OData in SAP? (3)

What is SAP Gateway Service Builder?

SAP Gateway Service Builder or Transaction Code SEGWis used for creating OData services.

What is OData in SAP? (4)

What is OData in SAP? (5)

How to create OData services?

There are two ways to develop OData services:

  1. By using Mapping Technique: OData service can be developed by using mapping techniques such as BAPI/RFC.
  2. Without using Mapping Technique.

What is the latest OData version?

V4 is the latest OData version.

Step by Step procedure to create OData services:

Step1: Goto T.CodeSEGW.

What is OData in SAP? (6)

Step2:On the SAP Gateway Service Builder screen press the Create Icon.

What is OData in SAP? (7)

Step3: In the SAP Gateway Service Builderscreen a pop window for Create Projectappears fill all the required information as shown below:

Project: z_odata

Description: OData service for testing

Select the packages or Local Objectand press the tick button.

What is OData in SAP? (8)

Now the new Project Z_ODATA created. Press the Savebutton.

What is OData in SAP? (9)

Step4: In the SAP Gateway Service Builder screen expand Z_ODATA project node which we created.
Select Data Model node. Right click-> Import->DDIC Structure

What is OData in SAP? (10)

Give a suitable name for Entity type:

In the Create an Entity Type or Complex Typetab type the name of the Entity.

Name:Airlines

In the Import from ABAP Structure tab select the ABAP structure.

ABAP Structure:VBAK

What is OData in SAP? (11)

And press Next button.

What is OData in SAP? (12)

Check the required fields and press the Next button.

What is OData in SAP? (13)

Select VBLEN asakey field in the table and presstheFinishbutton.

What is OData in SAP? (14)

Click the “Generate” button.

Then Model Provider Class andData Provider Classwill be generated automatically by the system.

What is OData in SAP? (15)

Press the Tick button.

Step5: Go to Transaction code/N/IWFND/MAINT_SERVICE

What is OData in SAP? (16)

Step6: Click on Add Service button.

What is OData in SAP? (17)

Step7: On the Add Selected Servicesscreen fill in the required information.

System Alias: LOCAL

Technical Service Name:Z_ODATA_SRV

External Service Name:Z_ODATA_SRV

What is OData in SAP? (18)

And press the Get Services button.

Step8: In the Add Selected Servicesscreen check the service and press the Add Selected Servicesbutton.

What is OData in SAP? (19)

Step9: Now the Add Servicesscreen comes, select the package or just use the Local object and press the tick button.

What is OData in SAP? (20)

An Information message will be shown where it will confirm about the service is created and metadata loaded successfully

What is OData in SAP? (21)

Step10:In the Activate and Maintain ServicesScreen press SAP Gateway Client button.

What is OData in SAP? (22)

Step12: In the SAP Gateway Clientpress the Executebutton.

What is OData in SAP? (23)

What is OData in SAP? (24)

What is OData in SAP? (2024)
Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6569

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.