Table of Contents

Open all
Close all
Preface
15
About This Book
15
Our Demo Scenario
16
Who Should Read This Book
17
Structure of the Book
17
Acknowledgments
20
Part I: Getting Started
23
1 Introduction to the SAP HANA Development Platform
25
1.1 Business Cases for SAP HANA Applications
25
1.2 SAP HANA Components and Architecture
29
1.2.1 Functional Components
29
1.2.2 Technical Services and Architecture
36
1.3 Application Design Considerations
38
1.4 Summary
40
2 SAP HANA Development Environment
43
2.1 System Landscape
43
2.2 SAP HANA, Express Edition
47
2.2.1 On-Premise Installation Options
48
2.2.2 Installing SAP HANA, Express Edition VM Images
48
2.3 SAP Cloud Appliance Library
54
2.3.1 Registrations
55
2.3.2 SAP HANA, Express Edition Setup
56
2.4 SAP Cloud Platform
60
2.4.1 Registrations
61
2.4.2 Provisioning the SAP HANA Service Instance
61
2.4.3 Enable SAP Web IDE for Full-Stack Development
66
2.5 SAP HANA XS Advanced Organizations and Spaces
69
2.5.1 Organizations and Spaces Overview
69
2.5.2 Organization and Space Management
71
2.6 Git Code Repository
74
2.7 Summary
80
3 SAP HANA Development Tools
83
3.1 Command-Line Client
83
3.1.1 Logon and Setup
85
3.1.2 Application Management
86
3.1.3 Services Management
88
3.1.4 Organizations and Spaces
90
3.1.5 Domains
91
3.1.6 Certificates
92
3.1.7 Routes
93
3.1.8 Buildpacks
94
3.1.9 Runtime Environments and the Blob Store
95
3.1.10 Tasks
96
3.1.11 User Administration
97
3.1.12 Configuration
98
3.1.13 Plug-Ins
99
3.1.14 Other Commands
100
3.2 SAP Web IDE for SAP HANA
101
3.3 SAP HANA Database Explorer
104
3.4 SAP HANA XS Advanced Cockpit
109
3.5 Other SAP HANA Database Development Tools
113
3.5.1 SAP HANA Studio
113
3.5.2 SAP HANA Web-Based Development Workbench
115
3.5.3 SAP HANA Cockpit
116
3.5.4 Postman
117
3.6 Summary
118
4 SAP HANA XS Advanced Architecture
119
4.1 Microservices Architecture
119
4.1.1 Monolithic Architecture
120
4.1.2 Microservices Architecture
121
4.2 SAP HANA XS Advanced Architecture
122
4.2.1 12-Factor Apps
123
4.2.2 Cloud Foundry Basics
127
4.2.3 Organization of Applications, Services, and Users
129
4.2.4 The Controller
130
4.2.5 Deployment and Execution
131
4.2.6 Runtime Components and Services
133
4.2.7 Platform Services
135
4.3 SAP HANA XS Advanced Application Concepts
140
4.3.1 Multi-Target Application Concept
141
4.3.2 Architecture of a Multi-Target Application in SAP HANA XS Advanced
144
4.3.3 Development Workflow for Multi-Target Applications
146
4.4 Summary
147
Part II: Developing an Application
149
5 Defining the Data Model
151
5.1 Data Model Overview
152
5.2 The Demo Application
154
5.3 Data Model Design in SAP HANA
159
5.3.1 Executing SQL Commands in SAP HANA
160
5.3.2 Commonly Used SQL Statements
163
5.3.3 Converting an Entity-Relationship Model to a Database Design
166
5.3.4 Data Model Using SAP HANA Repository Design-Time Objects
182
5.4 SAP HANA Deployment Infrastructure
189
5.4.1 HDI Containers
190
5.4.2 HDI Technical Users
191
5.4.3 HDI Deployer
192
5.4.4 Deployment into HDI Container
193
5.5 SAP HANA Database Module
196
5.5.1 Creating a Multi-Target Application Project
197
5.5.2 Creating an SAP HANA Database Module
199
5.5.3 Building the SAP HANA Database Module Artifacts
203
5.5.4 Building and Deploying a Multi-Target Application Archive
205
5.6 Core Data Services: The Physical Data Model
208
5.6.1 Editors
208
5.6.2 Entities
211
5.6.3 Data Types and User-Defined Structures
219
5.6.4 Associations
222
5.6.5 Views
224
5.6.6 Extensions
226
5.7 Loading Table Data
228
5.7.1 Using Table Data (.hdbtabledata)
229
5.7.2 Building the .hdbtabledata File
234
5.7.3 Using Table Data Properties (.properties)
235
5.7.4 Generate Time Data
236
5.8 Synonyms and Cross-Schema Access
237
5.9 Virtual Data Model
243
5.9.1 Create Calculation Views
245
5.9.2 Dimension Calculation Views
251
5.9.3 Default Calculation Views
263
5.9.4 Cube Calculation Views with Star Joins
264
5.9.5 Cube Calculation Views
272
5.9.6 Analytic Privileges
274
5.10 SQLScript for Stored Procedures
275
5.10.1 Stored Procedure
276
5.10.2 Table Functions and Scalar Functions
277
5.11 Table Creation without Core Data Services Documents
279
5.12 Other Database Artifacts
281
5.12.1 SAP HANA Database Sequence
281
5.12.2 SAP HANA Database View
282
5.12.3 SAP HANA Database Role
283
5.12.4 List of SAP HANA Deployment Infrastructure Artifacts
286
5.13 Summary
288
6 Developing the Application Layer
289
6.1 Tasks of the Application Layer
290
6.2 Node.js as Application Layer
292
6.2.1 Node.js Module
293
6.2.2 Modules and the Node Package Manager Repository
297
6.2.3 Asynchronous Programming Model
316
6.2.4 Managing Asynchronous Control Flow
320
6.2.5 Exposing Data
330
6.2.6 Accessing the SAP HANA Database
338
6.2.7 Unit Testing a Node.js Module
348
6.3 Java as Application Layer
358
6.3.1 Creating a Java Module to Read Database Content
360
6.3.2 Creating an OData Service to Modify Data
369
6.3.3 Connecting Java Services to an HTML5 Frontend
383
6.4 Summary
391
7 Developing a Presentation Layer
393
7.1 SAPUI5 Frontend Development
394
7.1.1 Application Bootstrapping
395
7.1.2 SAPUI5 Application Structuring
398
7.1.3 Model View Controller
401
7.1.4 Data Binding
404
7.1.5 Routing and Navigation
420
7.2 SAP HANA XS Advanced Application Routing
426
7.2.1 Application Routing Files
426
7.2.2 Application Routes and Destinations
429
7.2.3 SAPUI5 Central Service
431
7.3 Demo Application
436
7.3.1 Create the SAP Fiori Master-Detail Module
437
7.3.2 Demo Application Layout Adjustments
441
7.4 Summary
446
Part III: Refining the Application
447
8 Securing Your Application
449
8.1 SAP HANA XS Advanced Security Concepts
450
8.2 Authorization in SAP HANA XS Advanced
455
8.2.1 Scopes and Attributes
455
8.2.2 Defining Application Security with the Application Security Descriptor
457
8.2.3 SAP HANA XS Advanced User Account and Authorization Service
463
8.2.4 Role Collections
464
8.2.5 Data Control Language
465
8.2.6 Controller Roles
466
8.3 Enable Security in your SAP HANA XS Advanced Application
467
8.3.1 Creating the SAP HANA XS Advanced User Account and Authorization Service
467
8.3.2 Enabling Security for Java Modules
470
8.3.3 Enabling Security for Node.js Modules
472
8.3.4 Enabling Security for SAPUI5 Modules
476
8.3.5 Secure Your Application against Web-Based Attacks
478
8.4 Maintaining Users and Roles in SAP HANA XS Advanced
482
8.4.1 Create Roles in SAP HANA XS Advanced
482
8.4.2 Create an Application User with the Administration Tools
487
8.4.3 Configuring Functional Authorization Checks
489
8.4.4 Configuring Instance-Based Authorization Checks
493
8.5 Assigning HDI Container Roles to Classic Database Users
495
8.5.1 Granting HDI Container Access via Schema Access
496
8.5.2 Granting HDI Container Access via Roles
498
8.6 Default Access Role for HDI Containers
500
8.7 Permissions for Container Objects
503
8.8 Summary
506
9 Troubleshooting Your Application
507
9.1 Debugging
507
9.1.1 Debugging Calculation Views
508
9.1.2 Debugging Stored Procedures
509
9.1.3 Debugging a Node.js Application
510
9.1.4 Debugging a Java Application
513
9.1.5 Debugging a SAPUI5 Application
515
9.2 Application Logs and Logging
519
9.2.1 Logging Data Changes
519
9.2.2 Logging Stored Procedure Actions
520
9.2.3 SAP HANA XS Advanced Transaction Logs
522
9.2.4 Logging in Node.js Applications
523
9.2.5 Logging in Java Applications
526
9.3 Database Traces
536
9.3.1 Configuring SQL Traces
537
9.3.2 Configuring Performance Trace
539
9.4 Performance Optimization
541
9.4.1 Execution of SQL Queries on Calculation Views
541
9.4.2 Analyze SQL in SAP Web IDE for SAP HANA
542
9.4.3 Explain Plan in SAP HANA Studio
547
9.4.4 Plan Visualizer in SAP HANA Studio
550
9.5 Summary
555
10 Deploying Your Application
557
10.1 Building the Multi-Target Application Archive
557
10.2 Deployment Process
560
10.2.1 Deployment via the SAP Web IDE for SAP HANA
560
10.2.2 SAP HANA XS Advanced Command-Line Interface
561
10.3 Transporting SAP HANA XS Advanced Applications
566
10.3.1 Manual Transport
566
10.3.2 Transport Using the Change and Transport System
567
10.3.3 Continuous Integration
568
10.3.4 Outlook: Native Transport
569
10.4 Summary
570
Appendices
571
A Migrating an SAP HANA XS Application to SAP HANA XS Advanced
573
A.1 Migration Steps
574
A.2 SAP HANA Studio Migration Tool
575
A.3 SAP HANA XS Advanced Migration Assistant
579
A.4 Migration of the Security Concept
587
B Additional Resources
593
C The Authors
595
Index
597