SAP HANA DEVELOPER GUIDE doc

397 558 7
SAP HANA DEVELOPER GUIDE doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

PUBLIC SAP HANA Appliance Software SPS 05 Document Version: 1.1 - 2012-12-21 SAP HANA Developer Guide Table of Contents 1 Document History 9 2 Overview 10 3 SAP HANA 11 3.1 The SAP HANA In-Memory Database 11 3.1.1 Columnar Data Storage 11 3.1.2 Parallel Processing 12 3.1.3 Simplifying Applications 12 3.2 SAP HANA Database Architecture 13 3.3 SAP HANA Extended Application Services 14 3.4 Refactoring SAP HANA Based Applications 17 4 SAP HANA as a Development Platform 18 4.1 Developer Scenarios 18 4.1.1 Scenario: Developing Native SAP HANA Applications 19 4.1.2 Scenario: Using Database Client Interfaces 20 4.2 Development Objects 21 4.3 Repository 23 4.4 SAP HANA Studio 25 4.4.1 Modeler Perspective 26 4.4.2 SAP HANA Development Perspective 27 4.4.3 Debug Perspective 32 4.4.4 Administration Console Perspective 33 4.5 Getting Started 34 4.5.1 Adding a System 35 5 Setting Up Your Application 36 5.1 Setting up Delivery Units 37 5.1.1 Maintaining the Delivery-Unit Vendor ID 37 5.1.2 SAP HANA Delivery Unit Naming Conventions 38 5.1.3 Creating a Delivery Unit 38 5.2 Using SAP HANA Projects 39 5.2.1 SAP HANA Repository: Workspaces 40 5.2.2 Creating a Repository Workspace 40 5.2.3 SAP HANA Studio Projects 41 5.2.4 Creating a Project for SAP HANA XS 42 5.2.5 Sharing a Project for SAP HANA XS 42 2 P U BL I C © 2012 SAP AG. All rights reserved. SAP HANA Developer Guide Table of Contents 5.2.6 Importing a Project in SAP HANA XS 43 5.3 Maintaining Repository Packages 44 5.3.1 SAP HANA Repository Packages and Namespaces 45 5.3.2 Defining Repository Package Privileges 48 5.3.3 Creating a Package 48 5.3.4 Defining a Package Hierarchy 49 5.4 Creating the Application Descriptors 51 5.4.1 The SAP HANA XS Application Descriptor 51 5.4.2 Create an Application Descriptor File 52 5.4.3 The Application-Access File 52 5.4.4 Application-Access File Keyword Options 55 5.4.5 Application-Access URL Rewrite Rules 59 5.4.6 Enabling Access to SAP HANA XS Application Packages 61 5.4.7 The Application-Privileges File 63 5.4.8 Create an SAP HANA XS Application Privileges File 64 5.5 Tutorial: My First SAP HANA Application 65 5.5.1 Open the Development Perspective 65 5.5.2 Add a System 67 5.5.3 Add a Workspace 69 5.5.4 Add a Project 70 5.5.5 Share Your Project 71 5.5.6 Write Server-Side JavaScript 73 5.5.7 Retrieve Data 75 6 Setting Up the Persistence Model 77 6.1 Schema 78 6.2 Creating Schemas 79 6.3 Tables 80 6.4 Table Configuration Schema 81 6.5 Creating Tables 85 6.6 Sequences 86 6.7 Creating Sequences 87 6.8 SQL Views 88 6.9 Creating SQL Views 89 6.10 Data Provisioning Using Table Import 90 6.10.1 Table-Import Model 91 6.10.2 Table-Import Data 91 6.10.3 Table-Import Extensions 92 6.10.4 Table-Import Configuration-File Syntax 92 6.11 Importing Data Using Table Import 93 6.12 Using Imported Table Data in SAP HANA 95 6.13 Using Imported Table Data in an SAP HANA XS Application 96 SAP HANA Developer Guide Table of Contents P UBL I C © 2012 SAP AG. All rights reserved. 3 6.14 Extending a Table Import 98 7 Setting Up the Analytic Model 100 7.1 Setting Up the Modeling Environment 102 7.1.1 Setting Modeler Preferences 102 7.1.2 Configuring the Import Server 104 7.1.3 Importing Table Definitions 104 7.1.4 Loading Data into Tables 106 7.1.5 Copying Content Delivered by SAP 108 7.1.6 Mapping the Authoring Schema to the Physical Schema 109 7.1.7 Generating Time Data 111 7.2 Creating Views 111 7.2.1 Attributes and Measures 111 7.2.2 Attribute Views 113 7.2.3 Creating Attribute Views 113 7.2.4 Analytic Views 117 7.2.5 Creating Analytic Views 118 7.2.6 Calculation Views 124 7.2.7 Creating Calculation Views 125 7.2.8 Assigning Variables 132 7.2.9 Creating Input Parameters 134 7.2.10 Creating Hierarchies 136 7.2.11 Using Currency and Unit of Measure 139 7.2.12 Activating Objects 141 7.3 Creating Decision Tables 142 7.3.1 Changing the Layout of a Decision Table 148 7.3.2 Using Parameters in a Decision Table 148 7.4 Managing Object Versions 149 7.4.1 Switching Ownership of Inactive Objects 149 7.4.2 Toggling Versions of Content Objects 150 7.4.3 Viewing Version History of Content Objects 151 7.5 Working with Objects 151 7.5.1 Managing Layout 151 7.5.2 Filtering Packages and Objects 151 7.5.3 Refactoring Objects 152 7.5.4 Validating Models 153 7.5.5 Generating Object Documentation 153 7.5.6 Enabling Multilanguage Support for Objects 154 7.5.7 Checking Model References 154 7.5.8 Viewing the Job Log 155 7.5.9 Maintaining Search Attributes 155 7.5.10 Previewing Data of Content Objects 155 4 P UBL I C © 2012 SAP AG. All rights reserved. SAP HANA Developer Guide Table of Contents 7.5.11 Functions used in Expressions 156 7.5.12 Searching Tables, Models and Column Views 161 7.5.13 Setting Keyboard Shortcuts 162 7.5.14 Copying an Object 163 7.6 Importing BW Objects 163 8 Developing Procedures 167 8.1 Editing SQLScript 168 8.1.1 Defining Local Table Types in Procedures 170 8.2 Debugging SQLScript 170 8.3 Developing Procedures in the Modeler Editor 172 9 Defining Web-based Data Access 174 9.1 Data Access with OData in SAP HANA XS 174 9.1.1 OData in SAP HANA XS 174 9.1.2 Defining the Data an OData Service Exposes 175 9.1.3 OData Service Definitions 176 9.1.4 Creating an OData Service Definition 178 9.1.5 Tutorial: Using the OData Interface 179 9.1.6 OData Service-Definition Examples 181 9.1.7 OData Service Definition Language Syntax 194 9.1.8 OData Service Definition: SQL-EDM Type Mapping 196 9.1.9 OData URI Parameters, Query Options, and Features 197 9.1.10 OData Security Considerations 213 9.2 Data Access with XMLA in SAP HANA XS 213 9.2.1 XML for Analysis (XMLA) 213 9.2.2 XMLA Service Definition 214 9.2.3 XMLA Security Considerations 215 9.2.4 Multidimensional Expressions (MDX) 215 9.2.5 MDX Functions 216 9.2.6 MDX Extensions 219 9.2.7 Defining the Data an XMLA Service Exposes 222 9.2.8 Creating an XMLA Service Definition 222 10 Writing Server-Side JavaScript Code 224 10.1 Data Access with JavaScript in SAP HANA XS 224 10.2 Writing JavaScript Code 224 10.2.1 Server-Side JavaScript in SAP HANA XS 224 10.2.2 JavaScript Editor 225 10.2.3 Server-Side JavaScript Security Considerations 226 10.2.4 Writing Server-Side JavaScript Application Code 231 10.3 Writing JavaScript Libraries 232 SAP HANA Developer Guide Table of Contents P UBL I C © 2012 SAP AG. All rights reserved. 5 10.3.1 Server-Side JavaScript Libraries 232 10.3.2 Writing Server-Side JavaScript Libraries 233 10.3.3 Importing Server-Side JavaScript Libraries 233 10.4 Server-Side JavaScript APIs 234 10.5 The SQL Connection Configuration File 235 10.6 Tracing JavaScript 237 10.6.1 Server-Side JavaScript Tracing 237 10.6.2 Tracing Server-Side JavaScript Applications 237 10.6.3 Viewing Server-Side JavaScript Application Trace Files 238 10.7 Debugging JavaScript 238 10.7.1 Opening a Port for JavaScript Debugging 240 11 Building UIs 242 11.1 Building UIs with SAPUI5 242 11.1.1 Installing SAPUI5 Application Development Tools 242 11.1.2 Creating an SAPUI5 Application 243 11.1.3 Supporting Translation 247 11.2 Using UI Integration Services 247 11.2.1 Creating an Application Site 248 11.2.2 Creating a Widget 248 11.2.3 Designing an Application Site 249 11.2.4 Developing Widgets 250 12 Enabling Search 258 12.1 Creating Full Text Indexes 258 12.1.1 Full Text Index Types 260 12.1.2 Synchronization 263 12.1.3 Text Analysis 265 12.1.4 Dropping Full Text Indexes 269 12.1.5 Altering Full Text Index Parameters 269 12.1.6 Full Text Index Parameters 270 12.2 Building SQL Search Queries 275 12.2.1 Search Queries with CONTAINS 275 12.2.2 EXACT Search 278 12.2.3 LINGUISTIC Search 279 12.2.4 FUZZY Search 279 12.3 Building Search Apps 331 12.3.1 Introduction to the UI Toolkit for Info Access 331 12.3.2 Installing the Service and the Toolkit 332 12.3.3 Getting to Know the Demo App 333 12.3.4 Getting to Know the Demo HTML 334 12.3.5 Preparing Your Source Data 335 6 P UBL I C © 2012 SAP AG. All rights reserved. SAP HANA Developer Guide Table of Contents 12.3.6 Connecting Your Source Data 337 12.3.7 Defining the Page Layout 338 12.3.8 Configuring the Widgets 338 12.3.9 Defining the Layout of Result Lists and Details 342 13 Setting Up Roles and Authorizations 343 13.1 The Authorization Model 343 13.2 Authentication Overview 344 13.3 Roles 344 13.3.1 Roles 345 13.3.2 Roles as Repository Objects 346 13.3.3 Creating Roles in the Repository 347 13.4 Privileges 352 13.4.1 System Privileges 352 13.4.2 Object Privileges 352 13.4.3 Package Privileges 353 13.4.4 Analytic Privileges 355 13.4.5 Creating Analytic Privileges 364 13.4.6 Granting Privileges to Users 368 13.5 Application Access 369 14 Implementing Lifecycle Management 371 14.1 SAP HANA Delivery Units 371 14.2 The SAP HANA Delivery-Unit Lifecycle 371 14.3 Exporting Delivery Units 372 14.4 Importing Delivery Units 374 14.5 Translating Delivery Units 375 14.5.1 SAP HANA Delivery-Unit Translation Details 376 14.5.2 Maintaining Translation Details 376 15 Using Database Client Interfaces 378 15.1 Connecting via ODBC 378 15.1.1 Using the User Store 379 15.1.2 Testing the ODBC Installation 380 15.2 Connecting via JDBC 381 15.2.1 Tracing JDBC Connections 382 15.2.2 Valid Java-to-SQL Conversions 384 15.3 Connecting via ODBO 385 15.3.1 Connecting with Microsoft Excel 385 15.3.2 Multidimensional Expressions (MDX) 388 15.3.3 MDX Functions 389 15.3.4 MDX Extensions 393 SAP HANA Developer Guide Table of Contents P UBL I C © 2012 SAP AG. All rights reserved. 7 16 SAP HANA Developer References 396 8 P U BL I C © 2012 SAP AG. All rights reserved. SAP HANA Developer Guide Table of Contents 1 Document History The document history includes all versions of the document that have been published. Version Date SAP HANA Revision Description 1.1 21 Dec 2012 47 References to the following have been added:  Sections 7.2.3, Creating Attribute Views and 7.2.5, Creating Analytic Views have been updated for Label Mapping functionality.  Section 7.6, Importing BW Objects has been updated with the support to import role based authorizations into the Modeler as analytic privileges.  Section 8.1.1, Defining Local Table Types in Procedures .  Section 11.2, Using UI Integration Services . SAP HANA Developer Guide Document History P UBL I C © 2012 SAP AG. All rights reserved. 9 2 Overview This guide presents a developers view of SAP HANA ® . It explains how to use the SAP HANA development tools to create comprehensive analytical models and to build applications with SAP HANA's programmatic interfaces and integrated development environment, including to develop native code that runs inside SAP HANA. The guide is organized as follows:  SAP HANA [page 11] describes the capabilities of SAP HANA.  SAP HANA as a Development Platform [page 18] describes the main developer scenarios, the development process and the development environment.  Setting Up Your Application [page 36] describes how to get started developing SAP HANA applications. Most of the remaining chapters explain how to develop various SAP HANA development objects. Note: Application development with SAP HANA Extended Application Services (SAP HANA XS) is currently only available as an SAP-led project solution, for pre-approved customers and partners. This applies to server-side JavaScript programming, support for ODATA and XMLA, Web server features and the Web application development environment. For more information, see SAP Note 1779803 . Audience This guide is aimed at two developer roles:  Modeler: This person, often a business/data analyst or database expert, is concerned with the definition of the model and schemas that will be used in SAP HANA, the specification and definition of tables, views, primary keys, indexes, partitions and other aspects of the layout and inter-relationship of the data in SAP HANA. The data modeler is also concerned with designing and defining authorization and access control, through the specification of privileges, roles and users. The modeler generally uses the Administration Console and Modeler perspectives and tools of the SAP HANA studio.  Application Programmer: The programmer is concerned with building SAP HANA applications, which could take many forms but are designed based on the model-view-controller architecture. Programmers develop the code for:  View, which could run inside a browser or on a mobile device  Controller, which typically runs in the context of an application server  Model, which interacts closely with the data model, performs efficient queries, and may be developed to run within the SAP HANA data engine, using embedded procedures or libraries The programmer generally uses the SAP HANA Development perspective and tools of the SAP HANA studio. 10 P U BL I C © 2012 SAP AG. All rights reserved. SAP HANA Developer Guide Overview . C © 2012 SAP AG. All rights reserved. SAP HANA Developer Guide SAP HANA SAP HANA greatly extends the traditional database server role. SAP HANA functions. server.The following shows the SAP HANA XS server as part of the SAP HANA system. SAP HANA Developer Guide SAP HANA P UBL I C © 2012 SAP AG. All rights reserved. 15 The

Ngày đăng: 17/03/2014, 00:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan