SlideShare a Scribd company logo
1 of 42
Download to read offline
OData
An Introduction and Examples
© 2012 SAP AG. All rights reserved. 2
Agenda
Why We Need OData
A Basic Introduction to OData
Structure of an OData Service
OData Operations
OData Query Language
© 2012 SAP AG. All rights reserved. 3
SAP’s Aim
One
SAP
Thousands
(non) SAP developers
One billion
consumers
Provides
 Server infrastructures,
multiple platforms
 SDKs & libraries
 App. dev. frameworks
 Business applications
 Enterprise quality
 Data security
Add
 Scale application
development
 Idea creators
 Web style apps
 Limited ABAP and SAP
process knowhow
Need
 Consumer–level user
experience
 Enterprise quality
 Data security
 Task-centric
 Web style & mobile apps
© 2012 SAP AG. All rights reserved. 4
Market and Industry Trends
Server Services
Data Silos Open Data
Isolated Data
Isolated Services
Linked Data
and Services
Web
Documents
Web APIs
© 2012 SAP AG. All rights reserved. 6
Agenda
Why We Need OData
A Basic Introduction to OData
Structure of an OData Service
OData Operations
OData Query Language
© 2012 SAP AG. All rights reserved. 7
OData at a Glance
URIs for resource identification
Uniform operations, defined by HTTP
• GET, POST, PUT, PATCH, DELETE always mean the same
Well known data formats
• AtomPub & JSON
Query language  “ODBC for the Web”
Schema information  Data model description
Based on entity and relationship model
Hypermedia design patterns
© 2012 SAP AG. All rights reserved. 8
Agenda
Why We Need OData
A Basic Introduction to OData
Structure of an OData Service
OData Operations
OData Query Language
© 2012 SAP AG. All rights reserved. 9
First OData Example: The Service Document
OData service root URI:
http://services.odata.org/OData/OData.svc/
© 2012 SAP AG. All rights reserved. 10
First OData Example: The Service Metadata Document
OData service root URI:
http://services.odata.org/OData/OData.svc/
OData service metadata URI :=
<OData service root URI> + “$metadata”
http://services.odata.org/OData/OData.svc/$metadata
© 2012 SAP AG. All rights reserved. 11
The OData Meta Model
Entity Type
Navigation
Property
Property Type
Simple Type
Complex
Type
Entity Set
Entity
*
*
1..*
1..*
1
*
Entity Key
1..*
1
Association
2
*
Entity
Container
Service
Document
Function
Import *
1
Describes
structure of
1
*
*
*
© 2012 SAP AG. All rights reserved. 12
Entity Type
Navigation
Property
Property Type
Simple Type
Complex
Type
Entity Set
Entity
*
*
1..*
1..*
1
*
Entity Key
1..*
1
Association
2
*
Entity
Container
Service
Document
Function
Import *
1
Describes
structure of
1
*
*
*
The OData Meta Model
© 2012 SAP AG. All rights reserved. 13
Entity Type
Navigation
Property
Property Type
Simple Type
Complex
Type
Entity Set
Entity
*
*
1..*
1..*
1
*
Entity Key
1..*
1
Association
2
*
Entity
Container
Service
Document
Function
Import *
1
Describes
structure of
1
*
*
*
The OData Meta Model
© 2012 SAP AG. All rights reserved. 14
Entity Type
Navigation
Property
Property Type
Simple Type
Complex
Type
Entity Set
Entity
*
*
1..*
1..*
1
*
Entity Key
1..*
1
Association
2
*
Entity
Container
Service
Document
Function
Import *
1
Describes
structure of
1
*
*
*
The OData type system
© 2012 SAP AG. All rights reserved. 15
Agenda
Why We Need OData
A Basic Introduction to OData
Structure of an OData Service
OData Operations
OData Query Language
© 2012 SAP AG. All rights reserved. 16
http://services.odata.org/OData/OData.svc/Products/?$top=3
© 2012 SAP AG. All rights reserved. 17
http://services.odata.org/OData/OData.svc/Products(0)
© 2012 SAP AG. All rights reserved. 18
http://services.odata.org/OData/OData.svc/Products(0)/Category
© 2012 SAP AG. All rights reserved. 19
http://services.odata.org/OData/OData.svc/Products(0)/Supplier
© 2012 SAP AG. All rights reserved. 20
CRUD Operations
Operation on resource HTTP verb
Create POST
Read GET
Update PUT
Delete DELETE
© 2012 SAP AG. All rights reserved. 21
<ServiceRootURI>$batch
Entity Type
Navigation
Property
Property Type
Simple Type
Complex
Type
Entity Set
Entity
*
*
1..*
1..*
1
*
Entity Key
1..*
1
Association
2
*
Entity
Container
Service
Document
Function
Import *
1
Describes
structure of
1
*
*
*
CRUD Operations
POST $batch(multiple requests) : multiple responses
GET() : entry
PUT(etag, entry) : nil
PATCH(etag, partial entry) : nil
DELETE() : nil
GET() : feed
POST(entry) : entry
© 2012 SAP AG. All rights reserved. 22
Entity Type
Navigation
Property
Property Type
Simple Type
Complex
Type
Entity Set
Entity
*
*
1..*
1..*
1
*
Entity Key
1..*
1
Association
2
*
Entity
Container
Service
Document
Function
Import *
1
Describes
structure of
1
*
*
*
OData beyond CRUD operations
…
http://services.odata.org/OData/OData.svc/GetProductsByRating?rating=4
© 2012 SAP AG. All rights reserved. 23
http://services.odata.org/OData/OData.svc/GetProductsByRating?rating=4
© 2012 SAP AG. All rights reserved. 24
Agenda
Why We Need OData
A Basic Introduction to OData
Structure of an OData Service
OData Operations
OData Query Language
© 2012 SAP AG. All rights reserved. 25
“ODBC” for the Web - Simple Query Language
List of (most important) Query options:
Reference: http://www.odata.org/developers/protocols/uri-conventions#QueryStringOptions
Operation Query option
Filtering $filter
Projecting $select
Sorting $orderby
Paging $top and $skip
Inlining $expand
© 2012 SAP AG. All rights reserved. 26
“ODBC” for the Web - Simple Query Language
Filtering  $filter
http://services.odata.org/OData/OData.svc/Products/?$filter=Price le 20
• All products with a price that is less than or equal to 20.
Projecting  $select
http://services.odata.org/OData/OData.svc/Products?$select=Price,Name
• In a response from an OData service, only the Price and Name Property values
are returned for each Product Entry in the Collection of products identified.
© 2012 SAP AG. All rights reserved. 27
“ODBC” for the Web - Simple Query Language
Sorting  $orderby
http://services.odata.org/OData/OData.svc/Products?$orderby=Rating asc
• All Product Entries returned in ascending order when sorted by the Rating
Property.
© 2012 SAP AG. All rights reserved. 28
“ODBC” for the Web - Simple Query Language
Paging  $top and $skip
http://services.odata.org/OData/OData.svc/Products?$top=5
• The first 5 Product Entries are returned where the Set of Products is sorted using a scheme
determined by the OData service.
http://services.odata.org/OData/OData.svc/Products?$top=5&$orderby=Name desc
• The first 5 Product Entries are returned in descending order when sorted by the Name
property.
http://services.odata.org/OData/OData.svc/Categories(1)/Products?$skip=2
• The set of Product Entries (associated with the Category Entry identified by key value 1)
starting with the third product.
Typical Programming Patterns
for UI-Centric Applications
© 2012 SAP AG. All rights reserved. 30
$filter and $select
Use cases:
Get all business partners whose company
name starts with the letter ‘S’.
Get all sales orders with a total sum
exceeding than 10,000 €.
Get the business partner ID and the name
of a business partner only.
ID Name
0100 SAP
0141 South American IT
Company
0142 Siwusha
0143 Sorali
Business Partners (4)
t 1 2 3 4 5 u 01/04
S*
© 2012 SAP AG. All rights reserved. 31
Query Options: $filter & $select
Request:
GET …/BusinessPartners?$filter=startswith(CompanyName,'S‘)&$select=BusinessPartnerID,CompanyName
Result
{
"BusinessPartnerID": "0100000000",
"CompanyName": "SAP„
},
{
"BusinessPartnerID": "0100000041",
"CompanyName": "South American IT Company“
},
{
"BusinessPartnerID": "0100000042",
"CompanyName": "Siwusha„
},
{
"BusinessPartnerID": "0100000044",
"CompanyName": "Sorali„
}
SQL analogy:
SELECT BusinessPartnerID CompanyName
FROM BusinessPartners
WHERE CompanyName LIKE ‘S%‘
© 2012 SAP AG. All rights reserved. 32
Paged Results
ID Name
0100 SAP
0101 Becker Berlin
0102 DelBont Industries
0103 Talpa
0104 Panorama Studios
0105 TECUM
t 1 2 3 4 5 u 01/06
ID Name
0106 Asia High tech
0107 Laurent
0108 AVANTEL
0109 Telecomunicaciones
Star
0110 Pear Computing
Services
0111 Alpine Systems
Business Partners (45) Business Partners (45)
t 1 2 3 4 5 u 07/12
ID Name
0112 New Line Design
0113 HEPA Tec
0114 Telecomunicaciones
Star
0115 Anav Ideon
0116 Mexican Oil Trading
Company
0117 Meliva
Business Partners (45)
t 1 2 3 4 5 u 13/18
Use case:
Tell the user that just 6 out of
45 entries are displayed.
Show a list in a paged view.
Get the first 5 entries of a
list only.
Avoid scrolling through long
lists in mobile applications.
© 2012 SAP AG. All rights reserved. 33
Query Options: $top and $inlinecount
ID Name
0100 SAP
0101 Becker Berlin
0102 DelBont Industries
0103 Talpa
0104 Panorama Studios
0105 TECUM
t 1 2 3 4 5 u 01/06
Business Partners
(45)
/BusinessPartners? $top=6 & $inlinecount=allpages &$select=BusinessPartnerID,CompanyName & $skip=6
Client side paging:
Only limited amount of
data has to be
transferred
© 2012 SAP AG. All rights reserved. 34
Query Options: $top and $inlinecount and $skip
ID Name
0100 SAP
0101 Becker Berlin
0102 DelBont Industries
0103 Talpa
0104 Panorama Studios
0105 TECUM
t 1 2 3 4 5 u 01/06
ID Name
0106 Asia High tech
0107 Laurent
0108 AVANTEL
0109 Telecomunicaciones
Star
0110 Pear Computing
Services
0111 Alpine Systems
Business Partners
(45)
Business Partners
(45)
t 1 2 3 4 5 u 07/12
/BusinessPartners? $top=6 & $inlinecount=allpages & $select=BusinessPartnerID,CompanyName & $skip=6
© 2012 SAP AG. All rights reserved. 35
Query Options: $top and $inlinecount and $skip
ID Name
0100 SAP
0101 Becker Berlin
0102 DelBont Industries
0103 Talpa
0104 Panorama Studios
0105 TECUM
t 1 2 3 4 5 u 01/06
ID Name
0106 Asia High tech
0107 Laurent
0108 AVANTEL
0109 Telecomunicaciones
Star
0110 Pear Computing
Services
0111 Alpine Systems
Business Partners
(45)
Business Partners
(45)
t 1 2 3 4 5 u 07/12
ID Name
0112 New Line Design
0113 HEPA Tec
0114 Telecomunicaciones
Star
0115 Anav Ideon
0116 Mexican Oil Trading
Company
0117 Meliva
Business Partners
(45)
t 1 2 3 4 5 u 13/18
/BusinessPartners? $top=6 & $inlinecount=allpages & $select=BusinessPartnerID,CompanyName & $skip=12
© 2012 SAP AG. All rights reserved. 36
Navigation Properties
EDMX graphical model:
Service metadata document
ID 0100
Company
Name
SAP
Email karl.mueller
@sap.com
Adress Dietmar
Hopp Allee
16
69190
Walldorf
Phone Number +49 6227
…
Sales Orders u
Business Partner SAP
Details
© 2012 SAP AG. All rights reserved. 37
Navigation Properties
GET
/BusinessPartners('0100000000')/SalesOrd
ers ID 0100
Company
Name
SAP
Email karl.mueller
@sap.com
Adress Dietmar
Hopp Allee
16
69190
Walldorf
Phone Number +49 6227
…
Sales Orders u
Business Partner SAP
Details
ID Sum Status
0526 1137.64
EUR l
0527 1137.64
EUR l
0509 3972.22
EUR l
Sales Orders
Customer = SAP
results": [
{
"Currency": "EUR",
"Status": "N",
"SalesOrderID": "0500000026",
"TotalSum": "1137.64"
},
{
"Currency": "EUR",
"Status": "N",
"SalesOrderID": "0500000027",
"TotalSum": "1137.64"
},
{
"Currency": "EUR",
"Status": "N",
"SalesOrderID": "0500000009",
"TotalSum": "3972.22"
}
]
© 2012 SAP AG. All rights reserved. 39
$expand
Use cases for navigation properties
Get all sales orders of a business partner
Get all sales order items of a sales order
Get all sales orders and all sales order items of a business
partner
Example
Without $expand – 2 calls
• First call /BusinessPartners(1)
• Second call /BusinessPartners(1)/SalesOrders
With $expand – 1 call
• /BusinessPartners(1)?$expand=SalesOrders
SalesOrder
#n
SalesOrderItem #1
SalesOrderItem #2
SalesOrderItem #n
SalesOrder
#1
SalesOrderItem #1
SalesOrderItem #2
SalesOrderItem #n
BusinessPartner
#1
SalesOrder
#1
BusinessPartner
#2
© 2012 SAP AG. All rights reserved. 40
Deep Insert
Updates of hierarchical data
Example:
Create a sales order together with
sales order items in just one request.
SalesOrder
SalesOrderItem
#1
SalesOrderItem
#2
SalesOrderItem
#n
© 2012 SAP AG. All rights reserved. 41
Media Links
Use cases
Show product pictures
Upload pictures taken with device camera
© 2012 SAP AG. All rights reserved. 42
Media Links
Subtitle
Example
GET …/Products('HT-1040')
<entry>
<link href="Products('HT-1040')" rel="edit" title="Product"/>
<link href="Products('HT-1040')/$value" rel="edit-media" type="image/jpeg"/>
<content type="image/jpeg" src="/SAP/PUBLIC/BC/NWDEMO_MODEL/IMAGES/HT-1040.jpg"/>
<m:properties>
<d:ProductID>HT-1040</d:ProductID>
<d:Category>Laser printers</d:Category>
<d:Name>Laser Professional Eco</d:Name>
<d:Description>…</d:Description>
<d:ProductPicUrl>/SAP/PUBLIC/BC/NWDEMO_MODEL/IMAGES/HT-1040.jpg</d:ProductPicUrl>
<d:ProductPicUrlMimeType>image/jpeg</d:ProductPicUrlMimeType>
</m:properties>
</entry>
© 2012 SAP AG. All rights reserved. 43
For more information about the topics discussed in this lesson, see:
 http://www.odata.org
 Open Data Protocol by Example (focusing on the Atom protocol)
 http://blogs.msdn.com/b/lightswitch/archive/2012/03/22/lightswitch-
