logo资料库

HA400 ABAP programing for HANA.pdf

第1页 / 共623页
第2页 / 共623页
第3页 / 共623页
第4页 / 共623页
第5页 / 共623页
第6页 / 共623页
第7页 / 共623页
第8页 / 共623页
资料共623页,剩余部分请下载后查看
toc
Icons in Body Text
toc
Introduction
Lesson:
SAP HANA Goals
SAP HANA Application Architectures
Types of SAP HANA-Based Applications
SAP HANA Innovations and Challenges
In-Memory Computing and the Shift of Performance Bottlenecks
Column Store versus Row Store
Data Compression
Partitioning and Parallel Processing
ABAP Programming for SAP HANA: Evolution and Opportunities
What s in it for ABAP Programmers?
Exercise 1: Log on to ABAP Systems and Create Packages
Task 1: Log on to Application Server ABAP with SAP HANA as prima
Lesson:
SAP HANA Studio – An Eclipse Based Tool
Details of HANA Studio
Systems – Access to SAP HANA Server
The Catalog – Tables
SAP HANA Content – Packages and Models
Transport of SAP HANA Content: Delivery Units
Exercise 2: Log on to SAP HANA
Task 1: Log on to SAP HANA
Lesson:
Using ABAP Development Tools
Working with ADT
Exercise 3: Create a Project in ABAP Development Tools
Task 1: Create a Project in ABAP Development Tools
Lesson:
Enterprise Procurement Model (EPM)
Taking ABAP to SAP HANA
Lesson:
Secondary Database Connections
Access to a Secondary Database with Open SQL
Exercise 4: Access SAP HANA Via a Secondary Database Connection
Task 1: Copy and understand templates
Source code extract from model solution (Program HA400_EPM_SEC_D
Lesson:
Considerations before migrating to SAP HANA
Performance Considerations
Exercise 5: Improve Open SQL Using ABAP Test Cockpit (ATC)
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_OPT_O
Lesson:
Best Practice when transitioning ABAP code for SAP HANA
Determining an ABAP System s SQL Profile: SQL Monitor
Creating a Prioritized Worklist
In-depth Analysis of Performance Issues
Exercise 6: Use the SQL Performance Tuning Worklist to Analyze S
Task 1: Understand package HA400_EPM_SWLT
Exercise 7: (Optional) Improve Open SQL Statements Using The SQL
Task 1: Analyze
Source code extract from model solution (Program HA400_EPM_OPT_O
Lesson:
Performance Guidelines for ABAP on SAP HANA
Code-to-Data with SAP HANA as Secondary Database
Lesson:
The Code-to-Data Paradigm
Open SQL
Lesson:
Basic Features of ADBC
Usage of ADBC
Lesson:
Native SQL in ABAP
Native SQL and Open SQL
Testing Native SQL Statements in the SAP HANA Studio
Exercise 8: Issue a Native SQL Join Via ADBC
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_NATIV
Exercise 9: (Optional) Use Native SQL to Access SAP HANA Specifi
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_NATIV
Lesson:
Code-to-Data in ABAP releases < ABAP 7.4
Search for SAP HANA Views
Definition of SAP HANA Views
Attribute Views
Analytic Views
Calculation Views
Test and Data Preview
Lesson:
Consuming SAP HANA Views Using Native SQL
SAP HANA Views without Input Parameters
SAP HANA Views with Input Parameters
Exercise 10: Analyze a SAP HANA View and Use it in Native SQL
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_HANA_
Lesson:
Searching for SAP HANA Procedures
Analyzing SAP HANA Procedures
Testing SAP HANA Procedures
Lesson:
Exercise 11: Analyze a SAP HANA Database Procedure and Call it w
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_PROCE
Code-to-Data with ABAP 7.4
Lesson:
Exercise 12: New Features in OpenSQL
Source code extract from model solutions
Lesson:
Concept of Core Data Services
Defining and using Core Data Services in ABAP
Enhancing Core Data Services in ABAP
Exercise 13: Core Data Services in ABAP
Source code extract from the solution, DDL Source HA400_EPM_DDL_
DDL Source HA400_EPM_DDL_ADVANCED_S2
Program HA400_EPM_CDS_S1
Lesson:
Core Data Services provide extended support for treating relatio
Exercise 14: Use Associations in Core Data Services in ABAP
Task 1: Copy and understand template
Source code extract from the solution (DDL Source HA400_EPM_DDL_
Code-to-Data with SAP HANA as Primary Database
Lesson:
Core Data Services Views with Input Parameters
Exercise 15: (Optional) Core Data Services View with Input Param
Task 1: Copy and understand template
DDL Source HA400_EPM_DDL_SO_WITH_CUST_S2
ABAP program HA400_EPM_CDS_S2
Lesson:
Motivation for ABAP-managed Database Procedures
Creating AMDPs
Using AMDPs
Enhancing ABAP-managed Database Procedures
Exercise 16: Create and call an ABAP-Managed Database Procedure
(Class CL_HA400_EPM_AMDP_CLASSIFY_S1)
(Program HA400_EPM_AMDP_CLASSIFY_S1)
Lesson:
When ABAP code using ABAP-managed database procedures does not w
Exercise 17: Debug an ABAP-managed Database Procedure
SAP HANA Proxy Objects
Lesson:
Code-to-Data with ABAP 7.4 ≥ SP02
External Views
What are External Views?
Create External Views in ABAP Development Tools (ADT)
Data Type Mapping between SAP HANA and ABAP Dictionary
Using SAP HANA Views in Select Statements
Exercise 18: Create an External View for SAP HANA View and Use i
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_EXT_V
Lesson:
Database Procedure Proxies
How do Database Procedure Proxies Work?
Database Procedure Proxies in ABAP Development Tools (ADT)
Data Type Mapping between SAP HANA and ABAP Dictionary
Calling Database Procedure Proxies in ABAP
Summary: Code-to-Data Techniques
Exercise 19: Call a Database Procedure Proxy for a SAP HANA Proc
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_PROC_
Lesson:
HANA Transport Containers
Using HANA Transport Containers properly
Exercise 20: Create HANA Transport Container for a Delivery Unit
Task 1: Create a HANA Transport Container
Advanced Topics
Lesson:
Fuzzy Search
Motivation and Prerequisites
Creating a Full-Text Index for Fuzzy Search
Using the Fuzzy Search
Linguistic Search
Creating a Full-Text Index for Linguistic Search
Using the Linguistic Search
Using Full Text Search And Type-Ahead Input Fields
Exercise 21: Implement a Fuzzy Search
Task 1: Copy and understand the template
Source code extract from model solution (Program HA400_FUZZY_S1)
Exercise 22: Implement Type-Ahead with Fuzzy Search
Task 1: Copy and understand the template objects
Source code extract from model solution (Report HA400_FUZZY_S2)
Lesson:
SAP ABAP List Viewer with Integrated Data Access
Basic Principles and Advantages
How it Works
Difference between ALV for SAP HANA and Classical ALV
Technical Difference
End User Perspective
Implementing ALV for SAP HANA
Using Select Options
Referencing Data Elements
External Views with Input Parameters
Using Fuzzy Search
Things to keep in Mind
Exercise 23: Use ALV Optimized for SAP HANA
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_HANA_
Case Study: Optimize a Report on Flight Customer Revenue
Lesson:
Exercise 24: Case Study Part 1: Create a SAP HANA Analytic View
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_CASE_STUD
Exercise 25: Case Study Part 2: Use ALV optimized for SAP HANA
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_CASE_STUD
Appendix: Alternative Exercises
Lesson:
Exercise 26: Log on to ABAP Systems and Create Packages
Task 1: Log on to Application Server ABAP with SAP HANA as prima
Exercise 27: Create a Project in ABAP Development Tools
Task: Create a Project in ABAP Development Tools
Exercise 28: Access SAP HANA Via a Secondary Database Connection
Task 1: Copy and understand templates
Source code extract from model solution (Program HA400_SEC_DB_CO
Exercise 29: Improve Open SQL by Using Code Inspector (SCI)
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_OPT_OSQL_
Exercise 30: (Optional) Improve Open SQL Statements Using The SQ
Task 1: Analyze
Source code extract from model solution (Program HA400_OPT_OSQL_
Exercise 31: Issue a Native SQL Join Via ADBC
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_NATIVE_SQ
Exercise 32: (Optional) Use Native SQL to Access SAP HANA Specif
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_NATIVE_SQ
Exercise 33: Analyze a SAP HANA View and Use it in Native SQL
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_HANA_VIEW
Exercise 34: Analyze a SAP HANA Database Procedure and Call it w
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_PROCEDURE
Exercise 35: Use New Open SQL Syntax
Task 1: Copy and understand template
Source code extract from the model solution (ABAP DDL Source HA4
Exercise 36: Core Data Services in ABAP
Task 1: Copy and understand template
Source code extract from the model solution
(Program HA400_CDS_VIEW_S1)
Exercise 37: Use Associations in Core Data Services in ABAP
Task 1: Create a copy of the ABAP DDL Source
Source code extract from the model solution
Exercise 38: (Optional) Core Data Services View with Input Param
Task 1: Copy and understand template
DDL Source HA400_CDS_S3
ABAP program HA400_CDS_VIEW_S3
Exercise 39: Create and Call an ABAP Managed Database Procedure
Task 1: Copy and understand template program
Source code extract from model solution
(Program HA400_AMDP_S1)
Exercise 40: Debug an ABAP-managed Database Procedure
Program HA400_AMDP_S1
Task 1: Prepare Debugging of the AMDP
Exercise 41: Create an External View for SAP HANA View and Use i
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EXT_VIEW_
Exercise 42: Create a Database Procedure Proxy for a SAP HANA Pr
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_PROC_PROX
Exercise 43: Use ALV Optimized for SAP HANA to Display an Extern
Task 1: Analyze ABAP Dictionary External view
Source code extract from model solution (Program HA400_HANA_ALV_
Appendix: Other New ABAP Language Elements
Lesson:
Exercise 44: Use ABAP Expressions and Inline Data Declarations t
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_EXPR_
Exercise 45: Use Table Expressions to Simplify Native SQL Calls
Task 1: Copy and understand template
Source code extract from model solution (Program HA400_EPM_EXPR_
HA400 ABAP Programming for SAP HANA SAP HANA Date Training Center Instructors Education Website Participant Handbook Course Version: 09 Course Duration: 3 Day(s) Material Number: 50128433 An SAP course - use it to learn, reference it for work
Copyright Copyright © SAP SE or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE. The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. Trademarks Adobe, the Adobe logo, Acrobat, PostScript, and Reader are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and other countries. Apple, App Store, FaceTime, iBooks, iPad, iPhone, iPhoto, iPod, iTunes, Multi-Touch, Objective-C, Retina, Safari, Siri, and Xcode are trademarks or registered trademarks of Apple Inc. Bluetooth is a registered trademark of Bluetooth SIG Inc. Citrix, ICA, Program Neighborhood, MetaFrame now XenApp, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems Inc. Computop is a registered trademark of Computop Wirtschaftsinformatik GmbH. Edgar Online is a registered trademark of EDGAR Online Inc., an R.R. Donnelley & Sons Company. Facebook, the Facebook and F logo, FB, Face, Poke, Wall, and 32665 are trademarks of Facebook. Google App Engine, Google Apps, Google Checkout, Google Data API, Google Maps, Google Mobile Ads, Google Mobile Updater, Google Mobile, Google Store, Google Sync, Google Updater, Google Voice, Google Mail, Gmail, YouTube, Dalvik, and Android are trademarks or registered trademarks of Google Inc. HP is a registered trademark of the Hewlett-Packard Development Company L.P. HTML, XML, XHTML, and W3C are trademarks, registered trademarks, or claimed as generic terms by the Massachusetts Institute of Technology (MIT), European Research Consortium for Informatics and Mathematics (ERCIM), or Keio University. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, z10, z/VM, z/OS, OS/390, zEnterprise, PowerVM, Power Architecture, Power Systems, POWER7, POWER6+, POWER6, POWER, PowerHA, pureScale, PowerPC, BladeCenter, System Storage, Storwize, XIV, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, AIX, Intelligent Miner, WebSphere, Tivoli, Informix, and Smarter Planet are trademarks or registered trademarks of IBM Corporation. Microsoft, Windows, Excel, Outlook, PowerPoint, Silverlight, and Visual Studio are registered trademarks of Microsoft Corporation. INTERMEC is a registered trademark of Intermec Technologies Corporation. IOS is a registered trademark of Cisco Systems Inc. The Klout name and logos are trademarks of Klout Inc. Linux is the registered trademark of Linus Torvalds in the United States and other countries. Motorola is a registered trademark of Motorola Trademark Holdings LLC. Mozilla and Firefox and their logos are registered trademarks of the Mozilla Foundation. Novell and SUSE Linux Enterprise Server are registered trademarks of Novell Inc. g201521710362
OpenText is a registered trademark of OpenText Corporation. Oracle and Java are registered trademarks of Oracle and its affiliates. QR Code is a registered trademark of Denso Wave Incorporated. RIM, BlackBerry, BBM, BlackBerry Curve, BlackBerry Bold, BlackBerry Pearl, BlackBerry Torch, BlackBerry Storm, BlackBerry Storm2, BlackBerry PlayBook, and BlackBerry AppWorld are trademarks or registered trademarks of Research in Motion Limited. SAVO is a registered trademark of The Savo Group Ltd. The Skype name is a trademark of Skype or related entities. Twitter and Tweet are trademarks or registered trademarks of Twitter. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Wi-Fi is a registered trademark of Wi-Fi Alliance. SAP, R/3, ABAP, BAPI, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, Sybase, Adaptive Server, Adaptive Server Enterprise, iAnywhere, Sybase 365, SQL Anywhere, Crossgate, B2B 360° and B2B 360° Services, m@gic EDDY, Ariba, the Ariba logo, Quadrem, b-process, Ariba Discovery, SuccessFactors, Execution is the Difference, BizX Mobile Touchbase, It's time to love work again, SuccessFactors Jam and BadAss SaaS, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE in Germany or an SAP affiliate company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. Disclaimer These materials are subject to change without notice. These materials are provided by SAP SE and its affiliated companies (“SAP Group”) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. g201521710362
g201521710362
About This Handbook This handbook is intended to complement the instructor-led presentation of this course, and serve as a source of reference. It is not suitable for self-study. Typographic Conventions American English is the standard used in this handbook. The following typographic conventions are also used. Type Style Example text Example text EXAMPLE TEXT Example text Example text Description Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options. Also used for cross-references to other documentation both internal and external. Emphasized words or phrases in body text, titles of graphics, and tables Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example SELECT and INCLUDE. Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, and passages of the source text of a program. Exact user entry. These are words and characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries. 2015 © SAP SE or an SAP affiliate company. All rights reserved. v
About This Handbook HA400 Icons in Body Text The following icons are used in this handbook. Icon Meaning For more information, tips, or background Note or further explanation of previous point Exception or caution Procedures Indicates that the item is displayed in the instructor's presentation. vi © SAP SE or an SAP affiliate company. All rights reserved. 2015
Contents Course Overview .......................................................... ix Course Goals ........................................................... ix Course Objectives ..................................................... ix Unit 1: Introduction........................................................ 1 SAP HANA Basics and Technical Concepts ........................3 Introduction to SAP HANA Studio .................................. 22 Introduction to ABAP Development Tools (ADT) ................. 33 Introduction to the EPM Sample Application ...................... 48 Unit 2: Taking ABAP to SAP HANA .................................. 55 SAP HANA as Secondary Database – Access via Open SQL . 57 Preparing for SAP HANA ............................................ 71 Guided Performance Analysis....................................... 92 Performance Rules and Guidelines for SAP HANA ............. 116 Unit 3: Code-to-Data with SAP HANA as Secondary Database ..................................................................123 Classical Open SQL and Its Limitations ..........................125 ABAP Database Connectivity (ADBC) ............................131 Native SQL Syntax...................................................135 Working with Views in SAP HANA Studio ........................156 Consuming SAP HANA Views via Native SQL ..................165 Working With Database Procedures in SAP HANA Studio.....180 Calling SAP HANA Procedures in ABAP .........................186 Unit 4: Code-to-Data with ABAP 7.4 ................................201 New Open SQL ......................................................202 Core Data Services in ABAP .......................................216 Associations in Core Data Services ...............................238 Unit 5: Code-to-Data with SAP HANA as Primary Database ..251 Core Data Services with Input Parameters.......................252 ABAP-Managed Database Procedures ...........................263 Debugging ABAP-managed Database Procedures .............284 Unit 6: SAP HANA Proxy Objects ...................................295 Accessing SAP HANA Views via ABAP Dictionary External Views...............................................................297 2015 © SAP SE or an SAP affiliate company. All rights reserved. vii
Contents HA400 Calling SAP HANA Procedures via ABAP Database Procedure Proxies.............................................................312 Transport of SAP HANA Objects ..................................326 Unit 7: Advanced Topics ..............................................337 Using SAP HANA Full Text Search................................338 ABAP List Viewer (ALV) with Integrated Access to SAP HANA 365 Unit 8: Case Study: Optimize a Report on Flight Customer Revenue ...................................................................387 Creating an Analytic View...........................................388 Unit 9: Appendix: Alternative Exercises ..........................417 Exercises Based on Flight Data Model ...........................419 Unit 10: Appendix: Other New ABAP Language Elements ...571 Additional ABAP Language Enhancements ......................572 viii © SAP SE or an SAP affiliate company. All rights reserved. 2015
分享到:
收藏