Upload
others
View
12
Download
0
Embed Size (px)
Citation preview
Carsten Bonnen, Volker Drees, Andre Fischer, Ludwig Heinz,Karsten Strothmann
SAP" Gateway and OData
# Rheinwerk
Contents
Foreword by Bjdrn Goerke 19
Introduction 21
Acknowledgments 25
PART I Getting Started
1 Introduction to SAP Gateway 31
1.1 Modern Business Applications 32
1.1.1 User Interfaces 33
1.1.2 Infrastructures 40
1.2 SAP Gateway for Modern Business Applications 44
1.3 SAP Gateway in SAP S/4HANA 49
1.4 Installation and Deployment 50
1.4.1 Installation 51
1.4.2 Deployment 53
1.5 SAP Gateway and Related Products 57
1.5.1 SAP Fiori 58
1.5.2 SAP Cloud Platform, ABAP Environment 58
1.5.3 SAP Cloud Platform API Management 58
1.5.4 SAP Cloud Platform Integration 59
1.5.5 SAP Cloud Platform Portal and SAP Enterprise Portal 59
1.5.6 SAP Cloud Platform Mobile Services 60
1.5.7 SAP HANA 61
1.5.8 SAP Process Integration and SAP Process
Orchestration 62
1.5.9 SAP Business Warehouse 63
1.6 Summary 64
7
Contents
2 Introduction to OData 65
2.1 OData and REST 65
2.1.1 What Is REST? 65
2.1.2 What Is OData? 69
2.2 Structure of an OData Service 74
2.2.1 Service Document 78
2.2.2 Service Metadata Document 82
2.3 OData Operations 85
2.3.1 Create 85
2.3.2 Read 85
2.3.3 Update 87
2.3.4 Delete 88
2.4 OData Query Options 88
2.4.1 Filtering and Projecting ($filter and $select) 90
2.4.2 Sorting ($orderby) 94
2.4.3 Client-Side Paging ($top, $skip, and $inlinecount) 94
2.4.4 Counting ($count) 99
2.4.5 lnlining($expand) 99
2.4.6 Formatting ($format) 103
2.5 OData in SAP Solutions 106
2.5.1 Mobile Applications 108
2.5.2 SAP Fiori 108
2.5.3 SAP Jam 109
2.5.4 SAP Enterprise Portal 110
2.5.5 SAP Solution Manager 110
2.5.6 SAP HANA 110
2.5.7 SAP S/4HANA 113
2.5.8 SAP Cloud Platform 113
2.6 SAP Gateway OData Features 115
2.7 What's Different with OData 4.0? 119
2.7.1 JavaScript Object Notation Format 119
2.7.2 Powerful Query Language 121
2.7.3 Cross-Service Navigation 122
8
Contents
2.7.4 Actions and Functions 122
2.7.5 Vocabularies and Annotations 123
2.8 Summary 123
3 Architecture and Integration 125
3.1 Gateway Principles 125
3.2 SAP Gateway Architecture 127
3.2.1 Consumer Tier 130
3.2.2 SAP Gateway Tier 131
3.2.3 SAP Backend Tier 132
3.2.4 Add-On Structure Evolution 133
3.3 Integration with Other Technologies 138
3.3.1 Remote Function Call 139
3.3.2 Business Object Repository 139
3.3.3 Service Provider Infrastructure 139
3.3.4 SAP BW InfoCubes 140
3.3.5 Multidimensional Expressions 140
3.3.6 SAP BW Easy Query 141
3.3.7 Generic Interaction Layer 141
3.3.8 SAP Business Process Management 141
3.3.9 SAP Business Workflow 142
3.4 ABAP Programming Model for SAP Fiori 142
3.4.1 Architecture and Technology 143
3.4.2 SAPUI5 and SAP Fiori Elements 144
3.4.3 SAP Gateway and the ABAP Programming Model
for SAP Fiori 146
3.4.4 SAP HANA 151
3.4.5 Outlook 152
3.5 Summary 152
9
Contents
4 Deployment Options, Installation, and
Configuration 155
4.1 Introduction to SAP Gateway Deployment 155
4.1.1 Hub Deployment with Development in the
SAP Backend System 158
4.1.2 Hub Deployment with Development on the Hub 159
4.1.3 Embedded Deployment 161
4.1.4 SAP Cloud Platform OData Provisioning 163
4.1.5 Mixed Deployment Options 164
4.1.6 Deployment Options for SAP Fiori and SAP S/4HANA 166
4.1.7 Comparison of Deployment Options 169
4.2 Preparing for Installation and Configuration 170
4.3 Quick Start Guide 173
4.3.1 Step 1: Deploy the SAP Gateway Add-Ons for Older
SAP NetWeaver Versions 174
4.3.2 Step 2: Activate SAP Gateway 174
4.3.3 Step 3: Create an SAP System Alias 175
4.3.4 Step 4: Create an SAP Gateway Alias 176
4.3.5 Step 5: Activate the OPU Node 178
4.3.6 Step 6: Test Your Settings 179
4.4 Installation and Configuration in Detail 180
4.4.1 Installing the SAP Gateway Add-Ons 181
4.4.2 Basic Configuration Settings 182
4.4.3 OData Channel Configuration 184
4.4.4 Business Enablement Provisioning Configuration 190
4.4.5 Smoke Testing 191
4.5 Summary 193
PART II Service Creation
5 Introduction to OData Service Creation 197
5.1 Methods for Creating an OData Service 198
10
5.2 Service Creation Process Overview 201
5.3 SAP Gateway Toolset 205
5.3.1 Service Builder 205
5.3.2 Supporting Tools during the Service Creation Process 207
5.3.3 ABAP Development Tools for SAP NetWeaver and
CDS Views 213
5.4 Steps in the Service Creation Process 215
5.4.1 Data Model Definition in the Service Builder 215
5.4.2 Service Registration in the SAP Backend System 218
5.4.3 Service Implementation 220
5.4.4 Service Maintenance 226
5.4.5 Service Generation via Redefinition 227
5.4.6 Service Generation via Referenced Data Sources 235
5.4.7 Service Generation via OData.publish-.true 236
5.5 OData Channel Development Paradigm 236
5.5.1 Model Provider Class 237
5.5.2 Data Provider Class and Data Provider Extension Class .... 240
5.5.3 Technical Considerations 242
5.6 Summary 243
6 Service Development 245
6.1 Data Model Definition 246
6.1.1 Creating a Project 247
6.1.2 Creating a Data Model 250
6.2 Service Registration 276
6.3 Service Stub Generation 282
6.4 Service Maintenance 284
6.5 Incremental Service Implementation and Model
Enhancement 289
6.5.1 Feed (GET_ENTITYSET) 291
6.5.2 Single Read (GET_ENTITY) 2966.5.3 Query Options 299
Contents
6.5.4 Navigation Properties 309
6.5.5 Create, Update, and Delete Methods 316
6.5.6 Function Imports 326
6.5.7 Media Resources 333
6.5.8 Expand/Self-Expand 345
6.5.9 Deep Insert 354
6.5.10 Batch 358
6.5.11 Add Ul Annotations 363
6.6 Summary 370
7 Service Generation 371
7.1 Generation via RFC/BOR Interface 374
7.1.1 Data Model Definition 377
7.1.2 Service Registration: Stub Creation 382
7.1.3 Service Maintenance 383
7.1.4 Service Implementation.- SalesOrderHeaderSet 385
7.1.5 Service Implementation: SalesOrderLineltemSet 399
7.2 Generation via Search Help 410
7.3 Generation via Redefinition 413
7.3.1 SAP BW Easy Query 416
7.3.2 Service Provider Interface 425
7.4 Summary 432
8 ABAP Programming Model for SAP Fiori 435
8.1 Development of CDS Views 437
8.2 Modeled Data Sources 445
8.3 Reference Data Sources 450
8.4 Adding Annotations to an OData Service 456
8.5 ABAP Programming Model for SAP Fiori with Classic APIs 459
12
Contents
8.6 ABAP Programming Model for SAP Fiori with BOPF 470
8.6.1 Defining the Business Object 471
8.6.2 Defining the Consumption View 476
8.6.3 Determinations, Validations, and Actions 480
8.6.4 Draft Support 483
8.7 ABAP RESTful Programming Model 484
8.8 Summary 502
PART III Application Development
9 SAPUI5 Application Development 505
9.1 Building Blocks of Web Application Development 506
9.2 Introduction to SAP Fiori and SAPUI5 507
9.2.1 SAP Fiori 507
9.2.2 SAPUI5 512
9.3 Installing SAPUI5 514
9.4 Creating an SAPUI5 Application 516
9.4.1 Manual Creation 517
9.4.2 Using the Eclipse Development Environment 519
9.5 Summary 524
10 SAP Web IDE 525
10.1 Installation and Access 526
10.1.1 Installing On-Premise via the SAP Web IDE,
Personal Edition 527
10.1.2 Accessing On-Demand via SAP Web IDE Full-Stack 530
10.2 Connecting to SAP Gateway 536
10.2.1 Connectingthe Local Installation to SAP Gateway 536
13
Contents
10.2.2 Connecting SAP Web IDE Full-Stack on SAP Cloud
Platform to SAP Gateway 538
10.3 OData Sample Services 539
10.4 Developing SAPUI5 Applications 542
10.5 SAP Fiori Reference Apps 548
10.6 OData Model Editor 550
10.6.1 Activating the OData Model Editor 551
10.6.2 Browse Services via the OData Model Editor 553
10.7 Summary 554
11 Extensibility 555
11.1 Redefining and Extending OData Services 555
11.1.1 Redefinition 556
11.1.2 Field Extensibility 561
11.1.3 Node Extensibility 561
11.2 Extending SAPUI5 Applications 562
11.3 Extending SAP Fiori Applications 564
11.3.1 Extending the OData Service 566
11.3.2 Extending the SAPUI5 Application 593
11.4 Extending SAP S/4HANA Cloud 604
11.4.1 Extensibility Concepts for SAP S/4HANA Cloud 605
11.4.2 SAP S/4HANA Cloud Key User Extensibility 606
11.5 Summary 609
12 Mobile Application Development en
12.1 Overview 612
12.2 Native Application Development 614
12.2.1 SAP Cloud Platform SDK for iOS 615
12.2.2 SAP Cloud Platform SDK for Android 621
14
Contents
12.3 Hybrid Application Development 629
12.3.1 Activate SAP Web IDE Full-Stack Feature 630
12.3.2 Create a Hybrid Android Application 633
12.4 Summary 639
13 Social Media Application Development 64i
13.1 PHP 642
13.2 Facebook 646
13.3 Twitter 655
13.4 Sina Weibo (§f) 661
13.5 Summary 673
14 Enterprise Application Development 675
14.1 Microsoft Excel 676
14.1.1 PowerPivot 676
14.1.2 $format=xlsx 682
14.2 Microsoft SharePoint/Office 365 683
14.3 Microsoft Visual C# Windows Desktop 692
14.4 Microsoft Active Server Pages (ASP) .NET 698
14.5 Summary 699
PART IV Administration
15 Lifecycle Management: Testing, Service
Deployment, and Operations 703
15.1 Testing 704
15
Contents
15.1.1 Testing SAP Gateway Services 705
15.1.2 Testing a Client Application 709
15.1.3 Best Practices for Testing in SAP Gateway 711
15.2 Service Deployment 713
15.2.1 Transport of Repository Objects between
SAP Backend Systems 714
15.2.2 Transport of Repository Objects and Customizing
Entries between SAP Gateway Server Systems 716
15.2.3 Versioning 719
15.2.4 Activate and Maintain Services 720
15.2.5 OData 4.0 Service Deployment 721
15.3 Operations 724
15.3.1 Periodic Cleanup Tasks 724
15.3.2 Monitoring Overview 725
15.4 Summary 733
16 Security 735
16.1 Network and Communication Security 735
16.1.1 Transport Protection 736
16.1.2 Input Validation 739
16.2 User Management and Authorizations 745
16.3 Single Sign-On and Authentication Options 747
16.3.1 Basic Authentication 749
16.3.2 SAP Logon Tickets with SAP Enterprise Portal 750
16.3.3 X.509 Client Certificates 751
16.3.4 SAML 2.0 Browser Protocol 752
16.3.5 OAuth 755
16.3.6 Kerberos: Integrated Windows Authentication 756
16.4 Recommended Authentication Options 757
16.4.1, HTM1,5 Web Application 758
,16.4.2 Desktop Application 759
16.4.3 Mobile Application (Direct Access) 761
16
Contents
16.4.4 Cloud 763
16.4.5 SAP Cloud Platform Mobile Services 764
16.4.6 Web Server 766
16.4.7 Business-to-Consumer Scenario 766
16.5 Read Access Logging 772
16.6 Summary 775
PART V Roadmap
17 Recent and Future Developments 779
17.1 SAP Gateway and Cloud Computing 779
17.2 Gamification 783
17.3 Internet of Things 784
17.4 Summary 786
Appendices 787
A Advanced Topics 787
A.l Connecting Multiple SAP Backend Systems 787
A.2 Configuring Notifications in SAP Gateway 795
A.3 Using the Error Log 804
A.4 Analyzing Performance and SAP Gateway Statistics 811
A.5 Delta Query Support in Offline Scenarios 816
A.6 Server-Side Caching 821
A.7 Summary 822
B The Authors 823
Index 827
17