architecture-odata.aspx
Related Information
Thank You!

More Related Content

What's hot

What's hot (20)

Odata V4 : The New way to REST for Your Applications
Odata V4 : The New way to REST for Your Applications Odata V4 : The New way to REST for Your Applications
Odata V4 : The New way to REST for Your Applications
 
UI5Con presentation on UI5 OData V4 Model
UI5Con presentation on UI5 OData V4 ModelUI5Con presentation on UI5 OData V4 Model
UI5Con presentation on UI5 OData V4 Model
 
NetWeaver Gateway- Extend the Reach of SAP Applications
NetWeaver Gateway- Extend the Reach of SAP ApplicationsNetWeaver Gateway- Extend the Reach of SAP Applications
NetWeaver Gateway- Extend the Reach of SAP Applications
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
OData service from ABAP CDS
OData service from ABAP CDSOData service from ABAP CDS
OData service from ABAP CDS
 
OData and the future of business objects universes
OData and the future of business objects universesOData and the future of business objects universes
OData and the future of business objects universes
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
 
SAP HANA SPS10- SAP HANA Development Tools
SAP HANA SPS10- SAP HANA Development ToolsSAP HANA SPS10- SAP HANA Development Tools
SAP HANA SPS10- SAP HANA Development Tools
 
SAP HANA SPS10- Predictive Analysis Library and Application Function Modeler
SAP HANA SPS10- Predictive Analysis Library and Application Function ModelerSAP HANA SPS10- Predictive Analysis Library and Application Function Modeler
SAP HANA SPS10- Predictive Analysis Library and Application Function Modeler
 
