ABAP On HANA Interview Questions
ABAP On HANA Interview Questions
ABAP On HANA Interview Questions
Ans. HANA is defined as High Performance Analytical Appliance, a full transactional RDBMS system
given by SAP consisting of IMCE ( In-Memory Computing Engine ) which combine row based and
column based architecture. It is capable of doing both OLTP and OLAP in a single box which includes
both Hardware and Software Innovations. It is also knows as Hybrid Database System.
Hardware innovation
Reduction in memory and Chip (CPU) price
Multi core Processors
Operating systems are now available with high bit size 64 bit
8084 16 bit Address Bus
2n - 2
Software Innovation
Column Store v/s Row Store
Table Partitioning
High Compression of data
Parallel Processing
Q2. What is the difference between Row Storage and Column Storage?
Row Store Column Store
Choosing table as Row Store is not as restrict as If you see there is large amount of data and having
column non-unique
(Repeating e.g. Material group, Material Clas.. In
MARA)
If there is a data set where you have unique Aggregation of data is required (sales order table)
values(distinct)
Not applying any aggregation on table. Always selecting FEW columns in your programs
out of so many columns in table.
Q4. What are the improvements in NW 7.5 to leverage the strength of HANA?
1. Code to Data paradigm ( code-pushdown )
2. Massive Parallel Processing
3. Data Encoding
4. Columnar Store
5. Run Complex Algorithms
6. Transparent Optimization ( order in which select query will be written and executed which is
done by DB abstraction layer – converts OPEN SQL from ABAP to Native SQL which is
understood by DB )
EXEC SQL.
-Native Queries
SELECT ROWNUM, MATNR FROM SAPECC6.MARA;
ENDSQL.
1. If you have some indication to Database – not showstopper.
Db hits: ‘%_HINTS MSSQLNT ‘&prefer_join&’
1. Select orderid from table where amount < 300.
If you are doing a search based on non-pk columns in data based and you have not used
ORDER BY clause in SQL statement, it can produce problems.
1. Direct access to database cluster/pool tables
Code Inspector: SCI – Quality checks of our code
When you release a transport from your dev. System a code inspector check is executed
automatically.
Prio 1, 2, 3
Q7. What are the Guidelines to be followed for SQL performance on ABAP on HANA?
DDL – Data Definition language – Mainly used to create/change/delete new database objects.
SE11 – Data Dictionary which automatically produces the DDL statements for you.
CREATE, ALTER, DROP…
DML – Data Manipulation Language – statements which are used to manipulate data.
INSERT, UPDATE, DELETE, MODIFY
DQL – Data Query Language – SELECT statement, GET
TCL – Transaction Control Statements (ACID) - COMMIT, Rollback
DCL – DATA Control Language – Security and access of data
GRANT, REVOKE ….
6. Number of tables which can participate in joins are now 50, earlier we can include only 9 tables
in a join
An information model: ( purpose was to hide the complexity and to overcome some setbacks with the
queries )
Used to convert linear structure to a multi dimension structure w/o knowing technical language.
Are Process of converting source data (in tables) into business understandable format.
They also make use of Hardware advancements in HANA.
If we define information models inside HANA DB, We can also reduce the data transfer b/w DB
and App layer.
Complex logic as well as transformation executed in DB layer.
Q30. What are the other three engines which are part of SAP HANA?
Ans. Calculation Engine: index-server architecture: procedural logic
Join Engine: regular SQL using joins
OLAP Engine: aggregation
5. Data Preview
Level based hierarchy – Relation between master data w.r.t. groups, these groups can come from
multiple tables.
Parent-child hierarch – the relation works as self-relation. In this the table has a relation with
itself and mark one of the column as parent and another a child. E.g. manager employee
relation.
Right Outer This join type returns all rows from the right table,
and the matched rows from the left
Text Join A join between master table and its text table with
language key
It is important that In an analytical view, we must mark attributes and measures at the end in semantic.
Because an aggregation will be applied only on measure.
Ans. SAP HANA Provides ready-made functions which are implemented inside Calculations engine and
executed with in the engine with enhanced performance for common tasks like :
Unions
Aggregations
CE_*
St. In case of CE functions the call/execution remains in the CE engine, where as in case of SQL Scripts,
it has to go outside of the Caln Engine to SQL Script Optimizer to execute the function leading to a drop
in performance.
Q49. What are the cases when can you use different views for different requirements?
Ans. Alternate to View Proxy is CDS view due to synchronization of transport objects.
Ans. ADBC stands for ABAP Database Connectivity. It is used to run HANA related queries directly
using ABAP code. ADBC APIs are available since NW 7.4 to call the queries using simplified interface.
1. Your system does not have ABAP ADT available, you cannot create proxy object.
Ans. A Decision Table is used for planning scenarios, that allows business users to model business rules
with less/no technical knowhow and apply the rules to see the results with read data.
2 types of DT
1. Decision table with update value: We can update the data of a specific column in SAP HANA by
defining business rule.
2. Decision table with Return Value: In this we have the result as an additional updated column.
(preferred for use business cases: not changing the actual data in the DB)
Ans. Programming language are independent products, they generate their own executables. Code is
compiled by programming language and converted to machine code / OS code.
Scripting languages are embedded on programming language. They rely on the APIs of
programming language.
Allows developer to write performance-intensive logic inside database. One of the technique used in
code-to-data paradigm.
Q60. On what all instances SAP HANA comes out of Parallelization mode?
Ans. Instances when HANA comes out of parallel mode:
SQL Script is executed and processed in the calculation engine within the HANA database.
In SQL Script, a local variable can be declared to hold the interim result.
SQL Script Procedure can return more result by using "OUTPUT Parameter" while Normal SQL
Procedure can return only one.
In SQL Script, you can define global or local tables types which can be used as parameters.
Q63. What are different Data Types in SAP HANA?
Ans. Different Data Types that are called Primitive Data Types in HANA are:
Q66. What is the difference between PROCEDURES and USER DEFINED FUNCTIONS in
HANA?
Ans.
When we want to use a variable in SQL script, we use symbol colon (:) to refer the variable. E.g.
Declare x integer;
:x should be used to refer value of x.
When we want to assign value to x, we don’t use colon (:) x
SQL script is case-insensitive
Every SQL script statement must end with semi-colon (;)
Q68. Syntax to declare Scalar Variable?
Ans. DECLARE <vname> <vtype> = <default_value>;
BEGIN
….
END;
LANGUAGE SQLSCRIPT/R
DEFAULT SCHEMA <schema> READS SQL DATA
WITH ENCRYPTION AS
BEGIN
----code
END;
CALL <procname>(params);
Q73. What are different syntaxes in SQL script for different functionalities?
Ans. If condition
IF <cond> THEN
…..
ELSE IF <cond> THEN
….
END IF;
Loops – iteration
1. While Loop
While <condition> DO
END WHILE;
BREAK;
2. For loop
FOR i IN startIndex..EndIndex DO
….
END FOR;
Q74. What does “READ SQL DATA” do?
Ans. It tells the system to enter into Parallelization mode.
…..code…
…...code…
CATCH ex_class INTO lx_obj.
…
ENDTRY.
Syntax:
DECLARE EXIT HANDLER FOR
1. SQLEXCEPTION –generic exception case
2. SQL_ERROR_CODE <codeno>
---code
END;
Q84. Things to consider while working with SQL Script Procedures for CODE Pushdown?
Ans.
1. Consider client handling while applying any aggregation on data
2. Since there is no explicit functionality of LUW concept in HANA, it has to be taken care while
using SQL scripting
3. There is no implicit locking mechanism, it has to be taken care while working with SQL scripting
on DB
Q98. What is the difference between CDS views and Traditional views?
Parameters CDS Views Traditional Views
Code-push down Yes No
Complexity Easy Not Easy
Outer Join Yes No
Complex Expressions, Logic Yes No
Analytical Adaption Yes (analytical annotation) No
OData Support Direct from NW 7.5 No
Types Yes Yes
Metadata model Yes No
Extensions Yes No
Built-in function UNIONS Yes No
Parameters/ Ready to use system Yes No
variables
Q100. From semantic point of view of S/4 HANA what are the categories of CDS views?
Ans.
Q104. How to create an ALV report in SAP HANA using CDS view?
Ans. SAP NW 7.4 onwards ABAP list viewer comes with an IDA ( Integrated Data Access )
Advantage of Using ALV with IDA:
Only Selected Columns will be fetched from the DB
it is possible for tables that contain very large quantities of data to be displayed on the UI which
is called Pagination and
Automatic Query (No need to write a SELECT Statement, since the IDA framework prepares the
Query, sends it to the DB, pulls the data and displays it in the ALV. Only Data Source
Name needs to be provided to the IDA f/w, this data source can be a CDS View, which
leverages the strength of CDS like code pushdown and performance). The results of
operations such as sorting, grouping, or filtering are also delivered with a very fast
response time.
CLASS NAME: CL_SALV_GUI_TABLE_IDA=>CREATE_FOR_CDS_VIEW().
Q111. How can you secure your Data Access using CDS view?
Ans. Right click -> Core Data Services Folder -> Create Access Control -> mention the PFCG Role
Name
Result: