hana_dev_en

Upload: ashishgaur007

Post on 02-Mar-2016

135 views

Category:

Documents


0 download

DESCRIPTION

Hana material

TRANSCRIPT

  • PUBLICSAP HANA Appliance Software SPS 05Document Version: 1.0 - 2012-11-29

    SAP HANA Developer Guide

  • Table of Contents

    1 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    2 SAP HANA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92.1 The SAP HANA In-Memory Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    2.1.1 Columnar Data Storage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.2 Parallel Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102.1.3 Simplifying Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.2 SAP HANA Database Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3 SAP HANA Extended Application Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.4 Refactoring SAP HANA Based Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    3 SAP HANA as a Development Platform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.1 Developer Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    3.1.1 Scenario: Developing Native SAP HANA Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.1.2 Scenario: Using Database Client Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    3.2 Development Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.3 Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213.4 SAP HANA Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    3.4.1 Modeler Perspective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.4.2 SAP HANA Development Perspective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.4.3 Debug Perspective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.4.4 Administration Console Perspective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    3.5 Getting Started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.5.1 Adding a System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    4 Setting Up Your Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.1 Setting up Delivery Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    4.1.1 Maintaining the Delivery-Unit Vendor ID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354.1.2 SAP HANA Delivery Unit Naming Conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.1.3 Creating a Delivery Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    4.2 Using SAP HANA Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374.2.1 SAP HANA Repository: Workspaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.2.2 Creating a Repository Workspace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.2.3 SAP HANA Studio Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.2.4 Creating a Project for SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.2.5 Sharing a Project for SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.2.6 Importing a Project in SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    4.3 Maintaining Repository Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    2P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideTable of Contents

  • 4.3.1 SAP HANA Repository Packages and Namespaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .434.3.2 Defining Repository Package Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.3.3 Creating a Package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.3.4 Defining a Package Hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

    4.4 Creating the Application Descriptors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494.4.1 The SAP HANA XS Application Descriptor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494.4.2 Create an Application Descriptor File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .504.4.3 The Application-Access File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.4.4 Application-Access File Keyword Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534.4.5 Application-Access URL Rewrite Rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564.4.6 Enabling Access to SAP HANA XS Application Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . 574.4.7 The Application-Privileges File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594.4.8 Create an SAP HANA XS Application Privileges File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    4.5 Tutorial: My First SAP HANA Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.5.1 Open the Development Perspective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.5.2 Add a System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.5.3 Add a Workspace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664.5.4 Add a Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674.5.5 Share Your Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684.5.6 Write Server-Side JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704.5.7 Retrieve Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

    5 Setting Up the Persistence Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745.1 Schema. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755.2 Creating Schemas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765.3 Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765.4 Creating Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775.5 Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785.6 Creating Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .795.7 SQL Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805.8 Creating SQL Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815.9 Data Provisioning Using Table Import. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

    5.9.1 Table-Import Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835.9.2 Table-Import Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835.9.3 Table-Import Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845.9.4 Table-Import Configuration-File Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

    5.10 Importing Data Using Table Import. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855.11 Using Imported Table Data in SAP HANA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875.12 Using Imported Table Data in an SAP HANA XS Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .885.13 Extending a Table Import. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

    SAP HANA Developer GuideTable of Contents

    P U B L I C 2012 SAP AG. All rights reserved. 3

  • 6 Setting Up the Analytic Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .926.1 Setting Up the Modeling Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    6.1.1 Setting Modeler Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946.1.2 Configuring the Import Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956.1.3 Importing Table Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 956.1.4 Loading Data into Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 976.1.5 Copying Content Delivered by SAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 996.1.6 Mapping the Authoring Schema to the Physical Schema. . . . . . . . . . . . . . . . . . . . . . . . . . . 1006.1.7 Generating Time Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102

    6.2 Creating Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1036.2.1 Attributes and Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1036.2.2 Attribute Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1046.2.3 Creating Attribute Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1056.2.4 Analytic Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096.2.5 Creating Analytic Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1106.2.6 Calculation Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156.2.7 Creating Calculation Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1166.2.8 Assigning Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1236.2.9 Creating Input Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1256.2.10 Creating Hierarchies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1276.2.11 Using Currency and Unit of Measure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1306.2.12 Activating Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

    6.3 Creating Decision Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1336.3.1 Changing the Layout of a Decision Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1396.3.2 Using Parameters in a Decision Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139

    6.4 Managing Object Versions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406.4.1 Switching Ownership of Inactive Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406.4.2 Toggling Versions of Content Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1416.4.3 Viewing Version History of Content Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

    6.5 Working with Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1426.5.1 Managing Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1426.5.2 Filtering Packages and Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1426.5.3 Refactoring Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1436.5.4 Validating Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1446.5.5 Generating Object Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1446.5.6 Enabling Multilanguage Support for Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1456.5.7 Checking Model References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1456.5.8 Viewing the Job Log. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1466.5.9 Maintaining Search Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1466.5.10 Previewing Data of Content Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1466.5.11 Functions used in Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147

    4P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideTable of Contents

  • 6.5.12 Searching Tables, Models and Column Views. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1526.5.13 Setting Keyboard Shortcuts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1536.5.14 Copying an Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    6.6 Importing BW Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

    7 Developing Procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1587.1 Editing SQLScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1597.2 Debugging SQLScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617.3 Developing Procedures in the Modeler Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

    8 Defining Web-based Data Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1648.1 Data Access with OData in SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164

    8.1.1 OData in SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1648.1.2 OData Service Definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1658.1.3 OData URI Parameters, Query Options, and Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1678.1.4 OData Security Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1838.1.5 Defining the Data an OData Service Exposes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1838.1.6 Creating an OData Service Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1838.1.7 OData Service Definition Language Syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1848.1.8 OData Service Definition: SQL-EDM Type Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1868.1.9 OData Service-Definition Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

    8.2 Data Access with XMLA in SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2018.2.1 XML for Analysis (XMLA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2018.2.2 XMLA Service Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2028.2.3 XMLA Security Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2038.2.4 Multidimensional Expressions (MDX). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2038.2.5 MDX Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2048.2.6 MDX Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2078.2.7 Defining the Data an XMLA Service Exposes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2108.2.8 Creating an XMLA Service Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

    9 Writing Server-Side JavaScript Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2129.1 Data Access with JavaScript in SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2129.2 Writing JavaScript Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

    9.2.1 Server-Side JavaScript in SAP HANA XS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2129.2.2 JavaScript Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2139.2.3 Server-Side JavaScript Security Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2149.2.4 Writing Server-Side JavaScript Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

    9.3 Writing JavaScript Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2199.3.1 Server-Side JavaScript Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2199.3.2 Writing Server-Side JavaScript Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2209.3.3 Importing Server-Side JavaScript Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

    SAP HANA Developer GuideTable of Contents

    P U B L I C 2012 SAP AG. All rights reserved. 5

  • 9.4 Server-Side JavaScript APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2219.5 The SQL Connection Configuration File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2229.6 Tracing JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .224

    9.6.1 Server-Side JavaScript Tracing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2249.6.2 Tracing Server-Side JavaScript Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2249.6.3 Viewing Server-Side JavaScript Application Trace Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

    9.7 Debugging JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2259.7.1 Opening a Port for JavaScript Debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

    10 Building UIs with SAPUI5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22910.1 Installing SAPUI5 Application Development Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23010.2 Creating an SAPUI5 Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

    10.2.1 Local Testing of a SAPUI5 Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23210.2.2 SAPUI5 Runtime Version Comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

    10.3 Supporting Translation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

    11 Enabling Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23511.1 Creating Full Text Indexes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

    11.1.1 Full Text Index Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23711.1.2 Synchronization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24011.1.3 Text Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24211.1.4 Dropping Full Text Indexes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24611.1.5 Altering Full Text Index Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24611.1.6 Full Text Index Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

    11.2 Building SQL Search Queries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25211.2.1 Search Queries with CONTAINS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25211.2.2 EXACT Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25511.2.3 LINGUISTIC Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25611.2.4 FUZZY Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

    11.3 Building Search Apps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30811.3.1 Introduction to the UI Toolkit for Info Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30811.3.2 Installing the Service and the Toolkit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30911.3.3 Getting to Know the Demo App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31011.3.4 Getting to Know the Demo HTML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31111.3.5 Preparing Your Source Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31211.3.6 Connecting Your Source Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31411.3.7 Defining the Page Layout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31511.3.8 Configuring the Widgets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31511.3.9 Defining the Layout of Result Lists and Details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

    12 Setting Up Roles and Authorizations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32012.1 The Authorization Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

    6P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideTable of Contents

  • 12.2 Authentication Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32112.3 Roles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321

    12.3.1 Roles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32212.3.2 Roles as Repository Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32312.3.3 Creating Roles in the Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

    12.4 Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32912.4.1 System Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32912.4.2 Object Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32912.4.3 Package Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33012.4.4 Analytic Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33212.4.5 Creating Analytic Privileges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34112.4.6 Granting Privileges to Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

    12.5 Application Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

    13 Implementing Lifecycle Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34813.1 SAP HANA Delivery Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34813.2 The SAP HANA Delivery-Unit Lifecycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34813.3 Exporting Delivery Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34913.4 Importing Delivery Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35113.5 Translating Delivery Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352

    13.5.1 SAP HANA Delivery-Unit Translation Details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35313.5.2 Maintaining Translation Details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

    14 Using Database Client Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35514.1 Connecting via ODBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355

    14.1.1 Using the User Store. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35614.1.2 Testing the ODBC Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

    14.2 Connecting via JDBC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35814.2.1 Tracing JDBC Connections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35914.2.2 Valid Java-to-SQL Conversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

    14.3 Connecting via ODBO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36214.3.1 Connecting with Microsoft Excel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36214.3.2 Multidimensional Expressions (MDX). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36514.3.3 MDX Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36614.3.4 MDX Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

    15 SAP HANA Developer References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

    SAP HANA Developer GuideTable of Contents

    P U B L I C 2012 SAP AG. All rights reserved. 7

  • 1 Overview

    This guide presents a developers 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 9] describes the capabilities of SAP HANA. SAP HANA as a Development Platform [page 16] describes the main developer scenarios, the development

    process and the development environment. Setting Up Your Application [page 34] 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.

    AudienceThis 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.

    8P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideOverview

  • 2 SAP HANA

    SAP HANA is an in-memory data platform that is deployable as an appliance or in the cloud. At its core, it is an innovative in-memory relational database management system that makes full use of the capabilities of current hardware to increase application performance, to reduce cost of ownership, and to enable new scenarios and applications that were not possible before.With SAP HANA, you have the opportunity to build applications that integrate the business control logic and the database layer with unprecedented performance. As a developer, one of the key questions is how you can minimize data movements. The more you can do directly on the data in memory next to the CPUs, the better the application will perform.

    2.1 The SAP HANA In-Memory DatabaseSAP HANA was designed to run on modern, distributed computers built out of multi-core CPUs (multiple CPUs on one chip) with fast communication between processor cores, and containing terabytes of main memory. With SAP HANA, all data is available in main memory, which completely avoids the performance penalty of disk I/O. Either disk or solid-state drives are still required for permanent persistency in the event of a power failure or some other catastrophe. This does not slow down performance, however, because the required backup operations to disk can take place asynchronously as a background task.

    2.1.1 Columnar Data StorageA database table is conceptually a two-dimensional data structure organized in rows and columns. Computer memory, in contrast, is organized as a linear structure. A table can be represented in row-order or column-order. A row-oriented organization stores a table as a sequence of records. Conversely, in column storage the entries of a column are stored in contiguous memory locations. SAP HANA supports both, but is particularly optimized for column-order storage.

    Columnar data storage allows highly efficient compression. Especially if a column is sorted, there will normally be repeated adjacent values. SAP HANA employs highly efficient compression methods, such as run-length encoding, cluster coding and dictionary coding. With dictionary encoding, columns are stored as sequences of bit-coded integers. That means that a check for equality can be executed on the integers (for example during scans or join operations). This is much faster than comparing, for example, string values.

    SAP HANA Developer GuideSAP HANA

    P U B L I C 2012 SAP AG. All rights reserved. 9

  • Columnar storage, in many cases, eliminates the need for additional index structures. Storing data in columns is functionally similar to having a built-in index for each column. The column scanning speed of the in-memory column store and the compression mechanisms especially dictionary compression allow read operations with very high performance. In many cases it will not be required to have additional indexes. Eliminating additional indexes reduces complexity and eliminates effort for defining and maintaining metadata.

    2.1.2 Parallel ProcessingSAP HANA was designed from the ground up to perform its basic calculations (such as analytic joins, scans and aggregations) in parallel, often using hundreds of cores at the same time, fully utilizing the available computing resources of distributed systems.With columnar data, operations on single columns, such as searching or aggregations, can be implemented as loops over an array stored in contiguous memory locations. Such an operation has high spatial locality and can efficiently be executed in the CPU cache. With row-oriented storage, the same operation would be much slower because data of the same column is distributed across memory and the CPU is slowed down by cache misses.Compressed data can be loaded into the CPU cache faster. This is because the limiting factor is the data transport between memory and CPU cache, and so the performance gain will exceed the additional computing time needed for decompression.Column-based storage also allows execution of operations in parallel using multiple processor cores. In a column store, data is already vertically partitioned. This means that operations on different columns can easily be processed in parallel. If multiple columns need to be searched or aggregated, each of these operations can be assigned to a different processor core. In addition, operations on one column can be parallelized by partitioning the column into multiple sections that can be processed by different processor cores.

    2.1.3 Simplifying ApplicationsTraditional business applications often use materialized aggregates to increase performance. These aggregates are computed and stored either after each write operation on the aggregated data, or at scheduled times. Read operations read the materialized aggregates instead of computing them each time they are required.

    10P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA

  • With a scanning speed of several gigabytes per millisecond, SAP HANA makes it possible to calculate aggregates on large amounts of data on-the-fly with high performance. This eliminates the need for materialized aggregates in many cases, simplifying data models, and correspondingly the application logic. Furthermore, with on-the fly aggregation, the aggregate values are always up-to-date unlike materialized aggregates that may be updated only at scheduled times.

    2.2 SAP HANA Database Architecture

    A running SAP HANA system consists of multiple communicating processes (services). The following shows the main SAP HANA database services in a classical application context.

    Such traditional database applications use well-defined interfaces (for example, ODBC and JDBC) to communicate with the database management system functioning as a data source, usually over a network connection. Often running in the context of an application server, these traditional applications use Structured Query Language (SQL) to manage and query the data stored in the database.The main SAP HANA database management component is known as the index server. The index server contains the actual data stores and the engines for processing the data. The index server processes incoming SQL or MDX statements in the context of authenticated sessions and transactions.

    SAP HANA Developer GuideSAP HANA

    P U B L I C 2012 SAP AG. All rights reserved. 11

  • The SAP HANA database has its own scripting language named SQLScript. The motivation for SQLScript is to embed data-intensive application logic into the database. Classical applications tend to offload only very limited functionality into the database using SQL. This results in extensive copying of data from and to the database, and in programs that slowly iterate over huge data loops and are hard to optimize and parallelize. SQLScript is based on side-effect free functions that operate on tables using SQL queries for set processing, and is therefore parallelizable over multiple processors.In addition to SQLScript, SAP HANA supports a framework for the installation of specialized and optimized functional libraries, which are tightly integrated with different data engines of the index server. Two of these functional libraries are the SAP HANA Business Function Library (BFL) and the SAP HANA Predictive Analytics Library (PAL). BFL and PAL functions can be called directly from within SQLScript.SAP HANA also supports the development of programs written in the popular statistics language R.SQL and SQLScript are implemented using a common infrastructure of built-in data engine functions that have access to various meta definitions, such as definitions of relational tables, columns, views, and indexes, and definitions of SQLScript procedures. This metadata is stored in one common catalog.The database persistence layer is responsible for durability and atomicity of transactions. It ensures that the database can be restored to the most recent committed state after a restart and that transactions are either completely executed or completely undone.The index server uses the preprocessor server for analyzing text data and extracting the information on which the text search capabilities are based. The name server owns the information about the topology of a SAP HANA system. In a distributed system, the name server knows where the components are running and which data is located on which server. The statistics server collects information about status, performance and resource consumption from the other servers in the system. Monitoring clients, such as the SAP HANA studio, access the statistics server to get the status of various alert monitors. The statistics server also provides a history of measurement data for further analysis.Related LinksSAP HANA SQLScript ReferenceSAP HANA Business Function Library (BFL) Reference SAP HANA Predictive Analysis Library (PAL) Reference SAP HANA R Integration Guide

    2.3 SAP HANA Extended Application Services

    Traditional database applications use interfaces such as ODBC and JDBC with SQL to manage and query their data. The following illustrates such applications using the common Model-View-Controller (MVC) development architecture.

    12P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA

  • SAP HANA greatly extends the traditional database server role. SAP HANA functions as a comprehensive platform for the development and execution of native data-intensive applications that run efficiently in SAP HANA, taking advantage of its in-memory architecture and parallel execution capabilities.By restructuring your application in this way, not only do you gain from the increased performance due to the integration with the data source, you can effectively eliminate the overhead of the middle-tier between the user-interface (the view) and the data-intensive control logic, as shown in the following figure.

    In support of this data-integrated application paradigm, SAP HANA Extended Application Services provides a comprehensive set of embedded services that provide end-to-end support for Web-based applications. This includes a lightweight web server, configurable OData support, server-side JS execution and, of course, full access to SQL and SQLScript.These SAP HANA Extended Application Services are provided by the SAP HANA XS server, which provides lightweight application services that are fully integrated into SAP HANA. It allows clients to access the SAP HANA system via HTTP. Controller applications can run completely natively on SAP HANA, without the need for an additional external application server.The following shows the SAP HANA XS server as part of the SAP HANA system.

    SAP HANA Developer GuideSAP HANA

    P U B L I C 2012 SAP AG. All rights reserved. 13

  • The application services can be used to expose the database data model, with its tables, views and database procedures, to clients. This can be done in a declarative way using OData services or by writing native application-specific code that runs in the SAP HANA context . Also, you can use SAP HANA XS to build dynamic HTML5 UI applications.In addition to exposing the data model, SAP HANA XS also hosts system services that are part of the SAP HANA system. The search service is an example of such a system application. No data is stored in the SAP HANA XS server itself. To read tables or views, to modify data or to execute SQLScript database procedures and calculations, it connects to the index server (or servers, in case of a distributed system).

    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.

    Related LinksBuilding UIs with SAPUI5 [page 229]

    This section provides introductory information about UI development toolkit for HTML5.Enabling Search [page 235]

    With a SAP HANA database, your users will want to search tables and views much like they would when searching for information on the Internet. In SAP HANA, you can either directly query data using SQL queries or you can build search apps using a UI toolkit.

    14P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA

  • 2.4 Refactoring SAP HANA Based ApplicationsThe possibility to run application-specific code in SAP HANA raises the question: What kind of logic should run where? Clearly, data-intensive and model-based calculations must be close to the data and, therefore, need to be executed in the index server, for instance, using SQLScript or the code of the specialized functional libraries.The presentation (view) logic runs on the client for example, as an HTML5 application in a Web browser or on a mobile device.Native application-specific code, supported by SAP HANA Extended Application Services, can be used to provide a thin layer between the clients on one side, and the views, tables and procedures in the index server on the other side. Typical applications contain, for example, control flow logic based on request parameters, invoke views and stored procedures in the index server, and transform the results to the response format expected by the client. Such applications can also send emails and consume external HTTP-based services.The communication between the SAP HANA XS server and index server is optimized for high performance. However, performance is not the only reason why the SAP HANA XS server was integrated into SAP HANA. It also leads to simplified administration and a better development experience.The SAP HANA XS server completes SAP HANA to make it a comprehensive development platform. With the SAP HANA XS server, developers can write SAP HANA-based applications that cover all server-side aspects, such as tables and database views, database procedures, server-side control logic, integration with external systems, and provisioning of HTTP-based services. The integration of the SAP HANA XS server into the SAP HANA system also helps to reduce cost of ownership, as all servers are installed, operated and updated as one system.

    SAP HANA Developer GuideSAP HANA

    P U B L I C 2012 SAP AG. All rights reserved. 15

  • 3 SAP HANA as a Development Platform

    To simplify and support the development of HANA Based applications, SAP HANA serves as the integrated development environment (IDE) for developing and delivering these SAP HANA applications.Built around the Eclipse-based SAP HANA studio the SAP HANA IDE supports integrated and collaborative development, debugging and deployment of applications that use native database procedures for data processing, server-side JavaScript for control and an HTML5 SDK for the development of user interface representation.The design-time environment's central component is the SAP HANA repository, which stores and manages all design-time objects. The following figure illustrates the principle of co-development with SAP HANA.

    Using the HANA studio on your workstation, you design and create development objects such as data models or server-side code files, and then store, manage and share them with other developers, by interacting with the SAP HANA repository. The repository enables teams to work together on a set of development objects, and ultimately turn them into runtime objects which can be used by clients or other applications. The repository provides the basis for concepts like namespaces (through packages), transport and delivery support.

    3.1 Developer ScenariosThe possibility to run application specific code in SAP HANA creates several possibilities for developing SAP HANA based applications, representing various integration scenarios, and corresponding development processes.Broadly, we distinguish SAP HANA based applications into two broad categories: Web-based scenarios that take full advantage of the SAP HANA Extended Application Services. In these

    scenarios, clients access SAP HANA data using standard OData or XMLA interfaces, or directly use a Web-based GUI that was developed using the SAPGUI5 toolkit, and that uses custom-developed server-side JavaScript, as well as native SQLScript procedures.

    Traditional client-based scenarios, where an external application accesses the SAP HANA data model (tables, analytic views, etc.) via client interfaces such as ODBC, ODBO and JDBC, and only uses SQL and native SQLScript procedures.

    16P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • In either case, as a developer you need to understand the SAP HANA development environment, which enables you to design and develop your data and analytical models, and your other HANA-based development objects in the form of portable and deployable delivery units.Common activities include:

    Table 1: Common ActivitiesActivity More InformationSetting up your development environment. Setting Up Your Application [page 34]Setting up your schema and tables. Setting Up the Persistence Model [page 74]Setting up views of your data. Setting Up the Analytic Model [page 92]Developing procedures for data-intensive logic. Developing Procedures [page 158]Setting up roles and authorizations. i031349596025517.ditamapManaging the delivery of your application. SAP HANA Delivery Units [page 348]

    For these activites, you will want to keep handy the following references: SAP HANA SQL Reference, to help you writing SQL statements within procedures and from your server-side

    JavaScript. SAP HANA SQLScript Reference, to help you if you are writing procedures.The next two sections describes the main scenarios and what activities you may need to perform for them.

    3.1.1 Scenario: Developing Native SAP HANA ApplicationsHere, you want to create a Web-based scenario that takes full advantage of SAP HANA Extended Application Services. In this scenario, clients access SAP HANA data using standard OData or XMLA interfaces, or directly use a Web-based GUI that was developed using the SAPGUI5 toolkit, and that uses custom-developed server-side JavaScript, as well as native SQLScript procedures.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 17

  • For this scenario, you may need to perform the following activities:

    Table 2: Developing Native SAP HANA ApplicationsActivity More InformationDevelop server-side JavaScript for control logic. Writing Server-Side JavaScript Applications [page

    212]

    Define OData data interfaces. Data Access with OData in SAP HANA XS [page 164]

    Define XMLA data interfaces Data Access with XMLA in SAP HANA XS [page 201]

    How to build HTML pages with SAPUI5. Building UIs with SAPUI5 [page 229]

    You will also want to keep handy the following references:

    SAP HANA SQL Reference, to help you write SQL statements within procedures and from your server-side JavaScript.

    SAP HANA XS JavaScript Reference, to help you use the SAP HANA XS JavaScript API.For a list of all references, see SAP HANA Developer References [page 373].

    3.1.2 Scenario: Using Database Client InterfacesHere, you want to build an application outside of SAP HANA, for example, within SAP NetWeaver, that accesses the SAP HANA data model (for example, tables and analytic views) via client interfaces such as ODBC, ODBO and JDBC, and only uses SQL and native SQLScript procedures.

    18P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • For this scenario, you may need to perform the following activities:

    Table 3: Using Database Client InterfacesActivity More InformationInstalling and using the SAP HANA client interfaces Using Database Client Interfaces [page 355]

    Developing procedures for data-intensive logic. Developing Procedures [page 158]

    You will also want to keep handy several references:

    SAP HANA SQL Reference, to help you write SQL statements.For information on MDX in SAP HANA, see MDX Functions [page 204].

    SAP HANA SQLScript Reference, to help you if you are writing procedures.For a list of all references, see SAP HANA Developer References [page 373].

    3.2 Development ObjectsThe design-time building blocks of your SAP HANA applications are called development objects. Some of these development objects, such as projects and packages, are concepts that help you structure your application. Others, like schemas, table definitions, analytical and attribute views, help you organize the structure of your data. Procedures and server-side JavaScript code are the backbone of the SAP HANA application. Other types of development objects help you control the access to runtime objects.Understanding the different development objects and their use is one of the main objectives of this guide.The following are the building blocks for an SAP HANA application, showing the file extension and where to get information for building it:

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 19

  • Table 4: Application Building BlocksObject Description File Extension More InformationStructureProject An Eclipse project for developing your

    application or part of an application. The .project file can be stored in the SAP HANA repository.

    .project SAP HANA Studio Projects [page 39]

    Package A container in the repository for development objects.

    Packages are represented by folders.

    Maintaining Repository Packages [page 42]

    Modeling DataSchema A database schema for organizing database

    objects..hdbschema Schema [page 75]

    Table A database table. .hdbtable Tables [page 76]SQL View A virtual table based on a SQL query. .hdbview SQL Views [page 80]Attribute, Analytic and Calculation View

    A view created with modeling tools and designed to model a business use case.

    Created with the Navigator view.

    Setting Up the Analytic Model [page 92]

    Decision Table A database table used to define business rules, for example, for validating data.

    Creating Decision Tables [page 133]

    Analytic Privilege

    A set of rules that restricts users to seeing only a subset of data in a table or view.

    Creating Analytic Privileges [page 341]

    Sequence A set of unique numbers, for example, for use as primary keys for a specific table.

    .hdbsequence Sequences [page 78]

    Procedure A database function for performing complex and data-intensive business logic that cannot be performed with standard SQL.

    .procedure Developing Procedures [page 158]

    Web AccessApplication Descriptor

    A file in a repository package that defines a root folder of a native SAP HANA application. All files in that package are available to be called via URL.

    .xsapp Creating the Application Descriptors [page 49]

    Application Access File

    A file that defines permissions for a native SAP HANA application, that is, permissions for accessing and running objects in the package.

    .xsaccess Enabling Access to SAP HANA XS Application Packages [page 57]

    Application Privilege

    A file that defines a privilege related to an SAP HANA Extended Application Services

    .xsprivileges The Application-Privileges File [page 59]

    20P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • Object Description File Extension More Informationapplication, for example, the right to start or administer the application.

    Server-Side JavaScript Code

    JavaScript code that can run in SAP HANA Extended Application Services and that can be accessed via URL.

    .xsjs Writing Server-Side JavaScript Applications [page 218]

    Server-Side JavaScript Library

    JavaScript code that can run in SAP HANA Extended Application Services but cannot be accessed via URL. The code can be imported into an .xsjs code file.

    .xsjslib

    OData Descriptor

    A file that defines an OData service that exposes SAP HANA data.

    .xsodata Data Access with OData in SAP HANA XS [page 164]

    XMLA Descriptor

    A file that defines an XMLA service that exposes SAP HANA data

    .xsxmla Data Access with XMLA in SAP HANA XS [page 201]

    SQL Connection Configuration

    A file that enables execution of SQL statements from inside server-side JavaScript code with credentials that are different than those of the requesting user.

    .xssqlcc The SQL Connection Configuration File [page 222]

    OtherRole A file that defines an SAP HANA role. .hdbrole Creating Roles in the

    Repository [page 324]Search Rule Set A file that defines a set of rules for use with

    fuzzy searches. The rules help decide what is a valid match in a search.

    .searchruleset Search Rules [page 301]

    Resource Bundle

    A file for defining translatable UI texts for an application.

    .hdbtextbundle Creating an SAPUI5 Application [page 230]

    3.3 Repository

    The SAP HANA repository is the design-time storage system for development objects and is built into SAP HANA. The repository is the source control for all your development work on SAP HANA. You can add objects to the repository, update the objects, publish the objects, and compile these design-time objects into runtime objects.The repository supports the following: Version Control Sharing of objects between multiple developers TransportThe repository manages all development objects. You can browse the repository for a specific system with the SAP HANA Repositories view.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 21

  • PackagesWithin the repository, development objects are managed as files within packages. Packages enable you to:

    Create namespaces, so you can uniquely identify development objects. Group objects that logically belong together. Provide containers for your objects so you can easily insert relevant objects into delivery units and transport

    them. Assign permissions at the package level.You might create a top-level package for your company, and then a subpackage for each project, and then subpackages for parts of your project, for example, a subpackage for your HTML files, another for server-side JavaScript files, and so forth.

    WorkspacesWhen working with development objects, you need to retrieve them from the repository, work on them on your workstation, and then return them to the repository. To make this simpler, the SAP HANA studio enables you to create a repository workspace, which establishes a link between two locations:

    The repository of the SAP HANA system where you wish to maintain the development object files of your projects (in the form of a package hierarchy).

    A directory/folder on your workstation where you checkout these project files while you are working on them.

    Working with ObjectsWhen creating development objects, the following is the workflow:

    1. Create a project.2. Share the project to associate it with a workspace, and thus a specific SAP HANA system. Shared projects,

    once they are activated, are available for import by other members of the application-development team.3. Create a new object file within the project, and save it to your workstation. Depending on the extension of the

    file you create, you may use a dedicated editor for that type of object, for example, a JavaScript editor for .xsjs files.

    4. Commit the file.

    22P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • Committing the file saves it in the repository, but the object is inactive and cannot be run, and only you can see it.

    5. Activate the file.

    Activating a file does the following:

    Publishes the file so others can see it. Adds the previously active version of the file to the history. The repository maintains a history of changes

    to the file. Validates the file and compiles it or exposes it as a runtime object.The design-time object is now active.

    Related LinksSetting Up Your Application [page 34]

    In SAP HANA Extended Application Services (SAP HANA XS), the design-time artifacts that make up your application are stored in the repository like files in a file system. You first choose a root folder for your application-development activities, and within this folder you create additional subfolders to organize the applications and the application content according to your own requirements.

    3.4 SAP HANA Studio

    The SAP HANA studio is an Eclipse-based development and administration tool for working with SAP HANA, including creating projects, creating development objects, and deploying them to SAP HANA. As a developer, you may want to also perform some administrative tasks, such as configuring and monitoring the system.There are several key Eclipse perspectives that you will use while developing: Modeler: Used for creating various types of views and analytical privileges. SAP HANA Development: Used for programming applications, that is, creating development objects that

    access or update the data models, such as server-side JavaScript or HTML files. Debug: Used to debug code, such as server-side JavaScript or SQLScript. Administration: Used to monitor the system and change settings.

    To open a perspective, go to Window Open Perspective , or select on the toolbar.

    3.4.1 Modeler PerspectiveThe Modeler perspective is used to define your analytic model by creating various types of views.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 23

  • The perspective contains the following main areas: Navigator View: A view of the database objects, that is, those objects you create from the Modeler

    perspective. Quick Launch Area: A collection of shortcuts for performing the most common modeling tasks. If you close

    the Quick Launch tab, you can reopen it by selecting Help Quick Launch .

    Navigator ViewThe Navigator view shows a view of the database objects in SAP HANA, both those that have been activated and those objects you created and have not activated yet.The view is divided into the following main sections:

    24P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • Security: Contains the roles and users defined for this system. Catalog: Contains the database objects that have been activated. The objects are divided into schemas, which

    is a way to organize activated database objects. Content: Contains design-time database objects, both those that have been activated and those not activated.

    If you want to see other development objects, use the SAP HANA Repositories view.Related LinksSAP HANA Repositories View [page 26]

    3.4.2 SAP HANA Development PerspectiveThe SAP HANA Development perspective is where you will do most of your programming work, creating projects, associating them to SAP HANA systems, creating development objects, and deploying them.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 25

  • The perspective contains the following main areas: Development Objects: Several views for browsing your development objects: the objects on your workstation,

    and the objects in the repository of the SAP HANA system you are working with. Editors: Specialized editors for working with different types of development objects.SAP HANA Repositories ViewThe SAP HANA Repositories view enables you to browse the repository of a specific SAP HANA system, viewing the package hierarchy and to download files to your workstation.

    26P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • The view essentially is a list of repository workspaces that you have created for developing on various systems. Generally, you create a workspace, check out files from the repository, and then do most of your development work in the Project Explorer.If you are creating a project from scratch, you do not need anything from this view, except to see the hierarchy of the repository. You create the project in the Project Explorer.

    Project Explorer ViewThe Project Explorer is the standard Project Explorer view in Eclipse, which shows you the development files located on your workstation.

    Here you can create files, edit files, and deploy them to the repository.

    Working with the RepositoryTo work with the repository, you need to either: Share your project with the repository via a workspace. Sharing a project associates it with a SAP HANA

    system, so that files within the project can be added to the repository on that system. Check out an existing package in the repository from a workspace. This creates copies on your workstation of

    the package, its subpackages and their objects.

    Team MenuYou can interact with the repository by right-clicking on a file or project (in the Project Explorer view) or package (in the SAP HANA Repositories view), and selecting an option from the Team menu.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 27

  • You can perform the following on a file, folder or project in the Project Explorer view, that is, development objects that you are working on and located on your workstation:

    Table 5: Repository Actions in Project Explorer (project, folder, or file)Action DescriptionCommit Saves the object to the repository.

    The object (or changes to the object) are only visible to you. There is no versioning of committed objects; the repository stores only the latest committed changes.

    Activate Makes the development object active, and does the following:

    Publishes the object so it is visible to others. Compiles the object into runtime objects. Deploys the runtime object.

    28P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • Action Description

    Creates a new version of the design-time object.

    Check Simulates activation of the object in order to check if the object is valid and can be activated.

    Checkout Retrieves the latest version of the object from the repository.

    Revert Removes all your committed changes (inactive object) with the latest version of the object that was activated.

    Share/Unshare (project only)

    Associates a project with a specific SAP HANA system, so that files within the project can be added and updated on the repository on that system. For more information, see Using SAP HANA Projects [page 37].

    The following options are available for files only.

    Show Local History Shows a history of all versions of your object saved on your workstation. This is the Eclipse local history feature.

    Show History Shows a history of all the versions of the object that were activated in the repository.

    Currently, you can only view a list of versions.

    You can perform the following on a package and file in the SAP HANA Repositories view:

    Table 6: Repository Actions in SAP HANA Repositories (package or file)Action DescriptionCheckout (package only)

    Retrieves the latest version of the objects from the repository in this package and its subpackages.

    Checkout and Import Projects (package only)

    Retrieves the latest version of the objects from the repository in this package, and imports a project into the SAP HANA studio. For more information, see Using SAP HANA Projects [page 37].

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 29

  • Action DescriptionShow History (file only)

    Shows a history of all the versions of the object that were activated in the repository.

    Status of Development ObjectsEach object displayed in your project within the Project Explorer view is shown with an icon that indicates its status.

    Table 7: Status of Development ObjectsIcon Description

    The file is not committed. You made a change to the file and saved it to your workstation, but have not yet committed the changes to the repository.

    The file is committed.

    The file is activated.

    3.4.3 Debug PerspectiveThe Debug perspective in the SAP HANA studio is the standard Eclipse Debug perspective, enabling you to start debug sessions, create breakpoints and watch variables.In the SAP HANA studio, the debug tools have been enhanced to let you also debug SAP HANA code, both server-side JavaScript (.xsjs files) and SQLScript code (.procedure files). The following shows the tools available in the Debug perspective and how it is organized:

    30P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • Debug Session: The debug sessions that have been started Watch: Breakpoints and variables to watch Code: Code files that you have openedRelated LinksDebugging JavaScript [page 225]

    SAP HANA studio enables you to debug XS JavaScript files, including setting breakpoints and inspecting variables.

    Debugging SQLScript [page 161]The SAP HANA SQLScript debugger allows you to debug and analyze procedures. In a debug session, your procedures will be executed in a serial mode, not in parallel (not-optimized). This allows you to test the correctness of the procedure logic and is not for evaluating the performance.

    3.4.4 Administration Console PerspectiveThe Administration Console perspective enables you to configure the SAP HANA server so that you can do your development work. For example, when debugging, the debug port must be opened and debugging enabled, which is done by setting configuration parameters within the administration console.The Administration Console perspective displays the Navigator view, for adding or selecting systems, and the administration console, where you can monitor and configure the system. Configuration parameters can viewed and changed from the Configuration tab.

    Note: You may need additional permissions to work with the administration console.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 31

  • If the console is closed, you can open it by clicking the Administration icon in the Navigator view.

    3.5 Getting Started

    Before starting development work in the SAP HANA studio, make sure to have the following: An installation of the SAP HANA studio on your workstation. A live SAP HANA system to which to connect. A user on the SAP HANA server that has at least the following roles or their equivalent:

    32P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSAP HANA as a Development Platform

  • MODELING CONTENT_ADMIN

    3.5.1 Adding a SystemTo develop applications, you must first make a connection from your SAP HANA studio to an SAP HANA system.

    1. In the Navigator view, right-click anywhere in the view and select Add System.2. In the System window, enter the host name, instance number, and a description for the SAP HANA system

    you want to add.3. Select Next.4. Enter a user name and password, and select Finish.

    The Navigator view includes a new top-level node for the system. You can now create a repository workspace for this system so you can start to develop objects to run in it.Related LinksSetting Up Your Application [page 34]

    In SAP HANA Extended Application Services (SAP HANA XS), the design-time artifacts that make up your application are stored in the repository like files in a file system. You first choose a root folder for your application-development activities, and within this folder you create additional subfolders to organize the applications and the application content according to your own requirements.

    SAP HANA Developer GuideSAP HANA as a Development Platform

    P U B L I C 2012 SAP AG. All rights reserved. 33

  • 4 Setting Up Your Application

    In SAP HANA Extended Application Services (SAP HANA XS), the design-time artifacts that make up your application are stored in the repository like files in a file system. You first choose a root folder for your application-development activities, and within this folder you create additional subfolders to organize the applications and the application content according to your own requirements.

    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.

    As part of the application-development process, you typically need to perform the tasks described in the following list. Each of the tasks in more detail is described in its own section:1. Set up delivery units.

    To create and manage delivery units, you must set the identity of the vendor with whom the delivery units are associated. To avoid conflicts with applications from SAP or other providers, we recommend that you name the root application-development folder for your company using the DNS name of your company. For example, you could use the name acme.com.hr.newHires for the root folder for a new application managing new hires in a company called acme.

    2. Set up SAP HANA projects.In SAP HANA, projects enable you to group together all the artifacts you need for a specific part of the application-development environment. To start the application-development work flow, you first create a local workspace in the SAP HANA Development perspective, which creates a directory structure to store files on your PC; the workspace you create enables you to synchronize changes in local files with changes in the repository. Then you can use the SAP HANA studio to create a project to manage the development activities for the new application.

    3. Maintain repository packages.To perform the high-level tasks that typically occur during the process of maintaining repository packages, you need to be familiar with the concepts of packages and package hierarchies, which you use to manage the artifacts in your applications.

    4. Maintain application descriptors.The framework defined by the application descriptors includes the root point in the package hierarchy where content is to be served to client requests. The framework also defines if the application is permitted to expose data to client requests, what kind of access to the data is allowed, and what if any privileges are required to perform actions on packages and package content.

    34P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSetting Up Your Application

  • 4.1 Setting up Delivery UnitsA delivery unit is a collection of packages that are to be transported together. You assign all the packages belonging to your application to the same delivery unit to ensure that they are transported consistently together within your system landscape. Each delivery unit has a unique identity.

    The identity of a delivery unit consists of two parts: a vendor name and a delivery-unit name. The combined ID ensures that delivery units from different vendors are easy to distinguish and follows a pattern that SAP uses for all kinds of software components.

    To create and manage delivery units you first need to maintain the identity of the vendor, with whom the delivery units are associated, and in whose namespace the packages that make up the delivery unit are stored. As part of the vendor ID maintenance process, you must perform the following tasks:1. Understand delivery units

    You must be familiar with the conventions that exist for delivery-unit names and understand the phases of the delivery-unit lifecycle.

    2. Maintain details of the vendor ID associated with a delivery unit.Delivery units are located in the namespace associated with the vendor who creates them and who manages the delivery-unit's lifecycle.

    3. Create a delivery unit.Related LinksMaintaining the Delivery-Unit Vendor ID [page 35]

    In SAP HANA, the vendor ID is used primarily to define the identity of the company developing a software component that they plan to ship for use with SAP HANA. If you want to create a delivery unit, it is a prerequisite to maintain a vendor ID in your system.

    Creating a Delivery Unit [page 36]A delivery unit is a group of transportable objects used for content delivery. You can use a delivery unit to transport the design-time objects that are stored in the SAP HANA repository between two systems, for example, from a development system to a consolidation system.

    4.1.1 Maintaining the Delivery-Unit Vendor IDIn SAP HANA, the vendor ID is used primarily to define the identity of the company developing a software component that they plan to ship for use with SAP HANA. If you want to create a delivery unit, it is a prerequisite to maintain a vendor ID in your system.

    Before creating your first own delivery unit you must set the identity of the vendor in the development system's configuration. To maintain details of the delivery-unit vendor ID, perform the following steps:1. Start the SAP HANA studio.2. Switch to the Administration Console perspective.

    In the SAP HANA studio Navigator view choose Administration . Alternatively, use the menu path: Window > Open Perspective > Administration Console .

    3. Display configuration details for the SAP HANA instance; choose the Configuration tab page.4. Maintain details of the vendor ID.

    In the Configuration tab page, perform the following steps:

    SAP HANA Developer GuideSetting Up Your Application

    P U B L I C 2012 SAP AG. All rights reserved. 35

  • a) Locate indexserver.ini in the list of configuration files displayed in the Name column.b) Expand the indexserver.ini entry.c) Expand the repository entry.d) Edit the content_vendor parameter.e) Double-click content_vendor and enter the name of your vendor. Note that guidelines and conventions

    exist for vendor names.

    Note: We recommend that you use your DNS name to set the vendor ID, for example, acme.com.f) Save your changes.

    4.1.2 SAP HANA Delivery Unit Naming ConventionsIn SAP HANA, conventions and guidelines exist for the naming of delivery units (DU). The delivery unit is the vehicle that lifecycle management (LCM) uses to ship one or more software components from SAP (or a partner) to a customer. The DU is also the container you use to transport application content in your system landscape.If you are creating a delivery unit, you must adhere to the following naming conventions The name of a delivery unit must contain only capital letters (A-Z), digits (0-9), and underscores (_) You cannot use an underscore (_) as the first character of a delivery-unit name.

    Note: The naming conventions for packages in a delivery unit differ from the naming conventions that apply to the delivery unit itself. For example, the maximum length of a package name is not restricted to 30 characters; it must be less than 190 characters (including the namespace hierarchy).

    4.1.3 Creating a Delivery UnitA delivery unit is a group of transportable objects used for content delivery. You can use a delivery unit to transport the design-time objects that are stored in the SAP HANA repository between two systems, for example, from a development system to a consolidation system.

    In the SAP HANA studio, you can create a delivery unit in the Quick Launch view of the Modeler perspective :

    Note: You cannot create a delivery unit unless you have already defined the delivery unit's vendor ID; the vendor ID defines the namespace in which the new delivery unit resides.

    To create a new delivery unit, perform the following steps:1. In the SAP HANA studio, start the Modeler perspective.2. In the Setup screen area of the Quick Launch tab, choose Delivery Units....3. Create a new delivery unit.

    In the Delivery Units dialog, choose Create...4. Maintain delivery unit details.

    a) Enter a name for the new delivery unit.The delivery unit Name is mandatory.

    b) Fill in the other information as required:Note the following points when entering information: The name of the Vendor is set to the vendor ID that is specified in the system configuration, for

    example, acme.com. The Responsible text box enables you to specify the name of the person responsible for managing the

    delivery unit.

    36P U B L I C 2012 SAP AG. All rights reserved.

    SAP HANA Developer GuideSetting Up Your Application

  • In the text boxes Version, Support Package Version, and Patch Version enter integer values only; the combined values define the version of the delivery unit that is currently being developed. For example, enter Version = 1, Support Package Version = 3, and Patch Version = 17 to specify that the current version of your delivery unit is 1.3.17. The version number is transported to other systems with every DU transport.

    Note: The numbers you enter here refer to the application component that you are developing; the numbers do not refer to the patch or service-pack level deployed on the SAP HANA server.

    The PPMS ID is the product ID used by the SAP Product and Production Management System (PPMS).

    Note: Customers and partners should leave the PPMS ID text box empty.Related LinksMaintaining the Delivery-Unit Vendor ID [page 35]

    In SAP HANA, the vendor ID is used primarily to define the identity of the company developing a software component that they plan to ship for use with SAP HANA. If you want to create a delivery unit, it is a prerequisite to maintain a vendor ID in your system.

    SAP HANA Delivery Unit Naming Conventions [page 36]In SAP HANA, conventions and guidelines exist for the naming of delivery units (DU). The delivery unit is the vehicle that lifecycle management (LCM) uses to ship one or more software components from SAP (or a partner) to a customer. The DU is also the container you use to transport application content in your system landscape.

    4.2 Using SAP HANA Projects

    Projects group together all the artifacts you need for a specific part of the application-development environment.

    Before you can start the application-development workflow, you must create a project, which you use to group together all your application-related artifacts. However, before you create a project, you must create a repository workspace, which enables you to synchronize changes in local files with changes in the repository. As part of the project-creation process, you perform the following tasks:1. Create a development workspace.

    The workspace is the link between the SAP HANA repository and your local filesystem, where you work on project-related objects.

    2. Create a project.Create a new project for a particular application or package; you can use the project to collect in a convenient place all your application-related artifacts.

    3. Share a project.Sharing a project enables you to ensure that changes you make to project-related files are visible to other team members and applications. Shared projects are available for import by other members of the application-development team.

    SAP HANA Developer GuideSetting Up Your Application

    P U B L I C 2012 SAP AG. All rights reserved. 37

  • 4. Import a project.Import a project (and its associated artifacts) that has been shared by another member of the application-development team.

    Related LinksCreate a Development Workspace [page 39]

    A workspace is a local directory that you map to all (or part) of a package hierarchy in the SAP HANA repository. When you check out a package from the repository, SAP HANA copies the contents of the package hierarchy to your workspace, where you can work on the files..

    Create a New Project [page 40]Before you can start the application-development workflow, you must create a project, which you use to group all your application-related artifacts.

    Share a Project [page 40]Before you can start working on files associated with a new project, you must share the project; sharing a project enables you to track and synchronize local changes with the repository.

    Import a Project [page 41]Before you can start the application-development workflow, you must either create a new project and share it (with the repository), or import a shared project from the repository into your workspace. Importing a project enables you to track and synchronize local changes with the colleagues working on the objects in the imported project.

    4.2.1 SAP HANA Repository: WorkspacesThe place where you work on project-related objects is called a repository workspace. A workspace is an environment that maps a local directory to all (or part) of a package hierarchy in the SAP HANA repository.In SAP HANA studio, the repository tools enable you to view and browse the entire hierarchy of design-time objects stored in the repository. However, when you checkout a package from the repository, SAP HANA copies the contents of the package hierarchy to your workspace, where you can work on the files in your local file system.

    Note: Before you can create a workspace you must maintain connection information in the SAP HANA database user store.

    To start development work with SAP HANA studio, for example, to checkout the contents of a package, you must create a repository workspace. The workspace contains a system folder with metadata and package folders for the repository content. The file-system folders and their subfolders reflect the package hierarchy in the repository; the repository client ensures that changes are synchronized. You can use SAP HANA studio to perform the following workspace-related actions in the repository: Checkout folders and files from the repository Commit changes to the repository Activate the committed changes Revert inactive changes to the previously saved versionThe commit operation detects all changes in packages that you configure SAP HANA studio tool to track and writes the detected changes back to the repository. The repository client tools also support synchronization with changes on the server, including conflict detection and merging of change. All workspace-related repository actions are available as context-sensitive menu options in SAP HANA studio. For example, if you right click a repository object at the top of the package hierarchy in the Project Explorer in SAP HANA studio, you can commit and activate all changed objects within the selected hierarchy.

    Note: If you create a new project using SAP HANA studio, you can assign the new project to an existing works