Sei sulla pagina 1di 93

INTRODUCTION:

SAP HANA Studio:


SAP HANA studio is built in a development environment based on Eclipse, an open-source
framework by IBM. (For more information about Eclipse, visit http://www.eclipse.org.) This
development environment is written in Java, so it only runs on your desktop or laptop.
Eclipse originally started out as a Java development environment, but was later adapted into
other programming languages, such as JavaScript, PHP, HTML, Cascading Style Sheets (CSS),
Ruby, and many others.

On the top right is an area called perspectives. On the left of the screen an area in which you can
see the different SAP HANA systems you work with, and the components for each system. In the
middle is the main working area. On the right-hand side, you'll see a tab called Quick view
which is specifically used in the modeler perspective.
In this, we will look at the different working areas of SAP HANA studio, including the SAP
HANA studio perspectives, main workspace, system views, two primary consoles (the SQL
Console and Administration Console), and the application function modeler (AFM).

Figure 1.1: SAP HANA studio


Perspectives:
The Eclipse environment uses different perspectives to give you different layouts for different
development tasks. In SAP HANA studio, there are perspectives for information modeling,
administrators, plan visualization, and SAP HANA development. When you select another
perspective, it changes the screen layout, menu options, and so on. In Eclipse, you can even
create your own perspectives or change the available perspectives to suit your requirements.
If you want to select a perspective that is not on that list, click the Sd button to the left side of
these names. This will open a menu from which you can select the perspective that you want to
use.

Main Workspace:
In the middle of Figure 1.1, the main workspace is displayed. In this case, you can see a
calculation view with a union. You can see the mapping of the different fields in the union.
When you open table definitions, stored procedures, or different views, or just preview the
output of an information model, you will see the results in this main workspace. Each of the SAP
HANA objects that you open will be displayed inside its own tab.

Systems View:
You can see the systems view on the left side of Figure 1.1
All your different SAP HANA systems are shown this area. From SAP HANA studio, you can
work with multiple SAP HANA systems —for example, with both a development and
production system. Within each SAP HANA system, you will find different areas shown as
folders in the systems view. The following areas are found in the systems view:

Backup folder:
The Backup folder is used by administrators to manage the backups and recovery of SAP HANA
databases. Depending on your security settings, you might not even see this folder, because it is
meant for administrators only.
Figure 1.2: Systems View

Catalog area:
The Catalog area is used, for example, for schemas and tables. You can see your tables, their
definitions, and data in the Catalog area.

Content area:
The Content area is used for information modeling. This is where all your SAP HANA models
are created and stored.

Provisioning area:
The Provisioning area is used by SAP HANA smart data access. This area is used for creating
virtual tables, to get data from other databases into SAP HANA.
Security folder:
The Security folder is where you can create SAP HANA users and assign them privileges to
work with your information models.
We will focus on the Catalog and Content areas.

Catalog Area:
The Catalog area houses most of the artifacts for the SAP HANA database. It is divided into
schemas. SAP HANA schemas are groupings of tables and other artifacts. The main database
objects we find here are tables. Inside SAP HANA, we can also find items such as column views,
functions, indexes, procedures, synonyms, and triggers.

When you open the tree structure—for example, down to the tables—you'll find a list of all the
tables inside that schema. Check the icon in front of each table to determine if it's a column or a
row table. The icon indicates that this table is a row-based table, the icon indicates a
column-based table, and the icon indicates a virtual table. In SAP HANA, column-based
tables are the preferred table type. They compress much better than row-based tables and do not
need indexes.
When you right-click on a table, a context menu for that table. Through that menu, you can look
at the table definition, table contents, or open a data preview for that specific table. In the catalog
area, you can also delete tables, import more tables, and export tables.

Table definitions:
Figure 1.3 shows the definition of a table. On the top right-hand side of the screen, you can see
the table Type—whether it is Column store or Row store.

Figure 1.3: Definition of Column Table


When you click the Runtime Information tab, as shown at the bottom in Figure 5.4, you can see
the memory consumption of a specific table and whether it is loaded into memory. From the
table context menu, you can load the table into memory or unload it from memory.

Data preview:
When you run a data preview of a table, you'll see three different tabs with quite a lot of
functionality:

Raw Data:

The Raw Data tab (Figure 1.4) displays the table contents. You will notice in the top right-hand
corner that there is a Sort option available. You can either sort and display the top records of the
entire dataset, or sort the current dataset, which by default would be the top 200 records. You can
also export that dataset. This data preview is available not only for tables, but also for SAP
HANA models. You can view the output from any of the information models and export the
output of these information models.

Figure 1.4: Raw Data in Data Preview in SAP HANA Studio


Data Preview: Sorting and Export

The sorting and data export features were introduced in SAP HANA SPS 10. You can change the
default of 200 records shown in the top-right field (Max Rows), and you select what sorting
behavior you want from the dropdown menu (see Figure 1.4). There are two options here:
Sort Entire Data Set:
This sorts all the records in the table, view or information model, even if there are, for example,
5 million records. It then gives you the top 200 records from that large sorted list.

Sort Current Data Set:

This only shows the sorted result set of the first 200 records that are returned.

Distinct values:

In the Distinct values tab (Figure 1.5), you can see the quantities sold for every product. It
graphically shows the number of unique values for your selection of fields.

Figure 1.5: Distinct Values in Data Preview in SAP HANA Studio


Analysis:

In the Analysis tab, you can perform a full analysis of table outputs or information model
outputs. This works the same as a Microsoft Excel pivot table. You can show the data using
many different types of graphs.

Figure 1.6: Data Analysis in Data Preview in SAP HANA Studio


Figure 1.7: Content Area

Content Area:
The Content area is where you perform all your SAP HANA modeling. This area is divided into
packages, which can again be divided into sub packages, up to as many levels as you want.
These packages and sub packages are then used to transport your information models from the
development system to testing and production systems.

At the top of the menu, click New to display all the SAP HANA model types that you can create.
You can create another sub package, attribute views, analytic views, calculation views, analytic
privileges, procedures, and decision tables via this option.
When you right-click on a package or a subpackage, you will see a context menu, as illustrated
in Figure 1.7

SQL Console:
As with any other database, you can use SQL statements when working with the SAP HANA
database. Figure 1.8 shows the different ways to open the SQL Console: You can either use the
context menu of a schema, or click the SQL button in the top menu of the system view.
This will open the SQL Console in your main work space. You can now enter different SQL
statements to perform tasks such as creating tables, inserting data, maintaining data, creating a
schema, assigning authorizations, and more.

Figure 1.8: SQL Console


Administration Console:
The Administration Console is used primarily by data administrators (see Figure 5.11). From
here, admin can get a good view of all the technical aspects of an SAP HANA system.
As an information modeler, there are two sub tabs that might be helpful to you: the Performance
tab and the Diagnosis files tab. These tabs will help you with troubleshooting.

Figure 1.9: Administration Console

In Figure 1.9, see that this SAP HANA system seems to be healthy as everything is shown in
green. The bars are only partly filled, which means this system has plenty of spare capacity. You
can also see information such as the current status, when the system was started, what version
number is installed, what operating system is used, and what is happening with the memory and
CPU inside the system. This is all shown on the Overview screen of the Administration Console.
Next, we will look at the developer perspective and how to create your own repository for SAP
HANA modeling work.
2. Key Concepts:
This section looks at some of the core data modeling concepts used when working with SAP
HANA

Tables:
Tables allow you to store information in rows and columns. Inside SAP HANA, there are
different ways of storing data. We can either store it in a table as row- oriented or column-
oriented. In a normal disk-based database, we use row-oriented storage because it works faster
with transactions in which we are reading and updating single records. However, because SAP
HANA works in memory, we prefer the column-oriented method of storing data in the tables,
with which we can make use of compression in memory, remove the storage overhead of
indexes, save a lot of space, and optimize for performance by loading compressed data into
computer processors.
Once we have our tables, we can begin combining them in SAP HANA information models.

Views:
The first step in building information models is building views. A view is a database entity that is
not persistent and is defined as the projection of other entities, like tables.
For a view, we take two or more tables, link these different tables together on matching columns,
and select certain output fields. Figure 1.1 illustrates this

Figure 2.1: Database View


There are four steps when creating database views:
1. Select the tables

Select two or more tables that have related information—for example, two tables listing the
groceries you bought. One table contains the shop where you bought each item, the date, the total
amount, and how you paid for your groceries. The other table contains the various grocery items
you bought.

2. Link the tables

Next, link the selected tables on matching columns. In our example, perhaps our two tables both
have shopping spree numbers, should ideally a unique number for every shopping trip you took.
We call this a key field.
We can link the tables together with joins or unions.

3. Select the output fields

We want to show a certain number of columns that are of interest to us—for example, to use in
our grocery analytics. Normally, you don't want all the available columns as part of the output.

4. Save the view

Finally, save your view, and it's created in the database. These views are sometimes called SQL
views. We can even add some filters on our data in the view—for example, to show only the
shopping trips in 2015 or all the shopping trips in which we bought apples.
When we call this view, the database gathers the data. The database view pulls the tables out,
links them together, chooses the selected output fields, reads the data in the combined fields, and
returns the result set. After this, the view "disappears" until we call it again. Then, the database
deletes all of the output from the view. It does not store this data from the view inside the
database storage.
In the few minutes between running the same view twice, our data in the table might have
changed. If we use the same output from the view every time, we will not get the benefit of
seeing the effect of the updated data. Extensive caching of result sets does not help when we
want real-time reporting.

Cardinality:

When we join tables together, we need to define how much data we expect to get from the
various joined tables. This part of the relationship is called the cardinality.
There are four basic cardinalities that you will typically work with. The cardinality is expressed
in terms of how many records on the left side join to how many records on the right side.
► One-to-one:
Each record on the left side matches with one record on the right side. For example, say that you
have a lookup table of country codes and country names. In your left table, you have a country
code called ZA. In the right table (the lookup table), this matches with exactly one record,
showing that the country name of South Africa is associated with ZA.
► One-to-many:
In this case, each record on the left side matches with many records on the right side. For
example, say you have a list of publishers in the left table. For one publisher—such as SAP
PRESS—we find many published books.

► Many-to-one
This is the inverse of one-to-many. For example, this case may apply when we have many people
in a small village all buying items at the local corner shop.
► Many-to-many
For example, this case may apply when many people read many web pages.

Joins:

Before we look at the different types of joins, let's quickly discuss the idea of "left" and "right"
tables. Sometimes, it does not make much of difference which table is on the left of the join and
which table is on the right, because some join types are symmetrical. However, with a few join
types it does make a difference.
We recommend putting the most important table, seen as the main table, on the left of the join.
An easy way to remember which table should be the table on the right side of the join is to
determine which table can be used for a lookup or for a dropdown list in an application.
A Join clause combines records from two or more tables /view in a database.
SAP HANA supports following types of join.
 Inner Join
 Left Outer Join
 Right Outer Join
 Full Outer Join
 Referential Join
 Text Join
Inner join:
The INNER JOIN selects the set of records that match in both the Tables.

Syntax:
SELECT T2."OrderID", T1."CustomerID", T1."CustomerName", T2."Product",
T2."Total_Units"
from"CUSTOMER"AST1
INNERJOIN
"SALES_ORDER" AS T2
ON T1."CustomerID" = T2."CustomerID";
The result of Inner Join will be like this:

Where to Use?
Inner join should be used if referential integrity is ensured.
Inner Join is much faster than Outer Join thus is the preferred solution is possible from
semantically perspective.
Attribute View: Inner Joins can be used to join different master data tables to a joint dimension
Analytical View: Inner Joins can be used if referential integrity cannot be ensured

Left outer join:


The Left Outer Join selects the complete set of records from first table (CUSTOMER), with the
matching records (where available) in second table (SALES_ORDER). If there is no match, the
right side will contain null.

Syntax:
SELECT T2."OrderID", T1."CustomerID", T1."CustomerName", T2."Product",
T2."Total_Units"
from "CUSTOMER" AS T1
LEFT OUTER JOIN
"SALES_ORDER" AS T2
ON T1."CustomerID" = T2."CustomerID";
The result of Left Outer Join will be like this:

Right outer join:


The Right Outer Join selects the complete set of records from second table
(SALES_ORDER), with the matching records (where available) in first table
(CUSTOMER). If there is no match, the left side will contain null.

Syntax:
SELECT T2."OrderID", T2."CustomerID", T1."CustomerName", T2."Product",
T2."Total_Units"
from "CUSTOMER" AS T1
RIGHT OUTER JOIN
"SALES_ORDER" AS T2
ON T1."CustomerID" = T2."CustomerID";

The result of Right Outer Join will be like this:

full outer join:


The FULL OUTER JOIN keyword selects all rows from the left table (table1) and from
the right table (table2). The FULL OUTER JOIN keyword combines the result of both
LEFT OUTER and RIGHT OUTER joins.

Syntax:
SELECT T2."OrderID", T1."CustomerID", T1."CustomerName", T2."Product",
T2."Total_Units"
from "CUSTOMER" AS T1
FULL OUTER JOIN
"SALES_ORDER" AS T2
ON T1."CustomerID" = T2."CustomerID";

The result of Full Outer Join will be like this:

All the 4 types of joins explained above are standard database join types.
SAP HANA also supports 2 new types of joins. Referential Join and Text Join. These 2
types of joins can only be used in modeling views.
Let's take a look into these 2 new types of joins.

SAP HANA Referential join:


Referential Join is semantically an inner join that assume that referential integrity is
given.
Note: Referential integrity is the property of database which ensures that each foreign
key value in a table exists as a primary key in the referenced table.
Referential join is performance wise better than inner join, but only be used when you are
sure that referential integrity is maintained.
SAP HANA text join:
 Text Join is used in order to get language-specific data.
You have a product table that contains product IDs without descriptions and you have a
text table for products that contains language-specific descriptions for each product. You
can create a text join between the two tables to get the language-specific details. In a text
join, the right table should be the text table and it is mandatory to specify the Language
Column.

Semantics:
An important step that many modelers skip is to add more meaning to the output of their
information models. Semantics, as a general term, is the study of meaning. We can use semantics
in SAP HANA to; for example, rename fields in a system so they are clearer. Some database
fields have really horrible names. Using semantics, you can change the name of these fields to be
more meaningful for your end users. This is especially useful when they create reports.
We can also show that certain fields are related to each other—for example, a customer number
and a customer name field.
One example that is used often is that of building a hierarchy. By using a hierarchy, you can see
how fields are related to each other with regards to "drilling down" for reports.

Hierarchies:
Hierarchies are used in reporting to enable intelligent drilldown

There are two different types of hierarchies:

Level hierarchies and parent-child hierarchies.


The hierarchy we just described is the level hierarchy; level 1 is the country, level 2 is the state
or province, and level 3 is the city or town.
Another example of a level hierarchy is a time-based hierarchy that goes from a year to a
month to a day. You can even keep going deeper, down to seconds.
HR employee organizational charts or a cost center structures are examples of parent-child
hierarchy. In this case, we join a table to itself, as described in the Self-Joins section.
Attribute view
Attribute Views in SAP HANA Modeling are created on the top of Dimension tables. They are
used to join Dimension tables or other Attribute Views. You can also copy a new Attribute
View from already existing Attribute Views inside other Packages but that doesn’t let you
change the View Attributes.

Characteristics of Attribute View:


 Attribute Views in HANA are used to join Dimension tables or other Attribute Views.

 Attribute Views are used in Analytical and Calculation Views for analysis to pass master
data.

 They are similar to Characteristics in BM and contain master data.

 Attribute Views are used for performance optimization in large size Dimension tables,
you can limit the number of attributes in an Attribute View which are further used for
Reporting and analysis purpose.

 Attribute Views are used to model master data to give some context.

How to Create an Attribute View?


Choose the Package name under which you want to create an Attribute View. Right Click on
Package → Go to New → Attribute View

When you click on Attribute View, New Window will open. Enter Attribute View name and
description. From the drop down list, choose View Type and sub type. In sub type, there are
three types of Attribute views − Standard, Time, and Derived.
Time subtype Attribute View is a special type of Attribute view that adds a Time Dimension to
Data Foundation. When you enter the Attribute name, Type and Subtype and click on Finish, it
will open three work panes −

 Scenario pane that has Data Foundation and Semantic Layer.

 Details Pane shows attribute of all tables added to Data Foundation and joining between
them.

 Output pane where we can add attributes from Detail pane to filter in the report.

You can add Objects to Data Foundation, by clicking on ‘+’ sign written next to Data
Foundation. You can add multiple Dimension tables and Attribute Views in the Scenario Pane
and join them using a Primary Key.

When you click on Add Object in Data Foundation, you will get a search bar from where you
can add Dimension tables and Attribute views to Scenario Pane. Once Tables or Attribute
Views are added to Data Foundation, they can be joined using a Primary Key in Details Pane as
shown below.
Once joining is done, choose multiple attributes in details pane, right click and Add to Output.
All columns will be added to Output pane. Now Click on Activate option and you will get a
confirmation message in job log.

Now you can right click on the Attribute View and go for Data Preview.

Note − When a View is not activated, it has diamond mark on it. However, once you activate it,
that diamond disappears that confirms that View has been activated successfully.

Once you click on Data Preview, it will show all the attributes that has been added to Output
pane under Available Objects.

These Objects can be added to Labels and Value axis by right click and adding or by dragging
the objects as shown below −
Derived Attribute Views: Is attribute view type that you must use that attribute is more than
once within the same analytic or calculation view. This derived attribute views act as reference to
the base attribute view and you can change description field only.

You can look on the picture above. It’s the screen when you create derived attribute view. You
need to select Derived for Subtype and Select the attribute view that you want to be the base
attribute view.
Time Attribute Views: Is the special attribute view to make possible for all your data models
date data to be available in number of formats such as month, year, and so on. The time table
created after you finished time attribute view reside in SAP HANA System Schema _SYS_BI
and is called M_TIME_DIMENSION, by default it contains all dates from years 1990 to 2020.

Basic scenario:
IN THIS SENARIO WE WOULD LIKE TO SEE CUSTOMER ID, CUSTOMER NAME,COUNTRY
ID,COUNTRY NAME,REGIO ID,REGIO NAME.

OUTPUT: WHAT IS DATA IN ECC AND WHAT IS EXPECTED OUTPUT IN SAP HANA.
THE SCENARIO TO CREATE STANDARD ATTRIBUTE VIEW

CREATING ATTRIBUTEVIEWS:

SYSTEM<-EXPAND SYSTEM<-EXPAND CONTENT<-EXPAND PACKAGE <-EXPAND


SUBPACKAGE
RIGHT CLICK ON SUBPACKAGE<-CLICK NEW<-CLICK ATTRIBUTE VIEW

<-PROVIDE NAME<-SELECT SUBTYPE:STANDARD<-CLICK FINISH

HERE WE SEE SCENARIO PANE


ONCE CLICK ON DATA FOUNDATION

CLICK ON (+) ICON,ADD OBJECTS

TYPE IN THE TABLE REQUIRED

SELECT TABLES KNA1(BEST),T005T(BEST),T005U(BEST)


WHENEVER WE USE TEXT JOIN WE NEED TO SELECT LANGUAGE COLUMN AS
SPRAS
SELECT THE COLUMNS REQUIRED TO SEE IN OUTPUT

THEN CLICK SEMANTICS

CLICK KUNNR IS KEY IN THE TABLE TO MAKE IT AS A KEY ATTRIBUTE


YOU CAN SELECT LABEL COLUMN FOR DESCRIPTIVE MAPPING

THEN SAVE AND VALIDATE

THEN ASSIGN OBJECT TO CHANGE IF YOU WANT TO CREATE NEW CLICK ON NEW

AND EXECUTE

VIEW IS ACTIVATED OR NOT CHECK JOBLOG

TO PERFORM UNIT TEST RIGHT CLICK ON ATTRIBUTE VIEW CREATED OPEN


DATAPREVIEW
RESULT:

EXPECTED OUTPUT

THIS IS EXPECTED OUTPUT IN HANA


2. TO CHECK UNIT TEST ECC LOGON

ENTER THE CREDENTIALS

AND FOLLOW THE PROCEDURES


DATA IN ECC
CREATING A TIME ATTRIBUTE VIEW:

THE SCENARIO TO CREATE TIME ATTRIBUTE VIEW

CREATING ATTRIBUTEVIEWS:

SYSTEM<-EXPAND SYSTEM<-EXPAND CONTENT<-EXPAND PACKAGE <-EXPAND


SUBPACKAGE

RIGHT CLICK ON SUBPACKAGE<-CLICK NEW<-CLICK ATTRIBUTE VIEW

<-PROVIDE NAME
AUTO CREATE WILL AUTOMATICALLY PICKUP THE TABLES

RIGHT CLICK ON THE TABLE<- CLICK ON DATPREVIEW


TO CLEAR THE DATA ALREADY GENERATED AND TO GENERATE NEW DATA

GOBACK TO CATALOG

GOTO THE SCHEMA<-EXPAND SCHEMA<-SELECT _SYS_BI

EXPAND TABLES <-GOTO TABLE<-M_TIME_DIMENSION

RIGHT CLICK ON THE TABLE<-SELECT DELETE<SELECT DELETE ALL ROWS<-


CLICK YES
WE NEED TO PROVIDE DATA INTO THIS TABLE

CLICK WINDOW<-PERSPECTIVE<-RESET PERSPECTIVE<-YES

AT QUICKVIEW<-GENERATE TIME DATA<-SELECT SYSTEM<-NEXT<-PROVIDE


DATA <-FINISH

REFRESH<-YOU WILL GET DATA

AFTER THAT SAVE AND VALIDATE

ASSIGN OBJECT TO CHANGE


CREATING DERIVED ATTRIBUTE VIEW:

THE SCENARIO TO CREATE DERIVED ATTRIBUTE VIEW

CREATING ATTRIBUTEVIEWS:

SYSTEM<-EXPAND SYSTEM<-EXPAND CONTENT<-EXPAND PACKAGE <-EXPAND


SUBPACKAGE

RIGHT CLICK ON SUBPACKAGE<-CLICK NEW<-CLICK ATTRIBUTE VIEW

<-PROVIDE NAME<-SELECT SUBTYPE: DERIVED<-CLICK ON DERIVED FROM


ALREADY CRAETED ATTRIBUTE VIEW<-CLICK FINISH
WHENEVER WE SEE THIS COLOR IT IS IN DISPLAY MODE WE CANNOT CHANGE
THE OBJECT

IF YOU WANT TO CHANGE DESCRIPTION,YOU CAN ONLY CHANGE DESCRIPTION

IF YOU WANT TO SEE MORE PROPERTIES ON DERIVED ATTRIBUTE VIEW


YOU CANNOT CHANGE ANY TEXT JOIN AND JOIN

CLICK ON DATAFOUNDATION<-THEN CLICK ON FREE SPACE

HERE YOU CAN SEE PROPERTIES IN PRPERTIES SCROLL DOWN BOTTOM


COLUMN ENGINE: JOIN,

CLICK ON BASE ATTRIBUTEVIEW: SAPECCNOV21.SD:AT_CUSTOMER

THEN SAVE AND VALIDATE


ASSIGN OBJECT TO CHANGE
TO REFRESH CLOSE THE VIIEW AND RIGHT CLICK ON REOPEN OBJECT AGAIN

SELECT THE OBJECT RIGHT CLICK

CLCIK ON DATA FOUNDATION

NOW WE CAN SEE NAME2


RIGHT CLICK ON THE ATTRIBUTE VIEW

CLICK VIEW

CLICK ON COPY AND SELECT ON VIEW


RESULT:
Certification Questions:
General Questions:

1. Which of the following are held in SAP HANA used memory? (2 answers)
A. Free memory pool
B. Temporary computations
C. Heap memory
D. Column and row tables
Answer: B, D

2. Which of the following can you determine using the Backup catalog report? (2 answers)
A. The path for the backup files
B. Whether a recovery is possible
C. Which backup files are obsolete?
D. When to execute the net backup
Answer: B, C

3. How can you set configurations at the system level using the SAP HANA studio?
A. Enter values in the System column in the Configuration tab in the Administration editor.
B. Right-click on a system in the Navigator pane and select Open Security from the context
menu.
C.Right-click on a setting in the Configuration tab in the Administration editor, select Change,
and enter values for all hosts.
D. Enter values in the Properties view when you use the Overview tab of the Administration
editor.
Answer: C

4. In which SAP HANA views will you find measures? (There are 2 correct answers.)
A. Attribute views
B. Calculation view of type cube with star join
C. Calculation view of type cube
D. Database views
Answer: B, C
You find measures in analytic views, calculation views of type cube with star join (the new type
of analytic view), and calculation views of type cube. Attribute views do not contain measures—
only attributes!

5. Referential join gives the same results as which other join type?
A. Inner join
B. Left outer join
C. Spatial join
D. Star join
Answer: A
A referential join gives the same results as an inner join but speeds up the calculations in some
cases by assuming referential integrity of the data. It is the optimal join type in SAP HANA.
6. Which join type makes use of date ranges?
A. Spatial join
B. Text join
C. Temporal join
D. Inner join
Answer: C
A temporal join requires FROM and TO fields in the table on the right side of the join and a
date-time column in the table on the left side of the join.

7. You have a view with two tables, joined by a left outer join. If you redesign the view and
accidently swap the two tables around, what should you do to the join?
A. Keep the left outer join.
B. Change the join to a text join.
C. Change the join to a right outer join.
D. Change the join to a referential join.
Answer: C
A right outer join is the inverse of the left outer join. Therefore, if you reverse the order of the
tables, you can "reverse" the join type. It is important to note that this does not work for a text
join. A text join is only equivalent to a left outer join. For a text join, you have to be careful
about the order of the tables.

8. What do you call the data displayed in the data foundation of an SAP HANA information
view?
A. Facets
B. Measures
C. Characteristics
D. Key figures
Answer: B
The data displayed in the data foundation of an SAP HANA information view is called measures.
In SAP HANA, we talk about attributes and measures. The other names might be used in other
data modeling environments, but not in SAP HANA.

9. You have to build a parent-child hierarchy. What type of join do you expect to use?
A. Relational join
B. Temporal join
C. Dynamic join
D. Self-join
Answer: D
You expect to use a self-join when you build a parent-child hierarchy.
10. In which SAP HANA studio perspective do you find the Quick View tab options?
A. Administration perspective
B. Developer perspective
C. Modeler perspective
D. Plan visualize perspective
Answer: C
The Quick View tab is located in the modeler perspective

11. In which subarea (folder) in the Systems view of SAP HANA studio can you find the SAP
HANA database schemas?
A. Security area
B. Content area
C. Catalog area
D. Provisioning area
Answer: C
The SAP HANA database schemas are housed in the Catalog area of SAP HANA studio

12. Where in SAP HANA studio can you unload a table's data from memory?
A. The context menu of the table
B. The list of export destinations
C. The data preview of the table
D. The table definition
Answer: A
You can unload a table's data from memory in the context menu of the table.

13. Where in SAP HANA studio can you see if a table is row-based or column- based? (There
are 2 correct answers.)
A. The tooltip that appears on mouse hover over the table title
B. The table definition
C. The context menu of a table
D. The table's icon
Answers: B, D
The table definition and the table icon in the Catalog area both show if a table is row-based or
column-based.

14. What can you do in the raw tab of the data preview in SAP HANA studio? (There are 2
correct answers.)
A. Sort the entire data result set and show the top 200 records.
B. Show all distinct values in the entire data result set.Practice Questions Chapter 5 177
C. Create a graph while analyzing the entire data result set.
D. Export the entire data result set to your local machine.
Answers: A, D
Although all of the options are possible in the data preview, you can only 1) sort all the data
result sets and show the top 200 records and then 2) export that data result set to your local
machine from the raw tab of the data preview. The other two actions are available in the other
tabs.

