Sie sind auf Seite 1von 38

Week 4 Unit 1: Review

Review
OData Basics

OData Data Model


Organize/describe data with Entity
Data Model (EDM)

OData Protocol
REST-based create, read, update,
and delete + OData-defined query
language

Client Libraries
Pre-built libraries to request OData
and display results

OData Services
Exposes an end point that allows
access to data in the SAP HANA
database

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Review
OData Capabilities in SAP HANA

Aggregation
Use functions to aggregate columns

Associations
Express relationships between entities

Key Specification
EntityType denotes a set of properties
forming a unique key

Parameter Entity Sets


Input parameters for SAP HANA
calculation views and analytic views

Property Projection
Restrict the number of selected
columns to expose

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Review
OData Development Process

Data End Point


Define which data to expose
(for example, table)

OData Service Definition


Define mechanism to expose
authorized data

UI Call to OData Service


Link UI table view to the OData
service

OData Display/Test
URL filters: $top, $format,
$orderby, $filter, $select

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Thank you

Contact information:
open@sap.com

2014 SAP SE or an SAP affiliate company.


All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Week 4 Unit 2:
SAPUI5 Consumption

SAPUI5 Consumption
Overview

Enterprise-ready HTML5
rendering library

Completely client-side UI
Open and flexible
Web development skills
(HTML, CSS3, JavaScript)
Extensibility and theming
3rd party JavaScript integration
Targets multiple devices

Smartphone, tablet, desktop

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

SAPUI5 Consumption
OData Model

OData model is a JavaScript


library for simplifying OData
service consumption
Direct binding to several
SAPUI5 UI elements
Actions for
Create/Update/Delete
operations as well

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

SAPUI5 Consumption
Code Sample

var oModel = new sap.ui.model.odata.ODataModel(


"/sap/hana/democontent/epmNext/services/businessPartners.xsodata/",
true);

oTable.setModel(oModel);

oTable.bindRows("/BusinessPartners);

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Thank you

Contact information:
open@sap.com

2014 SAP SE or an SAP affiliate company.


All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Week 4 Unit 3: Associations and


the $expand Option

Associations and the $expand Option


Associations (1)

Multiple entities
Define multiple tables in
the service definition

Entity relationships
Define associations
between different table
entities

Association syntax
1:1 association between
tables
BusinessPartners
Addresses

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Associations and the $expand Option


Associations (2)

Multiple entities
Each entity can be listed
individually
Allows delayed loading of
child details until the
parent record is selected

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Associations and the $expand Option


$expand

$expand
Explode the child details and include
them inline
Syntax follows the navigates ID and
looks up the relationship dynamically
based upon the association

URL example
/BusinessPartners/?$expand=AddRef

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Thank you

Contact information:
open@sap.com

2014 SAP SE or an SAP affiliate company.


All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Week 4 Unit 4: Create, Update,


and Delete with Modification or
Validation Exits

Create, Update, and Delete with Modification or Validation Exits


Concepts

UIS

XSODATA
Low coding OData REST service generation
framework
Based upon existing tables and views
Create/Update/Deletion operations support
added in SPS 06

SAPUI5
XSODATA

XSJS

XSXMLA
SINA
HDBTable

HDBRole

CDS/HDBDD
SQLScript
SQL

AFL

Views
2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Create, Update, and Delete with Modification or Validation Exits


SQLScript Exits New in SPS 06

Processing exits can


reference SQLScript
procedures
Fixed input interface
with a definition that
must match the entity
definition of your
service
General output
parameter

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Create, Update, and Delete with Modification or Validation Exits


JavaScript Exits New in SPS 07

Processing exits can


reference xsjslib files
and specific
JavaScript functions
The database
connection and
temporary tables with
the before and after
values are passed to
this function

Particularly useful for


server-side validations
(but open for other
use cases too)

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Create, Update, and Delete with Modification or Validation Exits


SAPUI5 OData Model

SAPUI5 OData model


has actions for Create,
Update, Delete, which
build the necessary
request
XSODATA only supports
JSON bodies for
Create/Update/Delete
operations

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Thank you

Contact information:
open@sap.com

2014 SAP SE or an SAP affiliate company.


All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Week 4 Unit 5: Metadata and


OData4SAP Annotations

Metadata and OData4SAP Annotations


Metadata

$metadata exposes the


definition of the service and
all entities at runtime
Dynamic introspection from
service consumers
URL example:
/businessPartnersExt.xsodata
/$metadata

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Metadata and OData4SAP Annotations


Metadata and SAPUI5 OData Model

SAPUI5 OData model understands this metadata and exposes it as


its own object

For example: dynamically build table columns from this metadata

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Metadata and OData4SAP Annotations


OData4SAP Annotation

OData4SAP annotation in
the service definition adds
SAP-specific fields
sap:unit, sap:text, sap:label
When used with attribute or
analytic views, it allows
additional metadata such as
language-dependent column
descriptions

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Metadata and OData4SAP Annotations


OData4SAP Annotation and SAPUI5 OData Model

OData4SAP annotation extensions are available in the SAPUI5 OData


metadata model in the extensions array

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Thank you

Contact information:
open@sap.com

2014 SAP SE or an SAP affiliate company.


All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Week 4 Unit 6:
OData Batch Requests and Deep
Insert

OData Batch Requests and Deep Insert


$batch

For performance reasons,


multiple requests can be
sent to the server in a
special multi-part request
and the operation $batch
SAPUI5 OData model
supports batch operations

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

OData Batch Requests and Deep Insert


Content-ID

But what if you have relationships


between objects in a batch?

A deep insert means that data


from a parent object needs to be
used in the child
The Content-ID is used as a
placeholder within a changeset
No support in SAPUI5 OData
model yet

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

OData Batch Requests and Deep Insert


Association Exit

Associations can have Create exits as well


They allow linking objects with relationships in the association

They have a different signature to regular Create exits

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Thank you

Contact information:
open@sap.com

2014 SAP SE or an SAP affiliate company.


All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

2014 SAP SE or an SAP affiliate company. All rights reserved

Public

Das könnte Ihnen auch gefallen