SAP ABAP on Hana Interview Questions

Hello dear learners if you are looking for SAP ABAP on Hana Interview Questions | SAP ABAP on HANA Questions with Answers | SAP ABAP on HANA Most Asked Questions

Q. What is SAP HANA?

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
2 n – 2
Software Innovation
· Column Store v/s Row Store
· Table Partitioning
· High Compression of data
· Parallel Processing

Q. What is the difference between Row Storage and Column Storage?

Row StoreColumn Store
Choosing table as Row Store is not as restrict as
column
If you see there is large amount of data and
having non-unique
(Repeating e.g. Material group, Material Clas.. In
MARA)
If there is a data set where you have unique
values(distinct
Aggregation of data is required (sales order
table)
Not applying any aggregation on table.Always selecting FEW columns in your programs
out of so many columns in table.
No Aggregation like org data, configuration
SELECTING all column all time.

Q. What is a Schema in SAP HANA?

Ans. A Schema is a dedicated area of database which can be used to store database objects like
table, packages, folders, procedures.
It provides a namespace for systems which connects to Database.

Q. 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 )

Q. Benefits of SAP NW 7.5?

Ans.

  1. Transparent Optimization
    a. SELECT QUERY : NetWeaver creates a query plan : Plan based Optimizer & Cost
    Based Optimizer , which decides the order/sequence in which query will be
    processed.
    b. Allows more complex joins
    c. Open SQL Enhancement
    d. Extended the static code check and SQL performance analysis
    e. Fast Data Access, Optimized data access
  2. Reuse Components, ALV ,Fuzzy Search
  3. Extension to open SQL
  4. Features specific to HANA related artifacts
  5. Standard programming guidelines by SAP
  6. ABAP/ Fiori Applications

Q. Points to be considered when Migrating to HANA?

  1. Native SQL statements will not work – it will result into Runtime error – Dumps
    EXEC SQL.
    -Native Queries
    SELECT ROWNUM, MATNR FROM SAPECC6.MARA;
    ENDSQL.
  2. If you have some indication to Database – not showstopper.
    Db hits: ‘%_HINTS MSSQLNT ‘&prefer_join&’
  3. 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.
  4. 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

What are the Guidelines to be followed for SQL performance on ABAP on HANA?

Q. What are different categories of Database Statements?

Ans. Database statements categories:
· 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, R

ollback
· DCL – DATA Control Language – Security and access of data
GRANT, REVOKE ….

Q. What is Normalization in ABAP on HANA?

Ans. Normalization concept means to reduce the redundancy of data.

Q. What is ABAP Test Cockpit in ABAP on HANA?

Ans. Code inspector/ATC checks are static code findings against guidelines. These findings won’t help
you to prioritize your list of improvements. You need real-time performance data to find which is the
first program to fix.

Q. How to do performance testing in PRD system? What are pre-requisites?

Ans. With SAP Netweaver 7.5 SP05 you can do performance trace in PRD system without much
overhead, in two steps: 1st: Administor the SQLM ( tcode) – start and stop the trace. 2nd: Data:
SQLMD ( tcode ) in the order of the potentially expensive statement.
In order to find performance trace priority list : use tcode : SWLT ( SQL Performance tuning worklist )

Q. Class to calculate runtime in ABAP on HANA?

Ans: CL_ABAP_RUNTIME

Q. How to specify client field in Native Query?

Ans: Using SELECT DISTINCT / CLIENT SPECIFIED / USING CLIENT

Q. Tcode for EPM scenario?

Ans: SEPM_DG – Data Generator

Q. What are different Code-pushdown techniques?

Ans:

  1. SQL Queries _ imperative and declarative logic (use literals, arithmetic, logical expression
    inside the queries and using expressions like CEIL, FLOOR, ABS, TRUNC, FRAC can be part of
    Open SQL statements ),
  2. CDS Views,
  3. AMDP : ABAP Managed Data Procedures,
  4. Information Models and consuming those in ABAP using proxy object techniques

Q. What are Entry points?

Ans: Different ways in which an SQL query is getting called are called Entry points. Eg. Program,
Background job, Function Module .. etc

Q. What does NW 7.4 SP 05/NW 7.5 SP 02 offers in ABAP?

Ans: Enhancements in ABAP and OPEN SQL:
Provides Database Abstraction: – can connect to any db, where the database abstraction
layer converts the OPEN SQL statements into Native SQL
Improvements in OPEN SQL Enhancements:

  1. Escaping of HOST Variables: eg- “:” colon , “@”
  2. Comma separated select list: SELECT col1, col2, col3 … , you have to use escape
    symbol for host variable
  3. Right outer join available
  4. Possible to provide bracketing for joins
  5. New functionality in ON condition of joins
  6. Number of tables which can participate in joins are now 50, earlier we can include
    only 9 tables in a join
  7. Maximum no of subqueries has been also increased to 50 from 9
  8. We can use USING CLIENT keyword instead of CLIENT SPECIFIED