15. Where in the Systems view of SAP HANA studio can you create new SAP HANA models?
A. In the schemas of the Catalog area
B. In the packages of the Catalog area
C. In the packages of the Content area
D. In the schemas of the Content area
Answer: C
You can only create models in the Content area, so any reference to the Catalog area is invalid.
There are no schemas in the Content area. Schemas are only found in the Catalog area.

Attribute view Questions:


1. Two attribute views in the same analytic view contain the same column name (ID from
attribute view Customer and ID from attribute view Product). In the output, the system
automatically renamed one column to ID_1.Which of the following can you do to indicate that
ID_1 originated from attribute view Product?

A. Update the alias in the properties of ID_1.


B. Change the label of ID_1.
C. Create a restricted column with a different name based on ID_1.
D. Create a derived attribute view with an alias for ID_1.
Answer: A

2. When you try to delete an attribute view you receive the error message "One or more objects
are dependent upon this object". Which of the following functions can you use to find out which
objects depend on this view? (Choose two)

A. History function
B. Auto Documentation function
C. Display XML function
D. Where-Used function
Answer: B, D

3. You have been asked to create an SAP HANA attribute view using the tables Employee (left
table) and Department (right table) shown in the attached diagram. Your view should contain the
columns NAME and D_Name for all employees. Which of the following join types do you use?

A. Text join
B. Inner join
C. Referential join
D. Left outer join
Answer: D

4. What do you need to consider when modeling a level hierarchy in an attribute view?Please
choose the correct answer.
A. Different node levels must correspond to different columns
B. Parent and child nodes must correspond to different columns
C. Calculated columns must be created for the level depth
D. Hierarchy levels must be modeled in a separate attribute view
Answer: A

5. What can you create in an attribute view?There are 3 correct answers to this question.

A. Measure
B. Filter
C. Parent-child hierarchy
D. Hidden column
E. Input parameter
Answer: B, C, D

6. When you try to delete an attribute view you receive the error message "One or more objects
are dependent upon this object". Which of the following functions can you use to find out which
objects depend on this view? (Choose two)

A. History function
B. Auto Documentation function
C. Display XML function
D. Where-Used function
Answer: B, D
7. Which of the following properties of a derived attribute view can you modify?

A. Description
B. Description mapping
C. Calculated attributes
D. Filters
Answer: A

8. Which of the following can you use to build the data foundation for an attribute view?
(Choose two)

A. Referential Join
B. Union
C. Projection
D. Text Join
Answer: A, D

9. What is difference between Copy and derived from option while creating a new SAP HANA
Attribute information view?
Copy option allows you to copy an existing Information view and to make changes to it.
Derived option allows to create a copy of an existing view and you can’t make any changes to it.

