SAP HANA Interview Questions

Published on May 2016 | Categories: Documents | Downloads: 50 | Comments: 0 | Views: 516
of 27
Download PDF   Embed   Report

Comments

Content

Questions on HANA Hardware
1.What is the reason for going In-memory?
One reason is the number of CPU cycles per second is increasing and the cost of processors is
decreasing. For managing the data in memory, there is five-minute rule which is based on the
suggestion that it costs more to wait for the data to be fetched from disk than it costs to keep data in
memory so it depends on how often you fetch the data.
For example there is a table and no matter how large it is and this table is touched by a query at
least once every 55 minutes, it is less expensive (in hardware costs) to keep it in memory than to
read it from memory and if it is frequently accessed it is less expensive to store it in memory.
2.What is a Five-minute rule?
It is a rule of thumb for deciding whether a data item should be kept in memory, or stored on
disk and read back into memory when required. The rule is “randomly accessed disk pages of cache
are re-used every 5 minutes”.
3.What is multi-core CPU?
Multiple CPU’s on one chip or in one package is called multi-core CPU. .
Traditional databases for online transaction processing (OLTP) do not use current hardware
efficiently.
4.What is Stall?
Waiting for data to be loaded from main memory into the CPU cache is called as Stalls.
5.What is SAP In-Memory Appliance (SAP HANA)?
HANA is an in-memory technique to store data that is particularly suited for handling very large
amounts of tabular, or relational, data with extra ordinary performance. Common databases store
tabular data row-wise. Reorganizing the data in memory column-wise brings a tremendous speed
increase when accessing a subset of the data in each table row.
6.What are the components or products of HANA?
SAP HANA contains the following components.
• SAP HANA DATABASE
• SAP HANA Studio SAP HANA CLIENT
SAP HOST AGENT 7.2
• SAP HANA INFORMATION COMPOSER
• DIAGNOSTIC AGENT 7.3
SAP HANA client package for MS excel
SAP HANA UI for Information Access (INA)
SAP HANA AFL 1.0
Software Update Manager for SAP HANA
SAP LT Replication AddOn
SAP LT Replication Server
SAP HANA Direct Extractor Connection (DXC)

SAP Data Services 4.0
7.What are the different editions available in HANA appliance software?
Platform and Enterprise edition.
Platform edition is intended for customers who want to use ETL-based replication and already have
a license for SAP BO Data Services.
Enterprise edition is intended for customers who want to use either trigger-based replication or ETLbased replication and do not already have all of the necessary licenses for SAP BO Data Services.
8.What is columnar and Row-Based Data Storage?
Fig: Row and Column-based storage
A database table contains data in the form of rows and columns. However Computer memory is
organized as a linear structure. To store a table in linear memory, there are two options. A rowbased storage stores a table as a sequence of records, each of which contains the fields of one
row. In a columnar storage the entries of a column are stored in contiguous memory locations.
The SAP HANA database allows to specify whether a table is to be stored column-wise or row-wise.
It is also possible to alter an existing table from columnar to row-based and vice versa.
Search operations in tabular data can be accelerated by organizing data in columns instead in rows.
9.What are the advantages of Column based tables?
Calculations are typically executed on single or a few columns only.
The table is searched based on values of a few columns.
The table has a large number of columns.
The table has a large number of rows and columnar operations are required (aggregate, scan, etc.).
High compression rates can be achieved because the majority of the columns contain only few
distinct values (compared to number of rows).
10.What are the advantages of Row-based tables?
The application needs to only process a single record at one time (many selects and/or updates of
single records).
The application typically needs to access a complete record (or row).
The columns contain mainly distinct values so that the compression rate would be low.
Neither aggregations nor fast searching are required.
The table has a small number of rows (e. g. configuration tables).
11.In which case the data to be stored in columnar storage?
To enable fast on-the-fly aggregations, ad-hoc reporting, and to benefit from compression
mechanisms it is recommended that transaction data to be stored in a column-based table.
12.Is it possible to join tables of row-based with column-based tables?
Yes
13.Are column-based tables always the better choice than row-based tables?

No. There are also situations in which row based tables are advantageous.
14.What are the advantages of Columnar tables?
Higher Data Compression Rates
Higher Performance for Column Operations
Elimination of Additional Indexes
Parallelization
Elimination of Materialized Aggregates
15.What are the different Compression Techniques you know?
Run-length encoding
Cluster encoding
Dictionary encoding
16.Why materialized aggregates are not required?
With a scanning speed of several gigabytes per millisecond, in-memory column stores, make it
possible to calculate aggregates on large amounts of data on the fly with high performance. This is
expected to eliminate the need for materialized aggregates in many cases.
17.What are the advantages of Eliminating materialized aggregates?
No additional tables for storing aggregate results means:
Simplified data model
Simplified application logic
Higher level of concurrency and
With the fly Aggregation we have aggregated values up to date
18.What is parallelization?
Column-based storage makes it easy to execute operations in parallel using multiple processor
cores. In a column store data is already vertically partitioned 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 (core 3 and 4 below).

SAP Landscape Transformation
1.What are the different types of replication techniques?
1.ETL based replication using BODS
2.Trigger based replication using SLT
3.Extractor based data acquisition using DXC
2.What is SLT?
SLT stands for SAP Landscape Transformation which is a trigger based replication. SLT replication
server is the replication technology to pass data from source system to the target system. The
source can be either SAP or non-SAP. Target system is SAP HANA system which contains HANA
database.