SAP HANA Cloud – Virtual Bootcamp: How to use the HANA Persistence Se…
SAP HANA Cloud – Virtual Bootcamp: How to use the HANA Persistence Se…SAP HANA Cloud – Virtual Bootcamp: How to use the HANA Persistence Se…
SAP HANA Cloud – Virtual Bootcamp: How to use the HANA Persistence Se…
 
What's new for Text in SAP HANA SPS 11
What's new for Text in SAP HANA SPS 11What's new for Text in SAP HANA SPS 11
What's new for Text in SAP HANA SPS 11
 
SAP HANA SPS10- Series Data/ TimeSeries
SAP HANA SPS10- Series Data/ TimeSeriesSAP HANA SPS10- Series Data/ TimeSeries
SAP HANA SPS10- Series Data/ TimeSeries
 
SAP HANA SPS09 - Text Analysis
SAP HANA SPS09 - Text AnalysisSAP HANA SPS09 - Text Analysis
SAP HANA SPS09 - Text Analysis
 
SAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP HANA SPS10- Extended Application Services (XS) Programming ModelSAP HANA SPS10- Extended Application Services (XS) Programming Model
SAP HANA SPS10- Extended Application Services (XS) Programming Model
 
SAP HANA SPS10- Text Analysis & Text Mining
SAP HANA SPS10- Text Analysis & Text MiningSAP HANA SPS10- Text Analysis & Text Mining
SAP HANA SPS10- Text Analysis & Text Mining
 