10. In SAP HANA Modeling, Attributes views are used –

A. In Analytic and Calculation views.


B. Represents master data.
C. Are designed to perform Star schema queries
D. Are used to filter size of dimension tables in Analytic and Calculation View
E. Are defined either graphical using HANA Modeling feature or scripted in the SQL Choose
the correct option.
A - A, C, D are correct
B - A, B, D are correct
C - A, D, E are correct
D - B, C, D are correct
Answer: B
Attribute views are dimensions, BW characteristics or master data.
Attribute views are used to join to a dimension or attribute view.
In most cases used to model master data like entities (like Product, Employee, Business Partner)
Highly re-used and shared in Analytic- and Calculation Views.
Interview Questions:
General Questions:

1. What is sap hana?

SAP HANA is an in-memory database:


 It is a combination of hardware and software made to process massive real time data
using In-Memory computing.
 It combines row-based, column-based database technology.
 Data now resides in main-memory (RAM) and no longer on a hard disk.
 It’s best suited for performing real-time analytics, and developing and deploying real-
time applications.

2. Why to choose sap hana?

SAP HANA is one of the fastest growing products in SAP’s history and is viewed by the
industry as a break through solution for in-memory databases. SAP HANA claims that it
accelerates analytics and applications on a single, in-memory platform as well as
combining databases, data processing, and application platform capabilities.