3.Is it possible to load and replicate data from one source system to multiple target database
schemas of HANA system?
Yes. It is possible for up to 4.
4.Is it possible to specify the type of data load and replication?
Yes either in real time, or scheduled by time or by interval.
5.What is Configuration in SLT?
The information to create the connection between the source system, SLT system, and the SAP
HANA system is specified within the SLT system as a Configuration. You can define a new
configuration in Configuration & Monitoring Dashboard (transaction LTR).
6.Is there any pre-requisite before creating the configuration and replication?
For the SAP source systems DMIS add-on is installed in SLT replication server. User for RFC
connection has the role IUUC_REPL_REMOTE assigned but not DDIC.
For non-SAP source systems DMIS add-on is not required and grant a database user sufficient
authorization for data replication.
7.What is Configuration and Monitoring Dashboard?
It is an application that runs on SLT replication server to specify configuration information (such as
source system, target system, and relevant connections) so that data can be replicated. It can also
use it to monitor the replication status (transaction LTR).
Status Yellow: It may occur due to triggers which are not yet created successfully.
Status Red: It may occur if master job is aborted (manually in transaction SM37).
8.What is advanced replication settings?
A transaction that runs on SLT replication server to specify advanced replication settings like
Modifying target table structures,
Specifying performance optimization settings
Define transformation rules
9.What is Latency?
It is the length of time to replicate data (a table entry) from the source system to the target system.
10.What is logging table?
A table in the source system that records any changes to a table that is being replicated. This
ensures that SLT replication server can replicate these changes to the target system.
11.What are Transformation rules?
A rule specified in the Advanced Replication settings transaction for source tables such that data is
transformed during the replication process. Example you can specify rule to
Convert fields
Fill empty fields
Skip records

12.What happens when you set-up a new configuration?
The database connection is automatically created along with GUID and Mass transfer id (MT_ID).
A schema GUID ensures that configurations with the same schema name can be created.
The Mass transfer ID is used in the naming of SLT jobs and the system can uniquely identify a
schema.

13.What factors influence the change/increase the number of jobs?
Number of configurations managed by the SLT replication server
Number of tables to be loaded/replicated for each configuration
Expected speed of initial load
Expected replication latency time. As a rule of thumb, one BDG job should be used for each 10
tables in replication to achieve acceptable latency times.
14.When to change the number of Data Transfer jobs?
If the speed of the initial load/replication latency time is not satisfactory
If SLT replication server has more resources than initially available, we can increase the number of
data transfer and/or initial load jobs
After the completion of the initial load, we may want to reduce the number of initial load jobs
15.What are the jobs involved in replication process?
1. Master Job (IUUC_MONITOR_<MT_ID>)
2. Master Controlling Job (IUUC_REPLIC_CNTR_<MT_ID>)
3. Data Load Job (DTL_MT_DATA_LOAD_<MT_ID>_<2digits>)
4.Migration Object Definition Job (IUUC_DEF_MIG_OBJ_<2digits>)
5.Access Plan Calculation Job (ACC_PLAN_CALC_<MT_ID>_<2digits>)
16.What is the relation between the number of data transfer jobs in the configuration settings and the
available BGD work processes?
Each job occupies 1 BGD work processes in SLT replication server. For each configuration, the
parameter Data Transfer Jobs restricts the maximum number of data load job for each mass transfer
ID (MT_ID).
A mass transfer ID requires at least 4 background jobs to be available:
One master job
One master controller job
At least one data load job
One additional job either for migration/access plan calculation/to change configuration settings in
“Configuration and Monitoring Dashboard”.
17.If you set the parameter “data transfer jobs” to 04 in a configuration “SCHEMA1”, a mass transfer
ID 001 is assigned. Then what jobs should be in the system?
1 Master job (IUUC_MONITOR_SCHEMA1)
1 Master Controller job (IUUC_REPL_CNTR_001_0001)
At most 4 parallel jobs for MT_ID 001 (DTL_MT_DATA_LOAD_001_ 01/~02/~03/~04)

Performance: If lots of tables are selected for load / replication at the same time, it may happen that
there are not enough background jobs available to start the load procedure for all tables
immediately. In this case you can increase the number of initial load jobs, otherwise tables will be
handled sequentially.
For tables with large volume of data, you can use the transaction “Advanced Replication Settings
(IUUC_REPL_CONT)” to further optimize the load and replication procedure for dedicated tables.
18.What happens after the SLT replication is over?
The SLT replication server creates 1 user, 4 roles, 2 stored procedures and 8 tables.
1 User
1 Privilege
4 Roles
<REPLICATION SCHEMA>_DATA_PROV
<REPLICATION_SCHEMA>_POWER_USER
<REPLICATION_SCHEMA>_USER_ADMIN
<REPLICATION_SCHEMA>_SELECT
2 Stored procedures
RS_GRANT_ACCESS, RS_REVOKE_ACCESS
8 Tables
DD02L, DD02T, RS_LOG_FILES, RS_MESSAGES, RS_ORDER, RS_ORDER_EXT,
RS_SCHEMA_MAP, RS_STATUS
19.What are the different replication scenarios?
Load, Replicate, Stop, Suspend and Resume.
Before you select any application table, the initial load of the tables DD02L, DD02T & DD08L must
be completed as they contain the metadata information.
Load: Starts an initial load of replication data from the source system. The procedure is a one-time
event. After it is completed, further changes to the source system database will not be replicated.
For the initial load procedure, neither database triggers nor logging tables are created in the source
system. Default settings use reading type 3 (DB_SETGET) with up to 3 background jobs in parallel
to load tables in parallel or subsequently into the HANA system.
Replicate: Combines an initial load procedure and the subsequent replication procedure (real time or
scheduled).
Before the initial load procedure will start, database trigger and related logging table are created for
each table in the source system as well as in SLT replication server.
Stop Replication: Stops any current load or replication process of a table.
The stop function will remove the database trigger and related logging tables completely. Only use
this function if you do want to continue a selected table otherwise you must initially load the table

again to ensure data consistency.
Suspend: Pauses a table from a running replication. The database trigger will not be deleted from
the source system. The recording of changes will continue and related information is stored in the
related logging tables in the source system.
If you suspend tables for a long time the size of logging tables may increase and adjust the table
space if required.
Resume: Restarts the application for a suspended table. The previous suspended replication will be
resumed (no new initial load required).
20.What happens if the replication is suspended for a long period of time or system outage of SLT or
HANA system?
The size of the logging tables increases.
21.How to avoid unnecessary logging information from being stored?
Pause the replication by stopping the schema-related jobs.
22.Will the table size in SAP HANA database and in the source system the same?
No as HANA database supports compression.
23.When to go for table partitioning?
If the table size in HANA database exceeds 2 billion records, split the table by using portioning
features by using “Advanced replication settings” (transaction IUUC_REPL_CONT, tab page
IUUC_REPL_TABSTG).
24.Where do you define transformation rules?
By using “Advanced replication settings” (transaction IUUC_REPL_CONT, tab page IUUC ASS
RULE MAP)
25.Are there any special considerations if the source system is non-SAP system?
The concept of trigger-based replication is actually meant for SAP source systems. The main
differences are:
There will be a database connection between non-SAP source and SLT system instead of RFC.
Source must have primary key
Tables DD02L, DD02T which contains metadata are just initially loaded but not replicated.
The read modules reside on SLT system.
Tables with database specific formats may need transformation rules before they are replicated.
Only SAP supported databases (with respective DBSL for SAP Net Weaver 7.02) are supported as
non-SAP source systems.
26.What are the potential issues in the creation of configuration?
Missing add-on DMIS_2010 in source system
Missing the proper role of SAP_IUUC_REPL_REMOTE for RFC user
( SAP_IUUC_USER for SLT system )

Logon credentials are not correct
27.How can you ensure that data is consistent in source system and HANA system?
Since any changes in the source system is tracked in dedicated logging tables, the replication status
for each changed data record is transparent. A entry of logging table is deleted after a successful
commit statement from HANA database and this procedure ensures the data consistency between
source system and HANA system.
28.Does SLT for SAP HANA support data compression like SAP HANA database?
Yes, this is automatically covered by the RFC connection used for data replication from the SAP
source system.

Questions on limits
1.Maximum number of tables in a schema?
131072
2.What can be the maximum table name length?
127 characters
3.What can be the maximum column name length?
127 characters
4.What can be the maximum number of columns in a table?
1000
5.What can be the maximum number of columns in a view?
1000
6.What can be the maximum number of partitions of a column table?
1000
7.What can be the maximum number of rows in each table?
Limited by storage size RS: 1TB/sizeof(row)
CS: 2^31 * number of partitions
8.In which table you can get the current system limits?
M_SYSTEM_LIMITS
9.Maximum number of jobs you can view the information in the Current tab of Job log?
5

Questions on SQLScript

1.What is SQLScript?
It is a set of SQL extensions for SAP HANA database which allow developers to push data intensive
logic into the database.
2.When should be SQLScript used?
It should be used in cases where other modeling constructs of HANA such as Attribute views or
Analytic views are not sufficient.
3.Explain how SQLScript procedure is processed in HANA database?
When a user creates a new procedure, the HANA database query compiler first:
Parse the statements
Check the statement semantic correctness
Optimize the code for Declarative and Imperative logic
Code generation creates Calculation models for Declarative logic and L nodes for Imperative logic
Compiled procedure creates Content in the database Catalog and in Repository.
4.What happens when you compile the procedure?
During compilation, the call to the procedure is rewritten for processing by the calculation engine.
5.What happens when you execute the procedure?
It binds the actual parameters to the calculation models generated in the definition phase.
6.What are the data types supported in SQLScript?
SQLScript allows the definitions of table types and also supports primitive data types such as
Integer, Decimal(p,q), Varchar, Blob, Timestamp, etc.
7.What is a table type?
Table types are used to define parameters for a procedure that represent tabular results.
Example:
CREATE TYPE tt_publishers AS TABLE ( publisher INTEGER, name VARCHAR(50), price
DECIMAL, cnt INTEGER);
CREATE TYPE tt_years AS TABLE ( year VARCHAR(4), price DECIMAL, cnt INTEGER);
8.What is the general syntax used in creating procedure?
CREATE PROCEDURE <proc_name> [(<parameter_clause>)]
[LANGUAGE <lang>] [SQL SECURITY <mode>]
[READS SQL DATA [WITH RESULT VIEW <view_name>]] AS
<local_scalar_variables>
BEGIN <procedure_code> END
9.How to recompile a procedure?
ALTER PROCEDURE proc_name RECOMPILE [WITH PLAN]
10.Can you specify a default value while creating procedure? Is there any change while calling the
procedure?
CREATE PROCEDURE my_proc (IN P1 INT,

IN P2 INT DEFAULT 1,
OUT out1 DUMMY) AS
BEGIN
out1 = SELECT :P1 + :P2 AS DUMMY FROM DUMMY;
END;
While calling the procedure, we need to pass 'Named Parameters' with token (=>).
CALL my_proc (P1 => 3, out1 => ?)
If you want to specify all the input fields then call statement would be:
CALL my_proc (3, 4, ?)
11.What is the purpose of procedure 'Call... With Overview' option?
To write the results of a procedure call directly into a physical table.
CALL my_proc (3, 4, NULL) WITH OVERVIEW;
12.What is the purpose of procedure 'Call.....In Debug Mode' option?
It creates the additional debug information during the execution of the procedure. This type of call
has additional runtime overhead hence should be used for debugging purposes only.
CALL my_proc (3, 4, NULL) IN DEBUG MODE;
13.What is Table variable?
These are variables with table type which are bound to the value of a physical table, SQL query or a
calculation engine plan operator. Table variables are bound using equality operator.
14.What is a scalar variable?
We define scalar variable as IN, OUT, or INOUT and can be referenced anywhere in a procedure.
lt_expensive_books = SELECT title, price, crcy FROM :it_books
WHERE price > :minPrice AND crcy = :currency;
In above assignment, the variable lt_expensive_books is bound. Variable :it_books refers to an IN
parameter of a Table type. :minPrice and :currency refer to IN parameter of a scalar type.
15.What is CE plan operator? What are the different categories?
CE plan operator does the data transformation functionality internally and used in definition of
functions. It is an alternate to using SQL statements.
Data Source Access operators that bind a column table or a column view to a table variable.
(CE_COLUMN_TABLE, CE_JOIN_VIEW, CE_OLAP_VIEW, CE_CALC_VIEW)
Relational operators that allow a user to bypass the SQL processor during evaluation and directly
executed in the calculation engine.
(CE_JOIN, CE_LEFT_OUTER_JOIN, CE_RIGHT_OUTER_JOIN,
CE_PROJECTION,CE_CALC, CE_AGGREGATION, CE_UNION_ALL)
Special extensions implement, e.g., crucial business functions inside the database kernel.
(CE_VERTICAL_UNION, CE_CONVERSION)
16.What is CE_COLUMN_TABLE operator?
It provides access to an existing column table. It takes the name of the table and returns its content
bound to a variable.