Q. What are inline declarations in ABAP on HANA?

Ans: Inline declarations is a new way of declaring variables and field symbols at operand positions.
EXAMPLES:
Before 7.40
DATA text TYPE string.
text = .
With 7.40
DATA(text) = .
Declaration of table work areas
Before 7.40
DATA wa like LINE OF itab.
LOOP AT itab INTO wa.

ENDLOOP.
With 7.40
LOOP AT itab INTO DATA(wa).


ENDLOOP.
Declaration of a helper variable
Before 7.40
DATA cnt TYPE i.
FIND … IN … MATCH COUNT cnt.
With 7.40
FIND … IN … MATCH COUNT DATA(cnt).
Declaration of a result
Before 7.40
DATA xml TYPE xstring.
CALL TRANSFORMATION … RESULT XML xml.
With 7.40
CALL TRANSFORMATION … RESULT XML DATA(xml).
Declaration of actual parameters
Before 7.40
DATA a1 TYPE …
DATA a2 TYPE …

oref->meth( IMPORTING p1 = a1
IMPORTING p2 = a2

… )
With 7.40
oref->meth( IMPORTING p1 = DATA(a1)
IMPORTING p2 = DATA(a2)
… ).
Declaration of reference variables for factory methods
Before 7.40
DATA ixml TYPE REF TO if_ixml.
DATA stream_factory TYPE REF TO
if_ixml_stream_factory.
DATA document TYPE REF TO if_ixml_document.
ixml = cl_ixml=>create( ).
stream_factory = ixml->create_stream_factory( ).
document = ixml->create_document( ).
With 7.40
DATA(ixml) = cl_ixml=>create( ).
DATA(stream_factory) = ixml->create_stream_factory(
).
DATA(document) = ixml->create_document( ).
Field Symbols
For field symbols there is the new declaration operator FIELD-SYMBOL(…)
that you can use at exactly three declaration positions.
ASSIGN … TO FIELD-SYMBOL().
LOOP AT itab ASSIGNING FIELD-SYMBOL().

ENDLOOP.
READ TABLE itab ASSIGNING FIELD-SYMBOL() …
TYPES t_itab TYPE TABLE OF i WITH EMPTY KEY.

DATA(itab) = VALUE t_itab( ( 1 ) ( 2 ) ( 3 ) ).

Q. When do you use “GROUPBY” clause in HANA SQL statements?

Ans: while using aggregate functions in a SELECT QUERY, all the columns that do not belong to
aggregate-functions should be put in GROUP BY Clause.

Q. What is the significance of “HAVING” clause in SQL statement?

Ans: In order to apply further filter for the aggregation function, HAVING clause can be used in the
SELECT statement which is used with GROUPBY clause being mandatory. Eg. It is like applying where
condition on the aggregated column.
When an aggregation is used with CASE statement, it has to be mentioned in the GROUPBY clause

Q. What is the symbol to do “concatenation” operation in NW ABAP 7.4 ?

Ans. Pipe Symbol – |

Q. What is constructor expression in NW ABAP 7.4?

Ans. It is used to create a Table in ABAP by specifying symbol #
Ex:
struct2 = CORRESPONDING #( struct1 ).
itab = VALUE #( ( 1 ) ( 2 ) ( 3 ) ).

Q. What is the transaction code to check Schema name?

Ans. DBACOCKPIT

Q. Can multiple ABAP systems connect to ABAP Database?

Ans. Yes. HANA 1.0 SP09 onwards

Q. What is a Catalog in SAP HANA?

Ans. A Catalog is collection of Database Schemas in HANA. Schema: grouping of all database objects,
Schema is a mandatory database object allows companies to use same database keeping data from
multiple system where DCL and DB constraints can be managed at schema level

Q. What is difference between SAP User and DB user?

Ans. Schema user , i.e the database user is used to access the data with certain authorization levels.

Q. What is Information Model and why is it required?

Ans. Information Model: main purpose is to hide the technicalities to select data and make it easier
for business users to model their data which can be pulled w/o technical knowledge just db
functional knowledge is sufficient.
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.

Q. What are different types of views in HANA?

Ans. 1. Attribute view
2. Analytic view
3. Calculation View
4. Decision Table
For the purpose of taking business informed decisions and they run on top of HANA DB doing code-
pushdown or functional pushdown to the DB layer

Q. What is the function of SQL optimizer?

Ans. SQL optimizer function is to process and optimize the SQL queries submitted to HANA and
finally executed by the SQL engine in SAP HANA

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

Q. Processing of models in the engine?

Q. What are different techniques of creating a Calculation view?

Ans. Graphical Editor and SQL Script Editor

Q. What is a Star Schema in ABAP on HANA?

Ans. When we combine data of dimension (master) with measure (transaction), it becomes Star
Schema. And to join two or more Star Schemas, it is done by Calculation View.

Q. What is the limitation of Analytical view?

