Inhaltsverzeichnis

Alle Kapitel aufklappen
Alle Kapitel zuklappen
Acknowledgments
17
1 SAP HANA Overview
19
1.1 Features
19
1.1.1 Main Memory and CPU Innovations
21
1.1.2 Storage Innovations
22
1.1.3 Data Compression
23
1.1.4 Data Partitioning
25
1.2 Architecture
27
1.3 Platform Capabilities
29
1.4 Use Cases
30
1.4.1 Side-by-Side Scenario
30
1.4.2 Fully Integrated Scenarios
32
1.4.3 New Applications
32
1.5 Summary
33
2 Code-to-Data Paradigm
35
2.1 What Is the Code-to-Data Paradigm?
35
2.2 Bottom-Up Approach
38
2.2.1 Using Native SQL
39
2.2.2 Using Proxy Objects
40
2.3 Top-Down Approach
41
2.3.1 Using Transparent Optimization
42
2.3.2 Using ABAP SQL
43
2.3.3 Using ABAP-Managed Database Procedures
45
2.3.4 Using Core Data Services
45
2.4 Performance Benefits of Code-to-Data Techniques
46
2.5 Summary
49
3 Development Environments
51
3.1 Evolution of Programming Languages and Development Tools
51
3.2 SAP HANA Studio
54
3.2.1 Compatibility Checks
56
3.2.2 Download
60
3.2.3 Installation
64
3.2.4 Basic Navigation and Actions
67
3.2.5 ABAP Perspective
72
3.2.6 Modeler Perspective
75
3.2.7 Administration Perspective
83
3.3 SAP HANA Client
87
3.4 ABAP Development Tools
88
3.4.1 Overview
88
3.4.2 Installation
90
3.5 SAP Business Technology Platform, ABAP Environment
99
3.6 Summary
101
4 Native SQL
103
4.1 Executing Native SQL Statements
104
4.1.1 Literals and Host Variables
105
4.1.2 Statement for Cursor Processing
105
4.1.3 Database Procedure Calls
106
4.1.4 Statements for Establishing Database Connections
107
4.1.5 Data Type Compatibility
108
4.2 ABAP Database Connectivity
109
4.2.1 Querying the Database
110
4.2.2 DDL and DML Operations
115
4.2.3 Secondary Connections
118
4.2.4 Precautions While Using ABAP Database Connectivity
120
4.3 Summary
121
5 SQLScript Programming
123
5.1 What Is SQLScript?
123
5.1.1 SQL versus SQLScript
124
5.1.2 Types of SQLScript Statements
125
5.1.3 Prerequisites
125
5.2 SQL Query Template
128
5.2.1 Creating a Schema
128
5.2.2 Creating Tables
129
5.3 Stored Procedures
131
5.3.1 Creating Procedures
131
5.3.2 Deleting Procedures
133
5.4 User-Defined Functions
133
5.4.1 Joins and GROUP BY Clauses
135
5.4.2 Subqueries
137
5.5 Constructs
139
5.5.1 Local Scalar Variables
139
5.5.2 Local Table Variables
139
5.5.3 Conditional Statements
140
5.5.4 FOR Loops and WHILE Loops
141
5.5.5 Operators
141
5.5.6 Emptiness Check for Tables and Table Variables
143
5.5.7 Getting the Number of Records for Tables and Table Variables
144
5.6 Cursors
144
5.6.1 Example Cursor
145
5.6.2 Looping over Cursors
146
5.7 Transactional Statements
147
5.8 Dynamic SQL
148
5.9 Exception Handing
149
5.9.1 Continue after Handling
149
5.9.2 Block Parallel Execution
150
5.10 Arrays
150
5.10.1 Creating an Array
150
5.10.2 Accessing the Array
151
5.10.3 Concatenating Arrays
151
5.10.4 Converting a Table into an Array
151
5.10.5 Unpacking an Array into a Table
152
5.10.6 Deleting or Trimming an Array
152
5.10.7 Cardinality in Arrays
153
5.11 SQL Injection Prevention Functions
153
5.12 Explicit Parallel Execution
154
5.13 System Variables
155
5.14 Debugging SQLScript
156
5.15 Summary
158
6 ABAP-Managed Database Procedures
159
6.1 Introduction
159
6.1.1 ABAP-Managed Database Procedure Framework
161
6.1.2 Development Environment for AMDP
163
6.2 Creating AMDP Classes
166
6.2.1 Prerequisites
166
6.2.2 Implementing AMDP Methods
168
6.2.3 Calling AMDP Methods in Applications
170
6.2.4 Using Multiple Selection Criteria
174
6.2.5 Feature Support Check Using Global Classes
177
6.3 Enhancements
180
6.3.1 AMDP BAdI Overview
180
6.3.2 AMDP BAdI Implementation
185
6.3.3 AMDP BAdI Definition
189
6.3.4 AMDP BAdI Calls
196
6.4 Exception Handling
199
6.5 Debugging
202
6.5.1 AMDP Debugging before SAP NetWeaver AS ABAP 7.5
203
6.5.2 AMDP Debugging with SAP NetWeaver AS ABAP 7.5
208
6.5.3 AMDP Dump Analysis Using Transaction ST22
209
6.6 Tools
214
6.6.1 AMDP Dependencies for ABAP and SAP HANA
214
6.6.2 AMDP Precondition Checks
215
6.6.3 AMDP Consistency Check for AMDP Table Functions
216
6.6.4 Delete Obsolete AMDPs
218
6.7 Summary
218
7 Modeling
219
7.1 What Is Modeling for SAP HANA?
219
7.1.1 Measures and Attributes
220
7.1.2 Dimensions
220
7.1.3 Fact Tables
221
7.1.4 Star Schemas
222
7.1.5 Hierarchies
223
7.1.6 Semantics
224
7.1.7 Joins
224
7.2 Information Views
229
7.2.1 Features
230
7.2.2 Information View Types
231
7.3 Calculation Views
232
7.3.1 Creating Dimension Calculation Views
233
7.3.2 Creating Calculated Attributes
235
7.3.3 Time Dimension-Based Calculated Views
237
7.3.4 Base Tables Aliases
238
7.3.5 Hidden Columns
240
7.3.6 Labels and Hidden Attributes
241
7.3.7 Using Measures in Calculation Views
241
7.4 Modeling Functions
243
7.4.1 Using a Hierarchy
243
7.4.2 Restricted Columns
250
7.4.3 Calculated Columns
252
7.4.4 Filtering Data
256
7.4.5 Using Variables and Input Parameters
258
7.4.6 Currency Conversion
263
7.4.7 Decision Tables
265
7.5 SQL in Information Models
270
7.5.1 Query a Modeled Hierarchy Using SQLScript
271
7.5.2 Creating and Using Functions in Information Views
271
7.5.3 Procedures in Calculation Views
272
7.6 Virtual Data Models
275
7.6.1 SAP HANA Live
275
7.6.2 SAP S/4HANA Embedded Analytics and Core Data Services Views
280
7.7 Optimizing Data Models
284
7.7.1 Tools to Check Model Performance
284
7.7.2 Good Modeling Practices
286
7.8 Summary
290
8 Core Data Services
291
8.1 The Evolution of Core Data Services
291
8.2 Introduction
295
8.2.1 Domain-Specific Languages
295
8.2.2 Availability and Features
296
8.2.3 Integration with ABAP
297
8.3 Defining CDS Views
298
8.3.1 Using Templates
300
8.3.2 Structure Definition
304
8.3.3 Creating CDS Views in ADT
307
8.3.4 Syntax and Naming Guidelines
310
8.4 Built-In Functions and Expressions
312
8.4.1 Numeric Built-In Functions
312
8.4.2 String Functions
315
8.4.3 COALESCE Function
321
8.4.4 Conversion Functions
323
8.4.5 Date and Time Functions
334
8.5 Annotations
349
8.5.1 Scope of Annotations
349
8.5.2 Types of Annotations
351
8.6 Associations
351
8.6.1 Defining Associations
352
8.6.2 Cardinality
354
8.6.3 Types of Associations
355
8.7 Consuming CDS Views
358
8.7.1 Using ABAP SQL
359
8.7.2 Using SAP List Viewer with Integrated Data Access
360
8.8 Enhancements
364
8.8.1 CDS View Extensions
367
8.8.2 Limiting CDS View Extensibility
368
8.8.3 Finding CDS Extensions to Enhance CDS View Definitions
369
8.9 Authorization Concept
370
8.9.1 Data Control Language Overview
371
8.9.2 Data Control Language Syntax and Access Conditions
372
8.9.3 Data Control Language Source Definition
379
8.9.4 Data Control Language Source Annotations
384
8.10 CDS Table Functions
386
8.10.1 AMDP Functions
387
8.10.2 Introduction to CDS Table Functions
389
8.10.3 Defining CDS Table Functions
391
8.11 Summary
399
9 Open SQL and ABAP SQL
401
9.1 What Is Open SQL?
401
9.2 Features of Open SQL
403
9.3 ABAP SQL
410
9.3.1 Code Pushdown in ABAP SQL
412
9.3.2 Joins
423
9.4 Open SQL versus ABAP SQL Statements
430
9.4.1 Major Syntax Changes in the SELECT Query
430
9.4.2 Arithmetic Operations and String Operations
431
9.4.3 Joins and Unions
431
9.5 ABAP SQL versus CDS Views and AMDPs
432
9.5.1 CDS Views
433
9.5.2 ABAP-Managed Database Procedures
433
9.6 Summary
434
10 Business Object Processing Framework
435
10.1 Introduction to Business Object Processing Framework
435
10.2 Elements of BOPF
438
10.2.1 Nodes
439
10.2.2 Attributes
441
10.2.3 Alternate Keys
442
10.2.4 Actions
442
10.2.5 Determinations
445
10.2.6 Associations
447
10.2.7 Validations
448
10.2.8 Queries
448
10.3 BOPF API
449
10.3.1 BOPF Interface Objects
449
10.3.2 Business Object Key
451
10.3.3 BOPF Constants Interface
451
10.4 CRUD Operations Using the BOPF API
453
10.4.1 Creating Business Object Instances
453
10.4.2 Searching for Business Object Instances
456
10.4.3 Updating and Deleting Business Object Instances
457
10.5 Advanced BOPF API Features
458
10.5.1 Consistency Checks
458
10.5.2 Triggering Actions
459
10.5.3 Action Validations
460
10.5.4 Transaction Management
461
10.6 Enhancement Techniques
462
10.6.1 Enhancement Workbench
463
10.6.2 Enhancing the Business Object Data Model
464
10.7 Summary
469
11 Performance and Optimization
471
11.1 Runtime Statistics Records
472
11.2 Runtime and Statistical Analysis
475
11.2.1 Transaction SAT
476
11.2.2 ABAP Profiling Perspective
484
11.2.3 SQL Performance Trace
496
11.2.4 Single Transaction Analysis (Transaction ST12)
498
11.2.5 Explain Plan
499
11.2.6 SAP HANA Plan Visualizer
505
11.3 ABAP Code Analysis
509
11.3.1 SAP Global Check Variants
509
11.3.2 Using the ABAP Test Cockpit
510
11.3.3 ABAP Test Cockpit Administration
516
11.4 System-Wide Analysis
521
11.4.1 Database Administrator Cockpit
522
11.4.2 SQL Monitor
524
11.5 SQL Performance Optimization
526
11.5.1 Guided Performance Analysis
527
11.5.2 SQL Performance Tuning Worklist
528
11.5.3 Recommended Static Checks
532
11.6 Summary
533
12 SAP Business Technology Platform, ABAP Environment
535
12.1 Introduction to Application Development in the Cloud with SAP
535
12.2 ABAP Environment in the Cloud
540
12.2.1 Architecture
541
12.2.2 Creating an ABAP Trial Instance
542
12.2.3 Connecting SAP HANA Studio to SAP BTP, Cloud Foundry Environment
546
12.2.4 ABAP Restrictions in the Cloud
549
12.2.5 Migrating ABAP Applications to the Cloud
552
12.3 Creating ABAP Repository Objects in the Cloud
555
12.3.1 Creating ABAP Packages in the Cloud
556
12.3.2 Creating ABAP Database Tables in the Cloud
560
12.3.3 Creating ABAP Classes in the Cloud
564
12.3.4 Creating ABAP CDS Views in the Cloud
569
12.4 Summary
572
Appendices
575
A Programming Guidelines
577
A.1 Classic Approach to Retrieve Data in ABAP Context
577
A.2 Usage of Open SQL Statements
580
A.3 Guidelines to Use Open SQL for Any Database
580
A.4 Guidelines to Use Open SQL for an SAP HANA Database
582
A.5 Guidelines to Use Buffered Table
585
A.6 Usage of FOR ALL ENTRIES Clause on an SAP HANA Database
585
A.7 General Rules for the Code Pushdown Paradigm
585
B Code Migration
589
B.1 Custom Code Migration for SAP HANA
589
B.2 Global ABAP Test Cockpit Checks for SAP HANA Database Migration
594
B.3 Custom Code Analysis and Adaptation for SAP HANA
604
C The Authors
637
Index
639