SAP HANA SPS09 - HANA Modeling
SAP HANA SPS09 - HANA ModelingSAP HANA SPS09 - HANA Modeling
SAP HANA SPS09 - HANA Modeling
 
HANA SPS07 Text Analysis
HANA SPS07 Text AnalysisHANA SPS07 Text Analysis
HANA SPS07 Text Analysis
 
SAP HANA SPS10- SHINE
SAP HANA SPS10- SHINESAP HANA SPS10- SHINE
SAP HANA SPS10- SHINE
 
SAP HANA SPS10- SAP HANA Dynamic Tiering
SAP HANA SPS10- SAP HANA Dynamic TieringSAP HANA SPS10- SAP HANA Dynamic Tiering
SAP HANA SPS10- SAP HANA Dynamic Tiering
 

Similar to Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2

C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto SugishitaC13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
Insight Technology, Inc.
 
Primavera integration possibilities technical overview ppt
Primavera integration possibilities   technical overview pptPrimavera integration possibilities   technical overview ppt
Primavera integration possibilities technical overview ppt
p6academy
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
Sanjay Patel
 

Similar to Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2 (20)

Key Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresKey Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to Postgres
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
Document_format_for_OData_In_A_Nutshell.pdf
Document_format_for_OData_In_A_Nutshell.pdfDocument_format_for_OData_In_A_Nutshell.pdf
Document_format_for_OData_In_A_Nutshell.pdf
 
Introduction to OData and SAP NetWeaver Gateway.pptx
Introduction to OData and SAP NetWeaver Gateway.pptxIntroduction to OData and SAP NetWeaver Gateway.pptx
Introduction to OData and SAP NetWeaver Gateway.pptx
 
OData External Data Integration Strategies for SaaS
OData External Data Integration Strategies for SaaSOData External Data Integration Strategies for SaaS
OData External Data Integration Strategies for SaaS
 
W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...
W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...
W8/WP8 App Dev for SAP, Part 1B: Service Generation with NetWeaver Gateway Fr...
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developers
 
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto SugishitaC13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
C13,C33,A35 アプリケーション開発プラットフォームとしてのSAP HANA by Makoto Sugishita
 
Delivering Mobile Apps to the field using Oracle
Delivering Mobile Apps to the field using OracleDelivering Mobile Apps to the field using Oracle
Delivering Mobile Apps to the field using Oracle
 
SAP FIORI COEP Pune - pavan golesar (ppt)
SAP FIORI COEP Pune - pavan golesar (ppt)SAP FIORI COEP Pune - pavan golesar (ppt)
SAP FIORI COEP Pune - pavan golesar (ppt)
 
j2ee Building components
j2ee Building components j2ee Building components
j2ee Building components
 