Ans. This view can have only one measure. It cannot have multiple measure. Basically one fact table
in an Analytical view. Ideally only one Fact Table should only be used with Analytical view since Fact
Table requires an aggregate.

Q. what are steps to create an Attribute view?

Ans. Steps to create an attribute view in HANA Studio since graphical representation is not available
in ABAP on Eclipse:

  1. Name and description of attribute view
  2. Table and Join
  3. Hierarchies, Transformation, restricted and calculated columns
  4. Save and Activate
  5. Data Preview

Q. what is the limitation of an Attribute view?

Ans. Attribute view cannot be used with aggregate functions.

Q. What is Content in SAP HANA?

Ans. Content is collection of development packages where we add different development objects
including Information Models: which are HANA specific data type.

Q. What is a Package in SAP HANA?

Ans. It provides a name space for your development object. Once an information model is activated,
it creates a view in the HANA DB and it is stored inside the schema.
Eg. :: à schema
It allows you to transport all logically related development objects. Grouping development artefacts
together known as Delivery Unit.

Q. Why Fact Table should not be added in an Attribute View?

Ans. It is recommended to use an Attribute View with only Master Table because of performance
criteria. It is advisable that Fact/Transaction Table used with Analytical view, and not be used with
Attribute view due to performance implication since Attribute View is processed in the join Engine of
SAP HANA, it is not processed by OLAP Engine which is equipped to do aggregation.
Statement: To expose a View/Model to the user, you create a select query on top of your view and
create an OData on your query and create a fiori app to expose it to the user…sap.viz OR use ALV
grid

Q. What is View Proxy in ABAP?

Ans. View Proxy is used to pull the data from a view in ABAP. To expose a Data Model to the
application layer ( ABAP Layer ), SAP NW7.4 SP02 onwards, provides a feature called View Proxy
which allows SAP HANA data models to communicate with the ABAP Layer using ADT in eclipse and
lock the objects in a Delivery unit to transport the objects.

Q. What is Hierarchy?

And. Hierarchy is used to realize data based on relation of data characteristics.
Click on Semantics -> Hierarchy Tab ->
Two types of hierarchy
Ø 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.

Q. What are different types of JOINS in SAP HANA?

InnerThis join type returns all rows when there is at least one match in both
the database tables. In short. join between 2 tables must fulfill the join
criteria
Left OuterThis join type returns all rows from the left table, and the matched rows
from the right table.
Right OuterThis join type returns all rows from the right table, and the matched rows
from the left Joins the tables as like inner join, additionaly it will include the record of
the table in-direction for which no corresponding records available in
transaction table.
ReferentialThis join type is similar to inner join type, but assumes referential
integrity is maintained for the join tables.
Its smart inner join.
If we have 2 tables connected via ref. join and a query is written on
Attr. View and do not include the join column or the column on master
check table. Essentially you are just selecting data from main table, The
join will be “pruned” (exclude – don’t care). When you also apply an
filter on data model, the ref. join also acts like inner join
Text JoinThis join type is used to obtain language-specific data from the text
tables using a language column.
Full Outer JoinsThis join type displays results from both left and right outer joins and
returns all (matched or unmatched) rows from the tables on both sides
of the join clause.
Temporal Joinjoin for timeframe – also known as Equi-join. BETWEEN condition in
select query. ** applicable only on Analytical Views
Star joinIts only used in calculation views, it is used to combine multiple fact table
directly.
Spatial Joinused to join coordinates table

Q. What is an Analytical View?

Ans. When a Fact table to be connected to multiple dimensions, we use analytical view. The
Analytical views are built to perform complex Aggregations( SUM, MIN, MAX, AVG, COUNT ) on
measure. These views are processed by OLAP engine in SAP HANA. They are used to build so called
STAR schema. Also has capabilities to define calculated columns, restricted columns, filters, import
parameters, complex conversions.
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.

Q. How do you achieve currency conversion in Analytical view?

Ans. Use calculated columns and define the semantics.

Q. What are components of a View Scenario?

Q. What is a Calculation View?

Ans. To include multiple facts as part of data model, we can go for calculation view, these views are
processed by Calculation Engine in SAP HANA. They are suitable for more complex calculation. CVs
can be created in two ways: Graphical and SQL Script ( to achieve parallelization). SQL scripting in
Calculation view can be implemented in two ways: CE functions ( to get better performance ) or pure
SQL

Q. Define Calculation Engine Architecture?

Q. What are CE functions?

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 :
· projection (selection of some columns)
· Joins (connect two data object)
· Selection ( where clause )
· Join with a Fact Table
· Selection of data from column table
· 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.

Q. What are the cases when can you use different views for different requirements?

Q. What is an alternate to View proxy?

Ans. Alternate to View Proxy is CDS view due to synchronization of transport objects.

Q. What is ADBC?

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.
ADBC can be used when:

  1. Your system does not have ABAP ADT available, you cannot create proxy object.
  2. When HANA DB running as Secondary DB (Side Car Scenario)

Leave a Comment