Example:
ot_books1 = CE_COLUMN_TABLE (“BOOKS”);
ot_books2 = CE_COLUMN_TABLE (“BOOKS”, [“TITLE”, “PRICE”, “CRCY”]);
This example only works on a column table and does not invoke the SQL processor. It is
semantically equivalent to the following:
ot_books3 = SELECT * FROM books;
ot_books4 = SELECT title, price, crcy FROM books;
The function that provide data source access does not allow renaming of attributes.
17.What is CE_JOIN_VIEW operator?
It return results for an existing join view (also known as Attribute view). It takes the name of join view
and optional list of attributes as parameters.
Example:
out = CE_JOIN_VIEW (“PRODUCT_SALES”, [“PRODUCT_KEY”, “PRODUCT_TEXT”, “SALES”]);
18.What is CE_OLAP_VIEW operator?
It return results for an existing OLAP view (also known as Analytical view). It takes the name of
OLAP view and an optional list of key figures and dimensions as parameters. The OLAP view is
grouped by dimensions and the key figures are aggregated using the default aggregation of the
OLAP view.
Example:
out = CE_OLAP_VIEW (“OLAP_view”,[“Dim1”, “kf”]);
Is equivalent to
out = SELECT dim1, SUM(kf) FROM OLAP_view GROUP BY dim1;
19.What is CE_CALC_VIEW operator?
It returns results for an existing calculation view. It takes the name of the calculation view and
optionally a projection list of attribute names.
Example:
out = CE_CALC_VIEW (“CALC_view”, [“CID”, “CNAME”]);
Is equivalent to
out = SELECT cid, cname FROM CALC_view;
20.What is CE_JOIN operator?
It calculates a inner join of the given pair of tables on a list of join attributes. Each pair of join
attributes must have identical attribute names else one of them must be renamed prior to the join.
Example:
ot_pubs_books1 = CE_JOIN (:lt_pubs, :it_books, [“PUBLISHER”]);
ot_pubs_books2 = CE_JOIN (:lt_pubs, :it_books, [“PUBLISHER”], [“TITLE”, “NAME”, “PUBLISHER”,
“YEAR”]);