SAP HANA is a next-generation business platform which brings together


 Business transactions
 Advanced analytics
 Social media
 Mobile experience
 Collaborative business
 Design connections

3. What is SAP HANA Studio?

 The SAP HANA studio is an Eclipse-based development and administration tool


for working with HANA.
 It enables technical users to manage the SAP HANA database, to create and
manage user authorizations, to create new or modify existing models of data etc.
 It is a client tool, which can be used to access local or remote HANA system.

4. What are the supported platforms for HANA studio?

The SAP HANA studio runs on the Eclipse platform 3.6. We can use the SAP HANA
studio on the following platforms:
• Microsoft Windows x32 and x64 versions of: Windows XP, Windows Vista,
Windows 7
• SUSE Linux Enterprise Server SLES 11: x86 64-bit version
Note: For Mac OS, HANA studio is available but there is no HANA client for that.

5. What is SAP HANA 1.5, 1.2 or 1.0 SP03?

They are all the same thing, and 1.0 SP03 is touted to be the final name which should go
into Ramp Up (beta) in Q4 2011. This allows any SAP Net Weaver BW 7.3 Data
Warehouse to be migrated into a HANA appliance. HANA 1.0 SP03 specifically also
accelerates BW calculations and planning, which means even more performance gains
can be attained.
6. What is a restricted user in SAP HANA system?