SharePoint 2013 REST and CSOM
SharePoint 2013 REST  and CSOMSharePoint 2013 REST  and CSOM
SharePoint 2013 REST and CSOM
 
Primavera integration possibilities technical overview ppt
Primavera integration possibilities   technical overview pptPrimavera integration possibilities   technical overview ppt
Primavera integration possibilities technical overview ppt
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
 
B1 90 tb1300_01
B1 90 tb1300_01B1 90 tb1300_01
B1 90 tb1300_01
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
Creating Data Driven Web Apps with BIRT - Michael Williams
Creating Data Driven Web Apps with BIRT - Michael WilliamsCreating Data Driven Web Apps with BIRT - Michael Williams
Creating Data Driven Web Apps with BIRT - Michael Williams
 
SQLAnywhere 16.0 and Odata
SQLAnywhere 16.0 and OdataSQLAnywhere 16.0 and Odata
SQLAnywhere 16.0 and Odata
 
Melbourne Virtual MuleSoft Meetup November 2020
Melbourne Virtual MuleSoft Meetup November 2020Melbourne Virtual MuleSoft Meetup November 2020
Melbourne Virtual MuleSoft Meetup November 2020
 
Delivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JETDelivering Mobile Apps to the Field with Oracle JET
Delivering Mobile Apps to the Field with Oracle JET
 

More from SAP PartnerEdge program for Application Development

More from SAP PartnerEdge program for Application Development (20)

SAP HANA Cloud Platform Expert Session - SAP HANA Cloud Platform Analytics
SAP HANA Cloud Platform Expert Session - SAP HANA Cloud Platform AnalyticsSAP HANA Cloud Platform Expert Session - SAP HANA Cloud Platform Analytics
SAP HANA Cloud Platform Expert Session - SAP HANA Cloud Platform Analytics
 
SUSE Technical Webinar – Get started with creating Lumira CVOM extensions -- ...
SUSE Technical Webinar – Get started with creating Lumira CVOM extensions -- ...SUSE Technical Webinar – Get started with creating Lumira CVOM extensions -- ...
SUSE Technical Webinar – Get started with creating Lumira CVOM extensions -- ...
 
SUSE Technical Webinar – Get started with creating Design Studio extensions -...
SUSE Technical Webinar – Get started with creating Design Studio extensions -...SUSE Technical Webinar – Get started with creating Design Studio extensions -...
SUSE Technical Webinar – Get started with creating Design Studio extensions -...
 
SUSE Technical Webinar: Build HANA Apps in the Framework of the SAP and SUSE ...
SUSE Technical Webinar: Build HANA Apps in the Framework of the SAP and SUSE ...SUSE Technical Webinar: Build HANA Apps in the Framework of the SAP and SUSE ...
SUSE Technical Webinar: Build HANA Apps in the Framework of the SAP and SUSE ...
 
SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...
SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...
SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...
 
SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...
SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...
SUSE Technical Webinar: Developing Fiori & GWPAM Apps on HANA (SAP and SUSE C...
 
SUSE Technical Webinar: Build B1 apps in the Framework of the SAP and SUSE Ca...
SUSE Technical Webinar: Build B1 apps in the Framework of the SAP and SUSE Ca...SUSE Technical Webinar: Build B1 apps in the Framework of the SAP and SUSE Ca...
SUSE Technical Webinar: Build B1 apps in the Framework of the SAP and SUSE Ca...
 
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
 
SUSE Technical Webinar: Introduction to Business Intelligence - the SAP and S...
SUSE Technical Webinar: Introduction to Business Intelligence - the SAP and S...SUSE Technical Webinar: Introduction to Business Intelligence - the SAP and S...
SUSE Technical Webinar: Introduction to Business Intelligence - the SAP and S...
 
SUSE Technical Webinar: Build Cloud Apps with SAP HANA Cloud Platform
SUSE Technical Webinar: Build Cloud Apps with SAP HANA Cloud PlatformSUSE Technical Webinar: Build Cloud Apps with SAP HANA Cloud Platform
SUSE Technical Webinar: Build Cloud Apps with SAP HANA Cloud Platform
 
Partner with SAP to Develop Mobile apps and capture the Mobile Market Opportu...
Partner with SAP to Develop Mobile apps and capture the Mobile Market Opportu...Partner with SAP to Develop Mobile apps and capture the Mobile Market Opportu...
Partner with SAP to Develop Mobile apps and capture the Mobile Market Opportu...
 
Microsoft Technical Webinar: SAP Mobile Platform for Windows 8 and Windows Ph...
Microsoft Technical Webinar: SAP Mobile Platform for Windows 8 and Windows Ph...Microsoft Technical Webinar: SAP Mobile Platform for Windows 8 and Windows Ph...
Microsoft Technical Webinar: SAP Mobile Platform for Windows 8 and Windows Ph...
 
Microsoft Technical Webinar - New devices for Windows 8 and Windows Phone 8, ...
Microsoft Technical Webinar - New devices for Windows 8 and Windows Phone 8, ...Microsoft Technical Webinar - New devices for Windows 8 and Windows Phone 8, ...
Microsoft Technical Webinar - New devices for Windows 8 and Windows Phone 8, ...
 
Autodesk Technical Webinar: SAP Business One
Autodesk Technical Webinar: SAP Business OneAutodesk Technical Webinar: SAP Business One
Autodesk Technical Webinar: SAP Business One
 
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
Microsoft Technical Webinar: Doing more with MS Office, SharePoint and Visual...
 
Mobile Apps 4 Charity
Mobile Apps 4 CharityMobile Apps 4 Charity
Mobile Apps 4 Charity
 
Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - S...
Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - S...Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - S...
Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - S...
 
Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - P...
Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - P...Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - P...
Microsoft Technical Webinar: UX/UI Design for Windows 8 & Windows Phone 8 - P...
 
Autodesk Technical Webinar: SAP HANA in-memory database
Autodesk Technical Webinar: SAP HANA in-memory databaseAutodesk Technical Webinar: SAP HANA in-memory database
Autodesk Technical Webinar: SAP HANA in-memory database
 
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 3
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 3Autodesk Technical Webinar: SAP NetWeaver Gateway Part 3
Autodesk Technical Webinar: SAP NetWeaver Gateway Part 3
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Autodesk Technical Webinar: SAP NetWeaver Gateway Part 2

  • 2. © 2012 SAP AG. All rights reserved. 2 Agenda Why We Need OData A Basic Introduction to OData Structure of an OData Service OData Operations OData Query Language
  • 3. © 2012 SAP AG. All rights reserved. 3 SAP’s Aim One SAP Thousands (non) SAP developers One billion consumers Provides  Server infrastructures, multiple platforms  SDKs & libraries  App. dev. frameworks  Business applications  Enterprise quality  Data security Add  Scale application development  Idea creators  Web style apps  Limited ABAP and SAP process knowhow Need  Consumer–level user experience  Enterprise quality  Data security  Task-centric  Web style & mobile apps
  • 4. © 2012 SAP AG. All rights reserved. 4 Market and Industry Trends Server Services Data Silos Open Data Isolated Data Isolated Services Linked Data and Services Web Documents Web APIs
  • 5. © 2012 SAP AG. All rights reserved. 6 Agenda Why We Need OData A Basic Introduction to OData Structure of an OData Service OData Operations OData Query Language
  • 6. © 2012 SAP AG. All rights reserved. 7 OData at a Glance URIs for resource identification Uniform operations, defined by HTTP • GET, POST, PUT, PATCH, DELETE always mean the same Well known data formats • AtomPub & JSON Query language  “ODBC for the Web” Schema information  Data model description Based on entity and relationship model Hypermedia design patterns
  • 7. © 2012 SAP AG. All rights reserved. 8 Agenda Why We Need OData A Basic Introduction to OData Structure of an OData Service OData Operations OData Query Language
  • 8. © 2012 SAP AG. All rights reserved. 9 First OData Example: The Service Document OData service root URI: http://services.odata.org/OData/OData.svc/
  • 9. © 2012 SAP AG. All rights reserved. 10 First OData Example: The Service Metadata Document OData service root URI: http://services.odata.org/OData/OData.svc/ OData service metadata URI := <OData service root URI> + “$metadata” http://services.odata.org/OData/OData.svc/$metadata
  • 10. © 2012 SAP AG. All rights reserved. 11 The OData Meta Model Entity Type Navigation Property Property Type Simple Type Complex Type Entity Set Entity * * 1..* 1..* 1 * Entity Key 1..* 1 Association 2 * Entity Container Service Document Function Import * 1 Describes structure of 1 * * *
  • 11. © 2012 SAP AG. All rights reserved. 12 Entity Type Navigation Property Property Type Simple Type Complex Type Entity Set Entity * * 1..* 1..* 1 * Entity Key 1..* 1 Association 2 * Entity Container Service Document Function Import * 1 Describes structure of 1 * * * The OData Meta Model
  • 12. © 2012 SAP AG. All rights reserved. 13 Entity Type Navigation Property Property Type Simple Type Complex Type Entity Set Entity * * 1..* 1..* 1 * Entity Key 1..* 1 Association 2 * Entity Container Service Document Function Import * 1 Describes structure of 1 * * * The OData Meta Model
  • 13. © 2012 SAP AG. All rights reserved. 14 Entity Type Navigation Property Property Type Simple Type Complex Type Entity Set Entity * * 1..* 1..* 1 * Entity Key 1..* 1 Association 2 * Entity Container Service Document Function Import * 1 Describes structure of 1 * * * The OData type system
  • 14. © 2012 SAP AG. All rights reserved. 15 Agenda Why We Need OData A Basic Introduction to OData Structure of an OData Service OData Operations OData Query Language
  • 15. © 2012 SAP AG. All rights reserved. 16 http://services.odata.org/OData/OData.svc/Products/?$top=3
  • 16. © 2012 SAP AG. All rights reserved. 17 http://services.odata.org/OData/OData.svc/Products(0)
  • 17. © 2012 SAP AG. All rights reserved. 18 http://services.odata.org/OData/OData.svc/Products(0)/Category
  • 18. © 2012 SAP AG. All rights reserved. 19 http://services.odata.org/OData/OData.svc/Products(0)/Supplier
  • 19. © 2012 SAP AG. All rights reserved. 20 CRUD Operations Operation on resource HTTP verb Create POST Read GET Update PUT Delete DELETE
  • 20. © 2012 SAP AG. All rights reserved. 21 <ServiceRootURI>$batch Entity Type Navigation Property Property Type Simple Type Complex Type Entity Set Entity * * 1..* 1..* 1 * Entity Key 1..* 1 Association 2 * Entity Container Service Document Function Import * 1 Describes structure of 1 * * * CRUD Operations POST $batch(multiple requests) : multiple responses GET() : entry PUT(etag, entry) : nil PATCH(etag, partial entry) : nil DELETE() : nil GET() : feed POST(entry) : entry
  • 21. © 2012 SAP AG. All rights reserved. 22 Entity Type Navigation Property Property Type Simple Type Complex Type Entity Set Entity * * 1..* 1..* 1 * Entity Key 1..* 1 Association 2 * Entity Container Service Document Function Import * 1 Describes structure of 1 * * * OData beyond CRUD operations … http://services.odata.org/OData/OData.svc/GetProductsByRating?rating=4
  • 22. © 2012 SAP AG. All rights reserved. 23 http://services.odata.org/OData/OData.svc/GetProductsByRating?rating=4
  • 23. © 2012 SAP AG. All rights reserved. 24 Agenda Why We Need OData A Basic Introduction to OData Structure of an OData Service OData Operations OData Query Language
  • 24. © 2012 SAP AG. All rights reserved. 25 “ODBC” for the Web - Simple Query Language List of (most important) Query options: Reference: http://www.odata.org/developers/protocols/uri-conventions#QueryStringOptions Operation Query option Filtering $filter Projecting $select Sorting $orderby Paging $top and $skip Inlining $expand
  • 25. © 2012 SAP AG. All rights reserved. 26 “ODBC” for the Web - Simple Query Language Filtering  $filter http://services.odata.org/OData/OData.svc/Products/?$filter=Price le 20 • All products with a price that is less than or equal to 20. Projecting  $select http://services.odata.org/OData/OData.svc/Products?$select=Price,Name • In a response from an OData service, only the Price and Name Property values are returned for each Product Entry in the Collection of products identified.
  • 26. © 2012 SAP AG. All rights reserved. 27 “ODBC” for the Web - Simple Query Language Sorting  $orderby http://services.odata.org/OData/OData.svc/Products?$orderby=Rating asc • All Product Entries returned in ascending order when sorted by the Rating Property.
  • 27. © 2012 SAP AG. All rights reserved. 28 “ODBC” for the Web - Simple Query Language Paging  $top and $skip http://services.odata.org/OData/OData.svc/Products?$top=5 • The first 5 Product Entries are returned where the Set of Products is sorted using a scheme determined by the OData service. http://services.odata.org/OData/OData.svc/Products?$top=5&$orderby=Name desc • The first 5 Product Entries are returned in descending order when sorted by the Name property. http://services.odata.org/OData/OData.svc/Categories(1)/Products?$skip=2 • The set of Product Entries (associated with the Category Entry identified by key value 1) starting with the third product.
  • 28. Typical Programming Patterns for UI-Centric Applications
  • 29. © 2012 SAP AG. All rights reserved. 30 $filter and $select Use cases: Get all business partners whose company name starts with the letter ‘S’. Get all sales orders with a total sum exceeding than 10,000 €. Get the business partner ID and the name of a business partner only. ID Name 0100 SAP 0141 South American IT Company 0142 Siwusha 0143 Sorali Business Partners (4) t 1 2 3 4 5 u 01/04 S*
  • 30. © 2012 SAP AG. All rights reserved. 31 Query Options: $filter & $select Request: GET …/BusinessPartners?$filter=startswith(CompanyName,'S‘)&$select=BusinessPartnerID,CompanyName Result { "BusinessPartnerID": "0100000000", "CompanyName": "SAP„ }, { "BusinessPartnerID": "0100000041", "CompanyName": "South American IT Company“ }, { "BusinessPartnerID": "0100000042", "CompanyName": "Siwusha„ }, { "BusinessPartnerID": "0100000044", "CompanyName": "Sorali„ } SQL analogy: SELECT BusinessPartnerID CompanyName FROM BusinessPartners WHERE CompanyName LIKE ‘S%‘
  • 31. © 2012 SAP AG. All rights reserved. 32 Paged Results ID Name 0100 SAP 0101 Becker Berlin 0102 DelBont Industries 0103 Talpa 0104 Panorama Studios 0105 TECUM t 1 2 3 4 5 u 01/06 ID Name 0106 Asia High tech 0107 Laurent 0108 AVANTEL 0109 Telecomunicaciones Star 0110 Pear Computing Services 0111 Alpine Systems Business Partners (45) Business Partners (45) t 1 2 3 4 5 u 07/12 ID Name 0112 New Line Design 0113 HEPA Tec 0114 Telecomunicaciones Star 0115 Anav Ideon 0116 Mexican Oil Trading Company 0117 Meliva Business Partners (45) t 1 2 3 4 5 u 13/18 Use case: Tell the user that just 6 out of 45 entries are displayed. Show a list in a paged view. Get the first 5 entries of a list only. Avoid scrolling through long lists in mobile applications.
  • 32. © 2012 SAP AG. All rights reserved. 33 Query Options: $top and $inlinecount ID Name 0100 SAP 0101 Becker Berlin 0102 DelBont Industries 0103 Talpa 0104 Panorama Studios 0105 TECUM t 1 2 3 4 5 u 01/06 Business Partners (45) /BusinessPartners? $top=6 & $inlinecount=allpages &$select=BusinessPartnerID,CompanyName & $skip=6 Client side paging: Only limited amount of data has to be transferred
  • 33. © 2012 SAP AG. All rights reserved. 34 Query Options: $top and $inlinecount and $skip ID Name 0100 SAP 0101 Becker Berlin 0102 DelBont Industries 0103 Talpa 0104 Panorama Studios 0105 TECUM t 1 2 3 4 5 u 01/06 ID Name 0106 Asia High tech 0107 Laurent 0108 AVANTEL 0109 Telecomunicaciones Star 0110 Pear Computing Services 0111 Alpine Systems Business Partners (45) Business Partners (45) t 1 2 3 4 5 u 07/12 /BusinessPartners? $top=6 & $inlinecount=allpages & $select=BusinessPartnerID,CompanyName & $skip=6
  • 34. © 2012 SAP AG. All rights reserved. 35 Query Options: $top and $inlinecount and $skip ID Name 0100 SAP 0101 Becker Berlin 0102 DelBont Industries 0103 Talpa 0104 Panorama Studios 0105 TECUM t 1 2 3 4 5 u 01/06 ID Name 0106 Asia High tech 0107 Laurent 0108 AVANTEL 0109 Telecomunicaciones Star 0110 Pear Computing Services 0111 Alpine Systems Business Partners (45) Business Partners (45) t 1 2 3 4 5 u 07/12 ID Name 0112 New Line Design 0113 HEPA Tec 0114 Telecomunicaciones Star 0115 Anav Ideon 0116 Mexican Oil Trading Company 0117 Meliva Business Partners (45) t 1 2 3 4 5 u 13/18 /BusinessPartners? $top=6 & $inlinecount=allpages & $select=BusinessPartnerID,CompanyName & $skip=12
  • 35. © 2012 SAP AG. All rights reserved. 36 Navigation Properties EDMX graphical model: Service metadata document ID 0100 Company Name SAP Email karl.mueller @sap.com Adress Dietmar Hopp Allee 16 69190 Walldorf Phone Number +49 6227 … Sales Orders u Business Partner SAP Details
  • 36. © 2012 SAP AG. All rights reserved. 37 Navigation Properties GET /BusinessPartners('0100000000')/SalesOrd ers ID 0100 Company Name SAP Email karl.mueller @sap.com Adress Dietmar Hopp Allee 16 69190 Walldorf Phone Number +49 6227 … Sales Orders u Business Partner SAP Details ID Sum Status 0526 1137.64 EUR l 0527 1137.64 EUR l 0509 3972.22 EUR l Sales Orders Customer = SAP results": [ { "Currency": "EUR", "Status": "N", "SalesOrderID": "0500000026", "TotalSum": "1137.64" }, { "Currency": "EUR", "Status": "N", "SalesOrderID": "0500000027", "TotalSum": "1137.64" }, { "Currency": "EUR", "Status": "N", "SalesOrderID": "0500000009", "TotalSum": "3972.22" } ]
  • 37. © 2012 SAP AG. All rights reserved. 39 $expand Use cases for navigation properties Get all sales orders of a business partner Get all sales order items of a sales order Get all sales orders and all sales order items of a business partner Example Without $expand – 2 calls • First call /BusinessPartners(1) • Second call /BusinessPartners(1)/SalesOrders With $expand – 1 call • /BusinessPartners(1)?$expand=SalesOrders SalesOrder #n SalesOrderItem #1 SalesOrderItem #2 SalesOrderItem #n SalesOrder #1 SalesOrderItem #1 SalesOrderItem #2 SalesOrderItem #n BusinessPartner #1 SalesOrder #1 BusinessPartner #2
  • 38. © 2012 SAP AG. All rights reserved. 40 Deep Insert Updates of hierarchical data Example: Create a sales order together with sales order items in just one request. SalesOrder SalesOrderItem #1 SalesOrderItem #2 SalesOrderItem #n
  • 39. © 2012 SAP AG. All rights reserved. 41 Media Links Use cases Show product pictures Upload pictures taken with device camera
  • 40. © 2012 SAP AG. All rights reserved. 42 Media Links Subtitle Example GET …/Products('HT-1040') <entry> <link href="Products('HT-1040')" rel="edit" title="Product"/> <link href="Products('HT-1040')/$value" rel="edit-media" type="image/jpeg"/> <content type="image/jpeg" src="/SAP/PUBLIC/BC/NWDEMO_MODEL/IMAGES/HT-1040.jpg"/> <m:properties> <d:ProductID>HT-1040</d:ProductID> <d:Category>Laser printers</d:Category> <d:Name>Laser Professional Eco</d:Name> <d:Description>…</d:Description> <d:ProductPicUrl>/SAP/PUBLIC/BC/NWDEMO_MODEL/IMAGES/HT-1040.jpg</d:ProductPicUrl> <d:ProductPicUrlMimeType>image/jpeg</d:ProductPicUrlMimeType> </m:properties> </entry>
  • 41. © 2012 SAP AG. All rights reserved. 43 For more information about the topics discussed in this lesson, see:  http://www.odata.org  Open Data Protocol by Example (focusing on the Atom protocol)  http://blogs.msdn.com/b/lightswitch/archive/2012/03/22/lightswitch- architecture-odata.aspx Related Information