Table of Contents

Open all
Close all
Foreword
15
Preface
17
Introduction
19
Part I: Basic Principles
27
1 Overview of SAP HANA
29
1.1 Software Components of SAP HANA
30
1.1.1 SAP HANA Database
30
1.1.2 SAP HANA Studio
32
1.1.3 SAP HANA Client
33
1.1.4 SAP HANA Extended Application Services
35
1.1.5 Additional Options
36
1.2 Basic Principles of In-Memory Technology
39
1.2.1 Hardware Innovations
40
1.2.2 Software Innovations
44
1.3 Architecture of the In-Memory Database
55
1.4 Application Cases and Deployment Options for SAP HANA
58
1.4.1 Application Cases
58
1.4.2 Deployment Options
61
1.5 How SAP HANA Affects Application Development
63
1.5.1 New Technical Options
63
1.5.2 Code Pushdown
64
1.5.3 Database as White Box
66
1.5.4 Required Qualifications for Developers
68
2 Introducing the Development Environment
71
2.1 Overview of Eclipse
71
2.2 SAP’s Eclipse Strategy
74
2.2.1 Unbundling of Eclipse and SAP Software
75
2.2.2 Central Update Site
76
2.3 Installing the Development Environment
77
2.3.1 Installing the Eclipse IDE for Java Developers
77
2.3.2 Installing SAP HANA Studio
78
2.3.3 Installing the ABAP Development Tools for SAP NetWeaver
79
2.4 Getting Started in the Development System
80
2.4.1 Basic Principles of Eclipse
80
2.4.2 ABAP Development Tools for SAP NetWeaver
83
2.4.3 SAP HANA Studio
93
3 Database Programming Using SAP NetWeaver Application Server ABAP
109
3.1 SAP NetWeaver Application Server ABAP Architecture
111
3.1.1 Database Interface
112
3.1.2 Role of the Database for the ABAP Application Server
115
3.1.3 Data Types
117
3.2 ABAP Database Access
123
3.2.1 ABAP Data Dictionary
124
3.2.2 Open SQL
128
3.2.3 Database Views in the ABAP Data Dictionary
138
3.2.4 Database Access via Native SQL
139
3.2.5 Secondary Database Connections
145
3.3 Analyzing Database Accesses Using the SQL Trace
149
3.3.1 Statement Transformations
149
3.3.2 Secondary Connections
156
3.3.3 Native SQL
157
3.3.4 Buffer
157
Part II: Introduction to ABAP Programming with SAP HANA
159
4 Native Database Development Using SAP HANA
161
4.1 Basic Principles of Native Database Development
161
4.1.1 Objects in the SAP HANA Database Catalog
162
4.1.2 SQL Standard and SAP HANA-specific Enhancements
164
4.2 SQLScript
170
4.2.1 Basic Principles of SQLScript
170
4.2.2 SQLScript Programming
177
4.3 Database Procedures
188
4.4 Analytical Models
194
4.4.1 Attribute Views
195
4.4.2 Analytic Views
210
4.4.3 Calculation Views
219
4.4.4 Runtime Objects and SQL Access
227
4.4.5 Accessing Column Views via Microsoft Excel
229
5 Integrating Native SAP HANA Development Objects with ABAP
231
5.1 Integrating Analytic Views
231
5.1.1 Access via Native SQL
232
5.1.2 External Views in the ABAP Data Dictionary
233
5.1.3 Options for Accessing External Views
236
5.1.4 Recommendations
237
5.2 Integrating Native Procedures with ABAP
239
5.2.1 Access via Native SQL
239
5.2.2 Defining Database Procedure Proxies
246
5.2.3 Calling Database Procedure Proxies
248
5.2.4 Adjusting Database Procedure Proxies
249
5.3 Transport of Native Development Objects
250
5.3.1 Digression: Development Organization and Transport in SAP HANA
250
5.3.2 Using the SAP HANA Transport Container
254
6 Advanced Database Programming with ABAP 7.4
261
6.1 Introducing Core Data Services
262
6.2 ABAP Core Data Services
264
6.2.1 Core Data Services Views
265
6.2.2 Code Pushdown
285
6.2.3 View Extensions
292
6.2.4 Annotations
294
6.2.5 Using Core Data Services Views in ABAP and in SAP List Viewer with Integrated Data Access
298
6.2.6 Tips for Using ABAP Core Data Services Views
300
6.3 SAP HANA Core Data Services
301
6.4 Open SQL Enhancements
303
6.5 ABAP Database Procedures
307
6.5.1 Creating ABAP Managed Database Procedures
308
6.5.2 Troubleshooting
311
6.5.3 Enhancements
314
6.5.4 Practical Tips
318
7 Runtime and Error Analysis with SAP HANA
319
7.1 Overview of the Tools Available
320
7.2 Troubleshooting
322
7.2.1 Unit Tests
323
7.2.2 Dump Analysis
325
7.2.3 Debugging and Tracing in SQLScript
327
7.3 ABAP Code Analysis
328
7.3.1 Checks and Check Variants
329
7.3.2 Checks in the Development Infrastructure
333
7.3.3 Global Check Runs in the System
335
7.4 Runtime Statistics and Traces
337
7.4.1 Runtime Statistics
337
7.4.2 ABAP Trace and ABAP Profiler
342
7.4.3 SQL Trace
350
7.4.4 Single Transaction Analysis
354
7.4.5 Explain Plan
355
7.4.6 SAP HANA Plan Visualizer
357
7.5 System-Wide Analyses
362
7.5.1 Database Administration Cockpit
362
7.5.2 SQL Monitor
367
7.5.3 Runtime Check Monitor
377
7.6 SQL Performance Optimization
379
8 Sample Scenario: Optimizing an Existing Application
385
8.1 Optimization Procedure
386
8.1.1 Migrating to SAP HANA
386
8.1.2 System Optimization
388
8.1.3 Application Optimization
389
8.2 Scenario and Requirements
392
8.2.1 Initial Situation
392
8.2.2 Technical Implementation
393
8.2.3 Current Problems
396
8.3 Meeting the Requirements
397
8.3.1 Narrowing Down the Problem Using Runtime Statistics
397
8.3.2 Detailed Analysis of the ABAP Program Using Transaction SAT
399
8.3.3 Detailed Analysis of Database Accesses
401
8.3.4 Analysis Result
403
8.3.5 Optimization Using Open SQL
404
8.3.6 Analysis of the First Optimization
406
8.3.7 Analysis Result
407
8.3.8 Optimizing a Database Procedure
408
8.3.9 Analysis of the Second Optimization
410
8.3.10 Analysis Result
413
Part III: Advanced Techniques for ABAP Programming for SAP HANA
415
9 Integrating Analytical Functionality
417
9.1 What Is Analytical Functionality?
417
9.2 SAP BusinessObjects Portfolio
421
9.3 Digression: SAP Business Warehouse
425
9.3.1 SAP HANA Versus SAP Business Warehouse
425
9.3.2 Overview of Terminology
427
9.3.3 InfoProviders When Using SAP HANA
428
9.4 Overview of Possible Architectures
435
9.4.1 Direct Access to Analytical Functionality in SAP HANA
435
9.4.2 Access via SAP NetWeaver AS ABAP
437
10 Text Search and Analysis of Unstructured Data
441
10.1 Basic Principles of the Text Search in SAP HANA
443
10.1.1 Technical Architecture
444
10.1.2 Error-Tolerant Search
445
10.1.3 SAP Components and Products for Search
447
10.2 Types of Text Data and Full Text Indexes in SAP HANA
448
10.3 Using the Text Search via SQL
454
10.3.1 Fuzzy Search
455
10.3.2 Synonyms and Noise Words
460
10.3.3 Searching across Date Fields and Address Data
463
10.4 Using the Text Search in ABAP
465
10.4.1 Direct SQL Access from ABAP
466
10.4.2 Embedding Input Helps
467
10.4.3 ABAP Source Code Search
474
10.5 Text Analysis
476
10.6 Resource Consumption and Runtime Aspects of the Text Search
479
11 Decision Tables in SAP HANA
483
11.1 Basic Principles of Decision Tables
484
11.2 Creating Decision Tables in SAP HANA Studio
487
11.3 Decision Tables Based on SAP HANA Views
493
11.4 Runtime Objects and SQL Access for Decision Tables
496
11.5 Access to Decision Tables from ABAP
497
12 Function Libraries in SAP HANA
501
12.1 Basics of the Application Function Library
504
12.2 Business Function Library
506
12.3 Predictive Analysis Library
510
12.3.1 Generating the K-Means Function via the SQL Console
512
12.3.2 Using the Application Function Modeler
515
13 Processing Geoinformation
523
13.1 Basic Principles of Geoinformation Systems
524
13.2 Geodata Types and Geo-Spatial Functions in SAP HANA
526
13.2.1 Data Types
527
13.2.2 Creating Tables and Reading Data
528
13.2.3 Operations on Geographical Structures
530
13.2.4 Integration of External Maps
532
13.3 Integrating Geoinformation with ABAP Applications
534
14 Practical Tips
539
14.1 General Recommendations
540
14.1.1 Recommendations for Column Stores and Row Stores
540
14.1.2 SAP HANA-Specific Implementations
541
14.1.3 Checklist for Database-Specific Implementations
544
14.1.4 Recommendations for Migration
546
14.1.5 Development in Landscapes
548
14.1.6 Modifying Data in SQLScript or Native SQL
549
14.2 Conventions
551
14.2.1 Naming Conventions
551
14.2.2 Encapsulating SAP HANA Packages
553
14.3 Quality Aspects
554
14.3.1 Testing Views and Procedures
554
14.3.2 Robust Programming
555
14.3.3 Security Aspects
556
14.4 Performance Recommendations for Open SQL
557
14.4.1 Rule 1: Keeping Result Sets Small
558
14.4.2 Rule 2: Keeping Transferred Datasets Small
561
14.4.3 Rule 3: Reducing the Number of Queries
568
14.4.4 Rule 4: Minimizing Search Effort
574
14.4.5 Rule 5: Reducing the Load on the Database
577
14.4.6 Summary of Rules
582
14.5 Performance Recommendations for Native Implementations in SAP HANA
582
14.5.1 Recommendations for Native SQL
582
14.5.2 Recommendations for SAP HANA Views
584
14.5.3 Recommendations for SQLScript
587
14.6 Summary of Recommendations
589
Appendices
593
A Flight Data Model
595
A.1 Basic Principles of the Flight Data Model
595
A.2 Database Tables for the Flight Data Model
596
A.3 Data Generation
601
B Enhancements to the ABAP Programming Language (as of SAP NetWeaver 7.4)
603
B.1 Inline Declarations
603
B.2 Constructor Expressions
605
B.3 Internal Tables
607
C Read and Write Access in the Column Store
609
C.1 Basic Principles
609
C.2 Read Access without an Index
610
C.3 Write Access without an Index
612
C.4 Read Accesses with an Index
615
D SAP Business Application Accelerator Powered by SAP HANA
621
E Installing the Sample Programs
625
F The Authors
627
Index
629