Inhaltsverzeichnis

Alle Kapitel aufklappen
Alle Kapitel zuklappen
1 Foreword
21
1 Preface
25
Purpose
25
Who Should Read This Book
26
Structure and Content of the Book
27
How to Read This Book
33
How to Use the Code Examples
34
Additional Resources and Feedback Channels
36
SAP Community
37
StackOverflow
38
GitHub
38
Acknowledgements
38
Part 1: The Intelligent ERP
41
1 SAP S/4HANA: The Intelligent ERP
43
1.1 Digital Transformation
43
1.2 SAP S/4HANA Evolution
44
1.3 SAP S/4HANA Design Principles
46
1.3.1 Simplification
46
1.3.2 SAP HANA
47
1.3.3 Compatibility
47
1.3.4 Single Codeline
47
1.3.5 Cloud-First
48
1.3.6 SAP Fiori
49
1.3.7 Flexible Deployment
49
1.3.8 Integration
50
1.3.9 Public Model
50
1.3.10 Intelligence
51
1.3.11 Decoupled Extensions
53
1.4 Summary
54
2 SAP S/4HANA Extensibility
55
2.1 Separation of Concerns
56
2.1.1 “The Good Old Days”
56
2.1.2 Principle of Least Knowledge
57
2.2 In-App Extensions
58
2.3 Side-by-Side Extensions
64
2.3.1 Overview of the SAP Cloud Platform
64
2.3.2 Connectivity between SAP Cloud Platform and SAP S/4HANA
66
2.3.3 Side-by-Side Extension Scenarios
67
2.4 Extension Use Cases
72
2.4.1 Proxy Applications
72
2.4.2 Convenience Applications
73
2.4.3 Substitute Applications
73
2.4.4 Preprocessing Applications
73
2.4.5 Postprocessing Applications
74
2.4.6 Analytical Applications
74
2.5 Nonfunctional Requirements of Extension Applications
74
2.6 Summary
76
Part II: Building Side-by-Side Extensions
77
3 Side-by-Side Extensibility
79
3.1 Cloud-Native Development
79
3.1.1 Motivation
79
3.1.2 Benefits of Cloud-Native Applications
80
3.1.3 Enabling Cloud-Native Applications
83
3.1.4 Cloud-Native Architecture: The Twelve-Factor Application
89
3.1.5 Conclusion
93
3.2 SAP Cloud Platform
93
3.2.1 Development Environments
94
3.2.2 Overview of Terminology, Concepts, and Services
95
3.3 The SAP Cloud Platform SDK for Service Development and the SAP S/4HANA Cloud SDK
97
3.4 Business Partner Address Manager Application
102
3.5 Summary
106
4 Building the Application
109
4.1 A First “Hello World!” Microservice
110
4.1.1 Prerequisites
110
4.1.2 Generating the Project
111
4.1.3 Building and Running the Project Locally
113
4.1.4 Structure of the Application Code
115
4.2 Reading Business Partners
117
4.2.1 Retrieving the List of Business Partners
118
4.2.2 Running Locally
120
4.2.3 The SAP S/4HANA Virtual Data Model in Java
123
4.2.4 Retrieving a Specific Business Partner
125
4.3 Integrating the Frontend
129
4.4 Deploying the Application to Cloud Foundry
130
4.5 Writing Business Partner Addresses to SAP S/4HANA
133
4.5.1 Creating Addresses
134
4.5.2 Deleting Addresses
138
4.5.3 Updating Addresses
139
4.6 Engineering with Cloud Qualities
140
4.6.1 Designing for Stability
141
4.6.2 Implementing Resilience
144
4.6.3 Advanced Commands
150
4.6.4 Caching
151
4.7 Summary
153
5 Application Security
155
5.1 Security on SAP Cloud Platform
155
5.2 Configuring Authentication
159
5.2.1 Setting Up the Application Router
159
5.2.2 Extended Services for User Account Authentication (XSUAA)
163
5.2.3 A First Test
164
5.2.4 Protecting Our Backend Microservice
166
5.3 Configuring Authorization Using OAuth2
169
5.3.1 Overview
169
5.3.2 Defining Scopes and Role Templates
171
5.3.3 Protecting Our Application
172
5.3.4 Assigning Users to Application Roles
176
5.4 Protecting against Common Web Application Threats
180
5.4.1 Cross-Site Request Forgery
180
5.4.2 Clickjacking
182
5.4.3 Securing Session Cookies
183
5.4.4 Secure HTTP Headers
184
5.5 Summary
184
6 Integrating with SAP S/4HANA
185
6.1 Introduction
185
6.2 Technical Users, Business Users, and Principal Propagation
186
6.2.1 Technical Users and Business Users
186
6.2.2 Authenticating as Business User via Principal Propagation
188
6.3 Using and Configuring Destination Service on SAP Cloud Platform Cloud Foundry
189
6.3.1 Purpose of the Destination Service
189
6.3.2 Create and Subscribe to Destination Service
190
6.3.3 Conduct Destination Configuration
191
6.4 Integration with SAP S/4HANA Cloud
192
6.4.1 Security Assertion Markup Language
193
6.4.2 OAuth 2.0 Authorization Framework
194
6.4.3 OAuth 2.0 SAML Bearer Assertion Flow Configuration
194
6.4.4 OAuth 2.0 SAML Bearer Assertion Flow—Runtime
208
6.4.5 Basic Authentication
210
6.5 Integration with SAP S/4HANA On-Premise
211
6.5.1 Architecture and Involved Components
211
6.5.2 Example Flow
212
6.5.3 Integration Setup Independent from Authentication Method
214
6.5.4 Integration Setup Leveraging Technical Users
217
6.5.5 Integration Setup Leveraging Business Users
223
6.6 Summary
230
7 Multitenancy
231
7.1 Motivations for Multitenancy
231
7.2 Multitenancy on SAP Cloud Platform
232
7.2.1 Tenant Onboarding and Offboarding
232
7.2.2 Tenant Identification
234
7.2.3 Applications versus Services
234
7.2.4 Data Separation
236
7.3 Multitenancy Aspects in the Existing Application
238
7.4 Adding Multitenant Persistence to the Application
240
7.4.1 Introducing Addresses Workflow with Local Persistence
240
7.4.2 Configure Data Source
246
7.4.3 Configure Hibernate to Handle Tenant-Aware Queries
249
7.4.4 Tenant Onboarding and Offboarding
253
7.4.5 Implementing the Local Address Workflow
256
7.4.6 Configuring Service Bindings
257
7.5 Summary
258
8 REST APIs
259
8.1 Designing RESTful APIs
264
8.2 Building RESTful APIs
275
8.3 Provisioning OData Services with the SAP Cloud Platform SDK for Service Development
282
8.3.1 Introduction to Technical Components
283
8.3.2 Setup and Installation
284
8.3.3 Metadata
285
8.3.4 Runtime Logic
286
8.3.5 Building and Deploying
290
8.4 Summary
290
9 Automated Testing
291
9.1 Concepts of Testing
292
9.1.1 Unit Tests
293
9.1.2 Integration Tests
295
9.2 Building Unit Tests
297
9.2.1 JUnit
297
9.2.2 Mocking
298
9.2.3 Design Rules
299
9.2.4 Putting It All Together
301
9.3 Building Integration Tests
304
9.4 Testing Complex Applications
308
9.5 Summary
309
Part III: Delivering and Operating Side-by-Side Extensions
311
10 DevOps and Continuous Delivery
313
10.1 The Importance of DevOps
313
10.2 Introducing the Principles of DevOps
314
10.2.1 The Principle of Flow
314
10.2.2 The Principle of Feedback
317
10.2.3 The Principle of Continuous Learning and Experimentation
318
10.3 Introducing Continuous Delivery
319
10.3.1 Introducing Continuous Delivery Pipelines
319
10.3.2 Enabling DevOps Principles via Continuous Delivery
321
10.4 How to Monitor Applications
323
10.4.1 The Importance of Logging
323
10.4.2 The Importance of Metrics
325
10.4.3 Telemetry Consolidation
326
10.5 Case Study: Working Model of a DevOps Team
327
10.6 Summary
331
11 Implementing Continuous Delivery
333
11.1 The SAP S/4HANA Cloud SDK CX-Server
333
11.2 Setting Up and Configuring a Continuous Delivery Server
338
11.2.1 Installing Jenkins
339
11.2.2 Credentials Management
342
11.2.3 Setting Up Source Code Management
343
11.2.4 Configuring Webhook to Jenkins
344
11.2.5 Multibranch Pipelines
345
11.2.6 Securing Jenkins
346
11.3 Zero-Downtime Shipments to the Cloud
347
11.3.1 Blue-Green Deployment
347
11.3.2 Zero-Downtime Deployment to SAP Cloud Platform, Cloud Foundry
349
11.3.3 Zero-Downtime Deployment to the Neo Environment on the SAP Cloud Platform
351
11.4 Feature Toggles: Decoupling Deployment and Release
352
11.4.1 Operation Toggles
353
11.4.2 Experiment Toggles
353
11.4.3 Permission Toggles
354
11.4.4 Release Toggles
354
11.4.5 Decoupling Deployment and Release
354
11.5 Summary
357
12 Quality Assurance
359
12.1 What Is Software Quality and How to Achieve It?
359
12.2 Static Code Checks
361
12.2.1 FindBugs
361
12.2.2 PMD
363
12.2.3 Node Security Platform
366
12.2.4 CheckMarx
367
12.2.5 WhiteSource
367
12.3 Automated Testing
367
12.3.1 Backend Unit Tests and Integration Tests
368
12.3.2 Code Coverage
369
12.3.3 End-to-End Tests
371
12.3.4 Performance Tests
374
12.4 SAP Cloud Quality Checks
377
12.4.1 Hystrix Checks
378
12.4.2 Stable ERP API Checks
379
12.5 Scaling Quality Assurance with Distributed Builds
379
12.5.1 Scaling the Build Pipeline
380
12.5.2 Distributed Builds with the CX-Server
380
12.6 Summary
384
13 Cloud Operations
385
13.1 Logging and Tracing
385
13.2 Application Health Monitoring
390
13.2.1 Health Status Endpoint
391
13.2.2 Application Monitoring with Dynatrace
392
13.3 Capacity Planning and Scaling of Cloud Infrastructures
398
13.4 Summary
399
Part IV: Advanced Concepts
401
14 Building a Custom SAP Fiori User Interface
403
14.1 Explanation of the Frontend Application
404
14.1.1 Overview of the Architecture
404
14.1.2 Model and View of the Sample App
405
14.1.3 Controller of the Sample App
408
14.2 Provisioning the Frontend as a Microservice
411
14.2.1 Overview of Alternative Approaches
411
14.2.2 Frontend Resources as Part of the AppRouter
414
14.2.3 Dedicated Microservices
417
14.3 Considering Continuous Delivery of the Frontend
420
14.4 Outlook on Current Trends in Frontend Development
421
14.5 Summary
423
15 Integrating with Java Frameworks
425
15.1 Integrating with Java Platform, Enterprise Edition
426
15.1.1 SAP S/4HANA Cloud SDK Maven Archetypes for Java EE Projects
427
15.1.2 Including the SAP S/4HANA Cloud SDK in Existing Maven Projects
428
15.1.3 Using Dependency Injection with the VDM
431
15.1.4 Services Implemented with JAX-RS
432
15.1.5 Multitenant Persistence
437
15.2 Integrating with Spring Boot
443
15.2.1 Maven Archetype for Spring Boot Projects
444
15.2.2 Including the SAP S/4HANA Cloud SDK in Existing Maven-Based Spring Projects
445
15.2.3 Using Dependency Injection with the VDM
449
15.2.4 Services Implemented as Spring Controllers
451
15.2.5 Multitenant Persistence
452
15.3 Summary
456
16 Event-Based Integration
457
16.1 Theory of Reactive Systems
458
16.2 Concepts of Event-Based Integration
461
16.3 Events in SAP S/4HANA Cloud
464
16.3.1 Events Raised by SAP S/4HANA Cloud Applications
465
16.3.2 Event Enablement
466
16.3.3 Configuration
469
16.4 Services for Handling Events on SAP Cloud Platform
474
16.5 Extending the Sample Application with Events
476
16.6 Summary
478
17 Extending SAP S/4HANA with Machine Learning and Blockchain Technologies
479
17.1 SAP Leonardo and the Innovation Commitment of the SAP S/4HANA Cloud SDK
480
17.2 Extending a Sample Application with Machine Learning
481
17.2.1 Quickly Creating a Resilient and Twelve-Factor-Compliant Language Detection Servlet
484
17.2.2 Improving the Integration and Chaining Services for a Complete Machine Learning Solution
489
17.3 Extending Our Sample Application with Blockchain
493
17.3.1 SAP Cloud Platform Blockchain-Based on Hyperledger Fabric Technology
494
17.3.2 Creating Required SAP Cloud Platform Blockchain Services and Deploying the Blacklist Chaincode Example
497
17.3.3 Cloud Foundry Service Authorization for SAP Cloud Platform Blockchain
499
17.3.4 Interacting with the Deployed Chaincode
501
17.4 Summary
503
Part V: In-App Extensibility
505
18 In-App Extensibility in SAP S/4HANA
507
18.1 Cloud Qualities of In-App Extensibility
508
18.2 In-App Extensibility Patterns and Key User Tools
509
18.2.1 UI Adaptation
510
18.2.2 Custom CDS Views
511
18.2.3 Field Extensibility
511
18.2.4 Business Logic Extensibility and Process Extensibility
512
18.2.5 Custom Business Objects
513
18.2.6 Further Tools
514
18.2.7 Lifecycle Aspects
514
18.3 Integration Aspects
515
18.3.1 Field Extensibility
515
18.3.2 Custom APIs
515
18.3.3 Business Logic
516
18.4 When to Use What
517
18.5 In-App Extensibility in SAP S/4HANA On-Premise Systems
518
18.6 Summary
519
19 Forms of In-App Extensibility
521
19.1 Setup and Authorization to Use In-App Extensibility
521
19.2 Extensibility Cockpit
524
19.3 Custom Fields
525
19.4 UI and Layout Adaptations
528
19.5 Custom Business Objects
531
19.6 Custom CDS Views
537
19.7 Exposing CDS Views and Custom Business Objects as OData Services
539
19.8 Custom Business Logic
541
19.9 Custom Business Logic for Calling Web Services
544
19.9.1 Communication System and Arrangement
545
19.9.2 External Call Implementation
547
19.10 Summary
551
20 Consuming In-App Extensions in a Side-by-Side Extension
553
20.1 Extending the Business Partner Address Manager Application with Custom Fields
554
20.1.1 Overview of Planned Use Case
554
20.1.2 Using the SAP S/4HANA Cloud SDK to Consume Custom Fields
556
20.1.3 Updating the API and UI of the Sample Application
559
20.1.4 Further Considerations
560
20.2 Extending the Virtual Data Model for Custom OData Services
561
20.2.1 When to Extend the Virtual Data Model
561
20.2.2 How to Extend the Virtual Data Model
563
20.3 Delivering Side-by-Side Extensions That Rely on In-App Extensions
566
20.4 Summary
567
Part VI: Partner Case Study and Outlook
569
21 Partner Application Development Using the SAP S/4HANA Cloud SDK (Case Study)
571
21.1 Introduction
571
21.1.1 About msg
571
21.1.2 Reinsurance Domain
572
21.2 The Business Scenario
573
21.2.1 Functional Description
573
21.2.2 Essential Cross-Functional Attributes
574
21.3 Project Setup
575
21.4 Architectural Overview
576
21.4.1 Architecture and Design
577
21.4.2 Design Decisions
580
21.5 Using SAP S/4HANA Cloud SDK in Partner Applications
581
21.5.1 Using the SAP S/4HANA Cloud SDK in the Overall Application Architecture
581
21.5.2 Collaboration and Working Model with SAP
582
21.6 Benefits and Lessons Learned
583
21.6.1 Overall Experience of Using SAP S/4HANA Cloud SDK
583
21.6.2 Benefits of Using SAP S/4HANA Cloud SDK
583
21.6.3 Lessons Learned
586
21.7 Summary
587
22 Outlook
589
22.1 Outlook
590
22.1.1 Introducing Declarative Programming Approaches
591
22.1.2 Seamless Integration
593
22.1.3 UI Integration
595
22.1.4 User and Role Federation
595
22.1.5 Transparent Data Access or Business Data-as-a-Service
596
22.1.6 Workflows and Business Rules
597
22.2 Summary
598
A Bibliography
599
A.1 Books
599
A.2 Journals and Reports
600
A.3 Websites and Blogs
600
B The Authors
605
Index
613