Is equivalent to
ot_pubs_books3 = SELECT P.publisher as publisher, name, street, post_code, city,
country, isbn, title, edition, year, price, crcy
FROM :lt_pubs AS P, :it_books as B
WHERE P.publisher = B.publisher;
ot_pubs_books4 = SELECT title, name, P.publisher as publisher, year
FROM :lt_pubs AS P, :it_books AS B
WHERE P.publisher = B.publisher;
21.What is CE_LEFT_OUTER_JOIN operator?
It calculates the left outer join. Besides the function name the syntax is same as CE_JOIN.
22.What is CE_RIGHT_OUTER_JOIN operator?
It calculates the right outer join. Besides the function name the syntax is same as CE_JOIN.
23.What is CE_PROJECTION operator?
It restricts the columns in the table variable and optionally renames columns, computes expression,
or applies a filter.
Example:
ot_books1 = CE_PROJECTION(:it_books, [“TITLE”, “PRICE”, “CRCY” AS “CURRENCY”], '“PRICE”
> 50');
Is equivalent to
ot_books2 = SELECT title, price, crcy AS currency
FROM :it_books WHERE price > 50;
24.What is CE_CALC operator?
It evaluates an expression and then bound to a new column
Example:
with_tax = CE_PROJECTION(:product, [“CID”, “CNAME”, “OID”, “SALES”,
CE_CALC('”SALES” * :vat_rate', decimal(10,2)) AS
“SALES_VAT”],
''”CNAME” = ':cname''');
Is equivalent to
with_tax2 = SELECT cid, cname, oid, sales, sales * :vat_rate AS sales_vat
FROM :product
WHERE cname = ':cname';
All columns used in CE_CALC have to be included in the projection list. Another frequent use of
CE_CALC is computing row numbers.
CE_CALC('rownum()', integer) AS "RANK"
25.What is CE_AGGREGATION operator?

It groups the input and computes aggregates for each group.
Supported aggregate functions are count(“column”), sum(“column”), max(“column”), min(“column”).
Use sum(“column”)/count(“column”) to compute the average.
Example:
ot_books1 = CE_AGGREGATION(:it_books, [COUNT (“PUBLISHER”) AS CNT], [“YEAR”]);
Is equivalent to
ot_books2 = SELECT COUNT (publisher) as cnt, year FROM :it_books GROUP BY year;
26.What is CE_UNION_ALL operator?
It computes the union of two tables which need to have identical schemas.
Example:
ot_all_books1 = CE_UNION_ALL (:lt_books, :it_audit_books);
Is equivalent to
ot_all_books2 = SELECT * FROM :lt_books
UNION ALL
SELECT * FROM :it_audit_books;
27.What is special operator?
CE_VERTICAL_UNION and CE_CONVERSION are the special operators which do not have any
immediate SQL equivalent.
28.What operator is used to debug SQLScript procedures?
TRACE operaor. It traces the tabular data passed as its argument into a local temporary table and
return its input unmodified. The names of the temporary tables can be retrieved from the
SYS.SQLSCRIPT_TRACE view.
Example: out = TRACE (:input);
29.How to set-up tracing?
From the Administration perspective, navigate to tab “Trace Configuration” . In order to change
settings, you need to have system privileges “TRACE ADMIN” and “INFILE ADMIN”.
30.What is the difference between BREAK and CONTINUE?
Break means loop should stop processing, CONTINUE means loop should stop processing the
current iteration and immediately start processing the next iteration.
31.What is Cursor?
It is used to fetch single rows from the result set returned by a query.
CREATE PROCEDURE cursor_proc LANGUAGE SQLSCRIPT AS
v_isbn VARCHAR(20);
CURSOR c_cursor1 (v_isbn VARCHAR(20)) FOR
SELECT isbn, title, price, crcy FROM books WHERE isbn = :v_isbn
ORDER BY isbn;

BEGIN
OPEN c_cursor1('978-3-86894-012-1');
IF c_cursor1::ISCLOSED THEN CALL ins_msg_proc('WRONG: cursor not open');
ELSE CALL ins_msg_proc('OK: cursor open');
END IF;
FETCH c_cursor1 INTO v_isbn, v_title, v_price, v_crcy;
IF c_cursor1::NOTFOUND THEN CALL ins_msg_proc('WRONG: cursor contains no valid data');
ELSE CALL ins_msg_proc('OK: cursor contains valid data');
END IF;
CLOSE c_cursor1;
END;
32.How to loop cursor over result sets?
Using FOR loop.
CREATE PROCEDURE foreach_proc() LANGUAGE SQLSCRIPT AS
v_isbn VARCHAR(20) := '';
CURSOR c_cursor1 (v_isbn VARCHAR(20)) FOR
SELECT isbn, title, price, crcy FROM books ORDER BY isbn;
BEGIN
FOR cur_row as c_cursor1 DO
CALL ins_msg_proc('book title is: ' || cur_row.title);
END FOR;
END;

Questions on Modeler
1.What are the two developer roles in HANA SPS05?
The two developer roles are Modeler and Application Programmer.
Modeler: modeler is concerned with the definition of model and schemas used in the SAP HANA,
the specification and definition of tables, views, primary keys, indexes, partitions and interrelationship of the data, designing and defining authorization and access control through the
specification of privileges, roles and users and generally uses the perspective “Administration
Console” and “Modeler”.
Application Programmer: Programmer is concerned with building SAP HANA applications which are
designed based on MVC (model-view-controller) architecture and generally uses the perspective
“SAP HANA Development”.
2.Explain HANA database Architecture (SP05)?
Clients connect to the database system which forms a session within the database in the form of
SQL statements. In the HANA database, each SQL statement is processed in the context of a
transaction. New sessions are assigned to a new transaction.
Traditional database applications uses JDBC and ODBC interface to communicate with the
database management system over a network connection and application uses SQL to manage and

query the data stored in the database. In the HANA database Index server is the main component of
database management which 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 transaction.
The Transaction manager coordinates database transactions, and keeps track of running and closed
transactions. When a transaction is committed or rolled back, the transaction manager informs the
involved storage engines about this event so they can execute necessary actions.
The HANA database has its own scripting language called SQLScript that is designed to enable
optimization and parallelization. HANA supports the Business Functional Library (BFL) and
Predictive Analysis Library (PAL) and can be called directly from within SQLScript. It also supports
the development of programs written in R language.
SQL and SQLScript are implemented using a common infrastructure of Built-in functions. That have
access to various meta definitions such as definitions of relational tables, columns, views, and
indexes, definitions of SQLScript procedures. This Metadata is stored in one common catalog (row
store or column store).
The Persistence layer ensures that the database after a restart is restored to the most recent
committed state. It uses a combination of write-ahead logs, shadow paging and save points. The
persistence layer also contains Logger that manages the transaction log.
The Index server uses the Preprocessor Server for analyzing the text data and extracting the
information based on text search capabilities. 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 other servers in the system.

3.What is SAP XS (Extended Application Service)?
SAP HANA XS provides end-to-end support for web-based applications .
4.What are Development objects?
The building blocks of SAP HANA applications are called development objects.
5.What is Repository?
The HANA Repository is storage system for development objects and is built into SAP HANA.
The repository supports Version control, Transport, and Sharing of objects between multiple
developers. We can add objects to the repository, update the objects, publish the objects, and
compile these objects into runtime objects.
6.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).

To open a perspective, go to Window → Open Perspective.
7.Before starting development work in SAP HANA studio, What are the roles a user should have on
SAP HANA server ?
Modeling, Content_Admin.
8.What is a Delivery Unit?
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 DU must contain only capital letters (A-Z),
digits (0-9) and underscores (_).
9.What is a workspace?
The place where you work on project-related objects is called a repository workspace.

10.What is a package and its types?
Package is used to group together related content objects in SAP HANA studio. By default it creates
Non-structural.
Type
Description
Structural
Package only contains sub-packages. It cannot contain repository objects.
Non-Structural Package contains both repository objects and sub-packages.
11.What are the default packages delivered with the repository?
Sap
System-local
System-local.generated
System-local.private
12.What can be the maximum length of a package name?
190 characters including dots. Example: RajKumar.pkg123
13.What are package privileges?
REPO.READ: Read access to the selected package and design-time objects (both native and
imported).
REPO.EDIT_NATIVE_OBJECTS: Authorization to modify design-time objects in packages
originating in the system the user is working in.
REPO.ACTIVATE_NATIVE_OBJECTS: Authorization to activate/reactivate design-time objects in
package originating in the system the user is working in.
REPO.MAINTAIN_NATIVE_PACKAGES: Authorization to update or delete native packages or
create sub-packages of packages originating in the system in which the user is working.
14.How each object is uniquely identified in the repository?
Each object is uniquely identified by the combination of package name, object name and object type.
15.Can multiple objects of the same type can have the same object name?