Restricted users are those users who access HANA system with some applications and
they don’t have SQL privileges on HANA system. When these users are created they
don’t have any access initially.

7. What is schema in sap hana?


There are 3 types of schemas.
1. User Defined Schema
2. System Defined Schema
3. SLT Derived Schema
1. User Defined Schema:
These are created by user (DBA or System Administrator
2. SLT Derived Schema:
When SLT is configured, it creates schema in HANA system. All the tables
replicated into HANA system are contained in this schema
3. System Defined Schema:
These schemas are delivered with the SAP HANA database and contain
HANA system information. There are system schemas like _SYS_BIC,
_SYS_BI, _SYS_REPO,_SYS_STATISTICS etc.
A database schema is a way to logically group objects such as tables, views, stored
procedures etc

8. Maximum number of tables in a schema? In SAP HANA?

Maximum number of tables in a schema are 131072

9. What can be the maximum number of columns in a table in SAP HANA ?


Maximum number of columns in a HANA Table is 1000

10. Explain what is schema mapping in SAP HANA?

Schema mapping is done when the physical schema in the target system is not the same
as the physical schema in the source system. As mentioned earlier, suppose we are
moving components from Development System (DEV) to Production System (PROD).
The tables in DEV reside in DEV_SCHEMA and the same tables reside in PROD system
in PROD_SCHEMA schema. If an attribute view is transported from DEV to PROD, it
will not work because the schema name is referenced in the definition of attribute view.
In order for the promoted objects to work in PROD, schema mapping needs to be set up
in the target system.
11. What are System Requirements for sap hana?

Java JRE 1.6 or 1.7 must be installed to run the SAP HANA studio. The Java runtime
must be specified in the PATH variable. Make sure to choose the correct Java variant for
installation of SAP HANA studio:
 32-bit installation, choose a 32-bit Java variant.
 For a 64-bit installation, choose a 64-bit Java variant.

12. What is Meta data, Master data and Transaction data?

Meta Data:
Meta Data is data about Data. It tells you about the structure of data or Meta Objects.

Master Data:
This Data is key business information like Customer information, Employee, Materials
etc. This is more like a reference data. For Ex. If a customer orders 10 units of your
product instead of asking customer for his shipping address 10 times the same can be
referenced from the Customer Master Data.

Transaction Data:
This is data related to day to day transactions.

13. What is a Delivery Unit in SAP HANA?

Delivery unit (DU) is a container used by the Life Cycle Manager (LCM) to transport
repository objects between the SAP HANA systems. The name of Delivery Unit must
contain only capital letters (A-Z), digits (0-9) and underscores (_).
14. Why to configure Import server in SAP HANA?

In order to load data from external sources to SAP HANA we need to establish a
connection with the server. To connect, we need to provide details of Business Objects
Data Services repository and ODBC drivers. Once the connection is established, we can
import the tables definition and then load data into table definition.

15. What is SAP HANA Appliance 1.0?

AP HANA 1.0 is an analytics appliance which consists of certified hardware, and In


Memory Database (IMDB), an Analytics Engine and some tooling for getting data in and
out of HANA. The logic and structures are built by the user and a tool is used e.g. SAP
Business Objects, to visualize or analyze data.

16. What is the prerequisite for Unit of Measure in SAP HANA?

We need to import the tables T006 & T006A for Unit of Measures
17. Explain the column and Row store in HANA?

HANA supports both type of data store in database. Row store is used when you need to
use Select statement and no aggregations are performed.

Column store is used to perform aggregations and HANA Modeling is supported only on
Column based tables.

18. Which operating system is supported by HANA system?

Only operating system that is supported by HANA is Suse Linux Enterprise Server
SP1/SP2 (SLES SP1/2).

19. What are the different license keys types in HANA system? What is their validity?

1. Temporary License key


2. Permanent License Key
Temporary License keys are automatically installed when you install the HANA
database. These keys are valid only for 90 days and you should request permanent
license keys from SAP market place before expiry of this 90 days period after
installation.
Permanent License keys are valid till the predefine expiration date. License keys specify
amount of memory licensed to target HANA installation.

20. What is the difference between Catalog and Content tab?

Catalog −This contains RDBMS objects like schemas, tables, views, procedures, etc.
You can open SQL editor and design database objects.

Content −This is used to maintain design time repository. You can create new packages
and design Information views in HANA system. Various views can be created under
content tab to meet business requirement and to perform analytical reports on the top of
the Modeling views

21. What are the different perspectives available in HANA?

Modeler: used for creating various types of views and analytical privileges.
SAP HANA Development: Used for programming applications for creating development
objects to access or update data models such as Server-side Java script or HTML files.
Administration: Used to monitor the system and change settings.
Debug: Used to debug code such as SQLScript (.procedure files) or Server-side Java
script (.xsjs files).

22. What are the supported object types in modeler perspective?

Attribute views, Analytical views, Calculation views, Analytical privileges, Procedures,


Decision tables, Process Visibility Scenario.

23. What is the main SAP HANA database component?

Index Server consists of actual data engines for data processing including input SQL and
MDX statements and performs authentic transactions.

24. Explain Parallel Processing in SAP HANA?

Using the columnar data storage approach, the workload in SAP HANA is divided
vertically. The columnar approach allows linear searching and aggregation of data rather
than two-dimensional data structure. If more than one column is to be processed, each
task is assigned to diverse processor. Operations on one column are then collimated by
column divisions processed by different processors.

25. Will the table size in SAP HANA database and in the source system the same?

No as HANA database supports compression.


26. What is SQL Script?
It is a set of SQL extensions for SAP HANA database which allow developers to push
data intensive logic into the database.

27. When should be SQL Script used?

It should be used in cases where other modeling constructs of HANA such as


Attribute views or Analytic views are not sufficient.

28. What is Label Mapping?

We can choose to associate an attribute with another attribute description. Label


mapping is also called as Description mapping. For example if A1 has a label column
B1, then you can rename B1 to A1.description. The related columns appear side by
side during data preview.

29. What is Schema mapping?

Schema mapping is done when the physical schema in the target system is not the same
as the physical schema in the source system.

Note: Schema mapping only applies to references from repository objects to catalog
objects. It is not intended to be used for repository to repository references.

30. What are different types of joins?

A Join clause combines records from two or more tables /view in a database.
SAP HANA supports following types of join.
1. Inner Join
2. Left Outer Join
3. Right Outer Join
4. Full Outer Join
5. Referential Join
6. Text Join

1. The INNER JOIN selects the set of records that match in both the Tables.
Where to use:
Inner join should be used if referential integrity is ensured.
Inner Join is much faster that Outer Join thus is the preferred solution if
possible from semantically perspective
Attribute View: Inner Joins can be used to join different master data tables to
a joint dimension
Analytical Views: Inner Joins can be used if referential integrity cannot be
ensured

2. The Left Outer Join selects the complete set of records from first table
(CUSTOMER), with the matching records (where available) in second table
(SALES_ORDER). If there is no match, the right side will contain null.

3. The Right Outer Join selects the complete set of records from second table
(SALES_ORDER), with the matching records (where available) in first table
(CUSTOMER). If there is no match, the left side will contain null.

4. The FULL OUTER JOIN keyword selects all rows from the left table (table1)
and from the right table (table2).
The FULL OUTER JOIN keyword combines the result of both LEFT OUTER
and RIGHT OUTER joins.

5. Referential Join is semantically an inner join that assume that referential


integrity is given.
Note: Referential integrity is the property of database which ensures that each
foreign key value in a table exists as a primary key in the referenced table.
Referential join is performance wise better than inner join, but only be used
when you are sure that referential integrity is maintained.

6. Text Join is used in order to get language-specific data.


You have a product table that contains product IDs without descriptions and
you have a text table for products that contains language-specific descriptions
for each product. You can create a text join between the two tables to get the
language-specific details. In a text join, the right table should be the text table
and it is mandatory to specify the Language Column.

31. What is sap hana analytic privilege?

Analytic Privileges restrict the user to view data for which they authorize. SAP
HANA Analytic Privileges is used for Security purpose.

SQL Privileges provide authorization on object level not at a record level, so provide
a record or row-level authorization "Analytic Privileges" will be used.

SAP HANA Analytic Privileges are used to provide authorization on below


information view – Attribute View, Analytic View, Calculation View
Attribute view questions:
1. What is an Attribute View?
Attribute views are used to model entity based on the relationships between attribute data
contained in multiple source tables. You can model Columns, Calculated columns and
Hierarchies.

2. What is an Attribute?
Attribute represents the descriptive data used in modeling. Example: City, Country, etc.

3. What are Attributes?


Attribute view acts like a dimension. It join multiple tables and act as Master. Attribute
view is reusable objects.

4. What are the advantages of attribute view?


 Attribute View act as Master data context, which provides Text or Description for
Key/Non-key field.
 Attribute View can be reuse in Analytic View and Calculation View.
 Attributes View is used to select a subset of columns and rows from a database
table.
 Attributes (fields) can be calculated from multiple table fields.
 There is no measure and aggregation option.

5. What are the types of attribute view?


1. Standard attribute view
2. Time attribute view
3. Derived attribute view
1. Standard attribute view: It is a standard attribute which is created by table
fields.
2. Time attribute view: It is Time attribute view, which is based on default time
table
3. Derived attribute view :It is an attribute view which is derived from another
existing attribute view. Derived attribute view will be opened in read-only mode.
The only editable field is its description.

6. Detail of each part in Information Editor is as below -

1. Scenario Pane: In this pane the following node exists-

 Semantics
 Data foundation

2. Detail Pane: In this pane following tab exists –

 Column
 View Properties
 Hierchery

3. Semantics (Scenario Pane): This node represents output structure of the view. Here it
is Dimension.
4. Data Foundation (Scenario Pane): This node represents the table that we use for
defining attribute view.
5. Here we drop table for creating attribute view.
6. Tab (columns, view Properties, Hierarchies) for details pane will be displayed.
7. Local: Here all Local attribute detail will be displayed.
8. Show: Filter for Local Attribute.

7. Which engine is used to create attribute view?

Join engine is used to create attribute view

 This engine is used when we execute any Attribute View in HANA or run native
SQL on more than one table with join condition.
 If there are any calculations involved either in Attribute View or in native SQL
then Join Engine will use Calculation Engine for calculations or fetch the result.

8. What is a Calculated Attribute?


Calculated attributes are derived from one or more existing attributes or constants. For example
deriving the full name of a customer (first name and last name), assigning a constant value to an
attribute that can be used for arithmetic calculations.
Error 1: Language key SPRAS not found for text join
While creating an Attribute view language key not found

I am not getting SPRAS in that drop down list

Solution: Error is due to location of tables TCURT is on left side and TCURC is on right side
that is done by right click on table then change table to left

Error 2: I could see issue in last column. I could see data in T005U table so desc should be
populated.

Solution: You have join REGIO to BEZEI instead of joining to BEZEI join to BLAND
Error 3: selecting data preview from attribute view.
We are trying to demonstrate a big data use case to one of our customer using HANA and
SAPUI5. Though we are certain that HANA is more efficient than our current
implementation using No SQL database, we are not able to demonstrate that effectively
because of restrictions on access privileges

I created analytic view and attribute view on _SYS_BIC schema. View uses table
from _SYS_BIC scheme schema. I am getting errors while selecting data preview

I would like to create an attribute view by joining two tables:


Table:Customers
Key:RowID
Attribute:CustomerID
Table:CustomersKeys
Key:CustomerID
Key:SourceSystem
Key:SourceKey

I join the two tables on the CustomerID key attribute, and receive the following error:

MDXRun time: Internal deployment of object failed: Internal Error:Error occurred during
deployment. The error message is: exception 1: no.1000014
(mdx/metadata/deployment/dmo/DMODimension.cpp:134)n Central table not unique.

Two key attributes found for different tables.

Solution: The thing with Attribute views is you cannot specify fields from both tables in the join
as key attributes. You can only add the fields from a single table as Key attributes (on to the
output) and fields from the other table will have to be added as just attributes.
Error 4: Why is Key Attribute mandatory in Attribute View?
I am curious about the behavior of key attributes in attribute views.
First I thought it is kind of primary key for the entity Attribute View but then I did a few checks
Created two tables
1. CUST -Customer Table- It has Customer ID and Country ID
2. CTRY -Country Table- It has Country ID and Country Description
An Attribute View on top of these two tables

Simple, nothing complex


Now in Semantics

I am able to activate the attribute view and see the output


But what I do next is interesting..I made the CID as a Key Attribute, though it is not a key in the
data ('in' for two rows)
But I am still able to activate the Attribute View and see the data as well. I would like everyone
to try this out.

So what I don't understand is if this is allowed why is Key Attribute Mandatory?


I mean why should there be a key attribute if it does not check for Unique Constraint.
Solution: The Key attributes may be helpful in deciding the join condition like which table and
associated column should be used for the left side of the join and which one on the right. The
attribute view would be joined to the transaction table in Analytic view and the column from the
attribute view will then be the driver column for the join. HANA anyway redefine the join
condition based on the column size and in some cases may re-align the tables, but there has to be
a starting condition for the join.
The Key attribute definition will help in establishing join rules.

Error 5: Activation error for attribute view:


I receive the authorization error:
Internal deployment of object failed; Repository: Encountered an error in repository runtime
extension; Internal Error: Deploy Attribute View: SQL: transaction rolled back by an internal
error: insufficient privilege: Not authorized (ptime/query/plan_executor/ddl/qx_cube.cc:1560)
nCreate view DDL statement: CREATE COLUMN VIEW "_SYS_BIC"."
When I validate an attribute view
I have been using the SYSTEM id in AWS HANA system.
I have added a schema and have added that to the sql privileges of SYSTEM.
Solution: select access on this new schema to _SYS_REPO? If not, please use the SQL:
GRANT SELECT ON SCHEMA <schema_name>" TO _SYS_REPO WITH GRANT OPTION

Error 6: DATA preview of Attribute views (JDBC)


Error Executing Query: SAP DBTech JDBC: [258] (at 69): insufficient privilege: Not
authorized: line 1 col 70 (at pos 69)
Any idea on how to overcome this Error.
What authorization am i missing?
Solution: grant select on schema <SCHEMA> to _SYS_REPO with grant option;
grant select on schema <SCHEMA> to <USER>;

Error 7: SAP Hana - Data Preview of Attribute View fails

I have an Attribute View created in my package, and it uses tables from my schema. I was able
to Validate and Activate the Attribute view after using the following SQL:
GRANT SELECT ON SCHEMA "<SCHEMA_NAME>" to _SYS_REPO WITH GRANT
OPTION;
But when I do a Data Preview of this Attribute View, and click on Raw Data, I get the following
error:
Error: SAP DBTech JDBC: [258]: insufficient privilege: Not authorized
(I'm doing this in SAP Hana Modeler in Eclipse)
How can I fix this error?
Solution: In order to do a Data Preview of Attribute views, you need to run the SQL (Call
"HCP"."HCP_GRANT_SELECT_ON_ACTIVATED_OBJECTS") AFTER deleting all tables in
Dev schema. Run it with tables still in DEV schema,
After deleting tables, ran the SQL, and then recreated my tables in the NEO schema. Then
recreate attribute view, and activated it. The _SYS_BIC schema started to show. And could do a
Data Preview of Attribute Views.

Error 8: SHOWING ERROR AFTER ACTIVATING ATTRIBUTE VIEW


NOTE: I am using SAPHANA TRAIL VERSION

I Created attribute view using two table but after activation it showing following error
Solution: SAP HANA Trial, You are not authorize to use DATA Preview , So after activation of
attribute view , go to Column View of "_SYS_BIC " Schema ubder catalog .
You will find a column view with same name, from here you can preview the data for attribute
view.

Potrebbero piacerti anche