Yes, only when they belong to different packages.
16.What are the different tasks you can perform in setting up the basis persistence model for SAP
HANA XS?
Creating Schema, Creating Table, Creating View, Creating Sequence and Importing table content.
17.What are the different tasks you can perform in modeler perspective?
Import metadata, Load data, Create packages, Create information views, Create Procedures, Create
Analytical privileges, Import SAP NetWeaver BW objects, Create Decision Tables, Import and Export
objects.
18.What are the supported object types in modeler perspective?
Attribute views, Analytical views, Calculation views, Analytical privileges, Procedures, Decision
tables, Process Visibility Scenario.
19.What are the different modeler preferences and how do you set?
You can set the modeler preferences by choosing the menu Window → Preferences → Modeler (or)
Quick launch → Manage Preferences.
20.Why to configure Import server?
In order to load data 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 definitions.
Quick launch – Configure Import Server
Enter the IP address of the server from which you want to import data
Enter the repository name
Enter the ODBC data source, and choose OK.
21.How to Import table definitions?
If you want to import all table definitions, Go to
File menu → Choose Import
Expand the SAP HANA Content node
Choose “Mass Import of Metadata” and choose next
Select the target system where you want to import all the table definitions, and choose next
In the Connections Details Dialog , enter the user name and password of the target system
Select the required source system and choose Finish.
Note: If you want to import selective table definitions use “Selective Import of Metadata”.
22.How to load data into tables?
Quick Launch → Data Provisioning
Choose Source
Choose Load (for Initial load) or Replicate (for data replication)
Select the required tables to load or replicate
Click Finish.

23.How to upload data from Flat files?
File menu → Import
In 'Select an Import Source' section, expand the 'SAP HANA Content' node
Select 'Data from Local file' and choose Next
Select the Target system to which you want to import the data using Flat file, choose Next
In 'Define Properties Import Page' browse the file containing the data
Select 'New' option (If you want to load the data into a new table) or
Select the 'Existing' option (If you want to append the data to an existing table)
Click Finish.
24.How to copy standard content delivered by SAP?
Quick Launch → Mass Copy
Create a mapping between source package and target package
Choose Next to view the summary
Click Finish to confirm content copy.
25.What is Schema mapping? How do you do 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.
Quick Launch → Schema Mapping
Choose Add
Create a mapping in the Target system between the Authoring schema and Physical schema
Click OK.
Note: Schema mapping only applies to references from repository objects to catalog onjects. It is not
intended to be used for repository to repository references.
26.In which configuration table, the mapping between authoring and physical schema is stored?
SYS_BI.M_SCHEMA_MAPPING
27.What's the purpose of Generating Time Data?
If you model a time attribute view without generating time data, an empty view will be shown when
you use data preview. To generate Time Data go to
Quick Launch → Generate Time Data
If your financial year is from January to December, Choose 'Calender Type' as Gregorian else Fiscal
Click Generate.
28.In which configuration table the generated time data information will be stored?
For Gregorian calendar type (SYS_BI)
M_TIME_DIMENSION_YEAR M_TIME_DIMENSION_MONTH
M_TIME_DIMENSION_WEEK M_TIME_DIMENSION
For Fiscal
M_FISCAL_CALENDAR

29.What is an Attribute?
Attribute represents the descriptive data used in modeling. Example: City, Country, etc.
30.What is a Simple Attribute?
Simple attributes are individual analytical elements that are derived from the data foundation. For
example Product_ID, Product_Name are attributes of a Product subject area.
31.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.
32.What is a Private Attribute?
Private attributes used in an analytical view allow you to customize the behavior of an attribute for
only that view. For example if you create an analytical view and you want a particular attribute to
behave differently than it does in the attribute view to which it belongs, you can define it as a private
attribute.
33.What is a Measure?
Measures are simple measurable analytical elements and are derived from Analytic and Calculation
views.
34.What is a Simple Measure?
Simple Measure is a measurable analytical element that is derived from the data foundation.
35.What is a Calculated Measure?
Calculated Measures are defined based on a combination of data from OLAP cubes, arithmetic
operators, constants, and functions.
36.What is a Restricted Measure?
Restricted measures are used to filter the value for an output field based on the user-defined rules
For example you can restrict the revenue column only for Region = APJ, Year = 2013.
37.What are Counters?
Counters add a new measure to the Calculation view definition to count the recurrence of an
attribute. For example, to count how many times Product appears.
38.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.
Also you can fine-tune the attributes of an Attribute view:
Can apply filter to restrict values
Can be defined as Hidden so that they can be processed but not visible to end users
Can be defined as key attributes and used when joining multiple tables
Can be further drill down by 'Drill Down Enable' property.

39.What are the tables to be imported for creating attribute view of type Time?
T009 and T009B.
40.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.
41.What happens when one of the table in Attribute view has modified column with data type?
It reflects the previous state of the columns, even if you remove and add it again. It is referring to the
cache. To resolve this issue close the editor and reopen it.
42.What happens when you open an attribute view with a missing column in the required object?
An error will be shown “column is not found in table schemaname.tablename” and the editor does
not open. To make it consistent
Open the required object and add the missing column/attribute/measure temporarily
Now open the object which was previously giving error
Find all references to this column, Save the object
Now go ahead and delete the column from the required object.
43.What is an Analytic view?
Analytic views are used to model data that includes measures. In case of multiple tables, measures
must originate from only one of these tables (central table). You can model Columns, Calculated
columns, Restricted columns, Variables, and Input parameters.
Also you can fine-tune the attributes of an Analytic view:
Can apply filter to restrict values
Can be defined as Hidden so that they can be processed but not visible to end users
Can be defined as key attributes and used when joining multiple tables
Can be further drill down by 'Drill Down Enable' property
You can model Aggregation type on measures
You can model Currency and Unit of Measure.
44.Can we include Attribute views in Analytic view definition?
Yes
45.What does the Scenario panel of Analytic view editor contains?
Data Foundation: represents the tables used for defining the fact table of the view. You can specify
the central table by selecting a value in 'Central Entity' property.
Logical Join: represents the relation between fact table and attribute views to create start schema.
Semantics: represents the output structure of the view.
46.What does the aggregation type 'Calculate Before Aggregation' mean?
If you select 'Calculate Before Aggregation', the calculation happens as per the expression specified

and then the results are aggregated as SUM, MAX, MIN, or COUNT. If it is NOT selected, the
calculation happens as per the expression specified but the data is not aggregated but shown as
FORMULA.
47.How to activate the other objects (required or impacted objects) along with current object?
By using 'Save and Activate All' option in the toolbar.
48.Can you add column views to Analytic view and Calculation view?
We can add column views in a Calculation view but not in the Analytic view.
49.Consider there is a table that contains product ID's with no product description and you have a
text table for products that has language specific description for each product? How can you get the
language specific data?
Create a text join between these two tables. The right table should be the text table and is
mandatory to specify the “Language Column” in the 'Properties' view.
50.What are the restrictions while creating the join between the views and fact table?
A table should not appear twice in any join path, i.e. Self join is not supported.
While creating join between Analytic view and Attribute view the same table cannot be used in both
the views.
51.What is Calculation view?
Calculation view is more advanced slice of the data and can include measures from multiple source
of tables, can include advanced SQL logic. The data foundation of the calculation view can include
any combination of tables, column views, attribute views and analytic views. We can create joins,
unions, projections, and aggregation levels on the sources. You can model Attributes, Measures,
Calculated measures, Counters, Hierarchies (created outside of the attribute view), Variables and
Input parameters.
52.Calculation views are modeled based on what?
Graphical views or Scripted views but not as SQLScript. However there are exceptions to this rule.
SQLScript with the following properties can be used in Calculation view:
No input parameters
Always Read-only (do not make changes to database)
Side-effect free.
53.What are the option available in 'Run With' while creating calculation view?
Definer's Right, Invoker's Right.
Definers right: System uses the rights of the definer while executing the view or procedure for any
user.
Invokers right: System uses the rights of the current user while executing the view or procedure.
54.While creating a Graphical Calculation view, what are the options available in Tools palette?
Union, Join, Projection, and Aggregation.
Note: You can have only one source of input for Projection and Aggregation views.
You can create filters on Projection and Aggregation view attributes.

55.How to create Counters in Graphical Calculation view?
For example to get the number of distinct values of an attribute:
Go to the Output pane, right click Counters
From the context menu, choose New
Choose Attribute
Click ok.
56.Is it mandatory to include measures for Calculation view?
No. Calculation view containing no measures works like an attribute view and is not available for
reporting purposes.
57.How do you debug the Calculation view with lot of complexity at each level?
By previewing the data of an intermediate node.
58.What is Mapping input parameter in Calculation view?
It is used for mapping the input parameters in the underlying data sources of the calculation view
with calculation view parameters.
59.In calculation view, What is the option 'Auto Map by Name' used for?
It automatically creates the input parameters corresponding to the source and perform a 1:1
mapping.
60.What are the options available in Source input parameter?
Create New Map 1:1
Map by Name
Remove Mapping
61.Consider there are two tables (Actual sales and Planned sales) with similar structures. I want to
see the combined data in a single view but at the same time how can I differentiate the data between
these two tables
Create a union view (Graphical) between the two tables and have a 'Constant column' indicating
constant values like 'A' for Actual sales and 'P' for Planned sales. The default value for the constant
column is NULL.
62.What is a Constant column and how to create it?
In a Union view, a Constant column is created for the output attributes for which there is no mapping
to the source attributes. To create Constant column:
Right click the attribute in the target list
Choose Manage Mappings
To map the source to the target column, select the required source from the dropdown list
To assign a default value to the constant column, enter a value in the Constant value field
Select the required data type, length and scale as required
Click ok.

63.What is the difference between HANA Variable and Input parameter?
HANA Variables do not impact the execution and used to filter the attributes, for example we can
filter a result to a specific country or product and are applied in the WHERE clause of the SQL
query.
HANA Input parameters used to manipulate the execution of the information model, for example
currency codes or dates when exchange rates have to be calculated and are passed as
PLACEHOLDER in the FROM clause of the SQL query.
64.In which configuration table you can find the variables information?
You can find in _SYS_BI schema
BIMC_VARIABLE BIMC_VARIABLE_ASSIGNMENT
BIMC_VARIABLE_VIEW BIMC_VARIABLE_VALUE

65.What are the different types of Input parameters supported?
Attribute value/Column
Currency (Available in Calculation view only)
Date (Available in Calculation view only)
Static list
Derived from Table (Available in Analytic and Graphical Calculation view)
Empty
Direct Type (Available in Analytic view)
66.How can you check whether an input parameter is mandatory or not?
From the properties of Input parameter in the Properties pane.
67.What is Hierarchy?
We create hierarchies between attributes to improve analysis by displaying attributes according to
their defined relationships. There are two types of hierarchies:
Level Hierarchy: The root and child nodes are accessed only in the defined order. It consists of one
or more levels of aggregation.
Example: We can drill down from Country to State and to City etc.
Parent/Child Hierarchy: This hierarchy contains a parent attribute and constructed from a single
parent attribute.
Example: Employee master (employee and manager).
68.How to create an hierarchy for Analytic view?
Hierarchy is not supported in Analytic view but can be used only in Attribute view and Calculation
view.
69.While creating hierarchy, what does the option 'Aggregate All Nodes' mean?
For example there is a member A with value 100, A1 with value 10, A2 with value 20 where A1 and
A2 are children of A. By default the option 'Aggregate All Nodes' is set to false and you will see a
value of 30 for A. When this option is set to true, you will count the posted value 100 for A as well

and see a result of 130.
70.How can you generate a Sales report for a region in a particular currency where you have the
sales data in a database table in a different currency?
Create an Analytic view by selecting the table column containing the sales data and currency and
perform currency conversion. Once the view is activated, we can use it to generate reports.
71.What are the factors that affect currency conversion?
Currency conversion is performed based on source currency, target currency, exchange rate, and
date of conversion. You can select currency from the attribute data used in the view. Currency
conversion is enabled for Analytic view and Calculation views.
72.What is the prerequisite for doing the currency conversion?
You need to import tables TCURC, TCURF, TCURN, TCURR, TCURT, TCURV, TCURW & TCURX.
73.What is the prerequisite for Unit of Measure?
You need to import the tables T006 & T006A.
74.What happens when you activate an object?
The object is exposed to repository and for analysis.
75.What is the difference between Activate and Redeploy?
Activate – It deploys the inactive objects.
Redeploy – It deploys the active objects. You do this when run-time object is corrupted or deleted
and you want to create it again. OR when the object goes through client-level activation and serverlevel activation but fails at MDX, and the object status is still active.
76.What are the supported activation modes?
Activate and Ignore the inconsistencies in impacted objects
Stop activation in case of inconsistencies in impacted objects.
Irrespective of the activation mode, if even one of the selected objects fails (either during validation
or during activation), the complete activation job fails and none of the selected objects will be
activated.

77.Can you explain the behavior of activation job?
The status of the activation job indicates whether the activation of the objects is successful or failed.
In case of failure (status is completed with errors) the process is rolled back and none of the objects
are activated
In the summary part the job log shows success, even in the case of failure. This is to help the user to
indicate that those objects were successfully activated without any issues.
When you open the job log, the summary list only shows those objects that are submitted for
activation. It does not list all the affected objects. They are listed in detail section.
78.What is a Decision table?

It creates related business rules in a tabular format for automating the decisions. It helps in
managing business rules, data validation, data quality rules without any language knowledge. The
active version of the decision table can be used in applications.
You create decision table in a package just like any attribute view. You can create from scratch or
from an existing decision table.
79.Where to see the detailed report of the decision table?
In the 'Job Log' section you can see the validation status and detailed report of the decision table.
80.How to execute the decision table?
The decision table is executed by calling the procedure.
CALL “<schema name>”.”<procedure name>”;
CALL “<schema name>”.”<procedure name>”(<IN parameter>, …... , <IN parameter>, ?);
for Condition as parameters and Action as parameters.
On execution of the procedure, if no parameters are used then physical table is updated based on
the data you enter in the form of condition values and action values.
81.Are there any restrictions on Decision table to preview the data?
Data preview is supported only if:
Decision table is based on physical table and has at-least one parameter as action
Decision table is based on Information view and parameter(s) as action.
82.How can you change the layout of a decision table?
You can change the layout by arranging the condition and action columns. By default all the
conditions appear as vertical columns in the decision table and you can mark a condition as a
horizontal condition under the Decision table editor, choose 'Change Layout'.
83.Can you switch ownership of objects?
We can take the ownership of objects from other user's workspace only if it is inactive version of the
object Authorization required is “Work in Foreign Workspace”. The active version is owned by the
user who created and activated the object.
84.What is the difference between Switch Ownership and Take Over?
Switch Ownership: To take multiple inactive objects from other users.
Take Over: To take single inactive object from another workspace.
85.You are working on a inactive version of a object. How can you view changes made to the active
version?
Select the required object in a package you are working
From the context menu, choose 'open'
In the editor pane, choose 'Show Active Version'
Compare the active and inactive versions of the object.

86.How can you view the version history of content objects?
Select the required object from the package
From the context menu choose 'History'.
87.What is Refactoring Object?
Restructuring the Content objects without changing their behavior is call Refactoring.
88.What are the objects eligible for Refactoring?
Packages, Attribute views, Analytic views, Graphical Calculation views, and Analytical Privileges.
89.How do you validate models?
Quick launch menu → Validate
From the 'Available' list, select the required models that system must validate.
Choose Add
Click Validate.
90.How do you generate the documentation for the objects you created?
By using 'Auto Documentation' which captures the details of an information model or a package in a
single document. Process to create is:
Quick Launch → Auto Documentation
In 'Select Content Type' choose 'Model Details' OR 'Model List'
Add the required objects to the Target list
Browse the location where you want to save the file
Click finish.
91.How to identify whether an information model is referenced by any other information model?
We can check the model references by using 'Where Used'. Process is:
Go to the package
Select the required object
From the context menu, choose 'Where Used'.
92.What is the difference among Raw Data, Distinct values and Analysis while doing the Data
Preview?
Raw Data : It displays all attributes along with data in tabular format.
Distinct Values: It displays all attributes along with data in graphical format.
Analysis : It displays all attributes and measures in graphical format.
93.What are the different types of functions can be used in expressions?
Conversion, String, Mathematical, Date and Misc functions.
if(”SCORE” > 7, “SELECTED”, IF(”SCORE” > 4, “ONHOLD”, “REJECTED”));
returns REJECTED if the SCORE is <= 4.
case(“CODE”,1,'NEW',2,'VENDOR REBUILT',3,'SHOP REBUILT','INVALID');
if the value of CODE is other than 1/2/3 then a default value of 'INVALID' will be selected.

94.How to search Tables, Models, and Column views?
In the Modeler search field, enter the object you want
Select the system in dropdown
Click search.
The matching objects are listed in results pane with 3 tab pages: Tables, Models, and Column views.
95.Is it possible to Import SAP Netweaver BW objects?
Yes it is possible to import SAP BW objects.
96.How to Import BW models?
The process to Import BW models:
File menu → Import
Expand SAP HANA Content node, choose 'Import SAP NetWeaver BW Models'
In 'Source System' enter BW credentials
Select the target system
Select BW InfoProviders
If you want to import selected models along with display atributes for IMO Cube and IMO DSO,
select 'Include Display Attributes'
We can select analysis authorizations associated with InfoProviders/Role based.
Click finish.

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close