SAP ABAP on Hana Multiple choice questions

Hello friends if you are looking for SAP ABAP on Hana Interview Questions | SAP ABAP on Hana Multiple Choice Questions with answers | SAP ABAP on Hana Question Answers | SAP ABAP on Hana Frequently Asked Questions then here you will get all the answers for your questions

Q. What is a Decision Table?

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)
    Once a decision table is activated, it creates a stored procedure in the DB

Q. What is BRMS System?

Ans. A Business Rule Management system manages set of rules which are frequently changing in
the business

Q. Syntax to call a PROCEDURE in HANA?

Ans. CALL “”(?)

Q. What is the difference between Procedural (Scripting ) Vs Programming Language?

Ans. Programming language are independent products, they generate their own executables.
Code is compiled by programming language and converted to machine code / OS code.
Eg: Compile a .java file it create a .class
Scripting languages are embedded on programming language. They rely on the APIs of
programming language.

In SAP HANA, we have SQL scripting which is a Procedural Language.

Q. What are the disadvantages of using Views?

Ans.
· Cannot debug a views
· Decomposing complex business logic, Intermediate results from the views cannot be
store.
· No possibility to express business logic – if, else, case, looping
· SQL queries can only return one value and has no chaining.
· Imperative logic.

Q. What is SQL Script in HANA?

Ans. SQL script is a collection of extension to SQL (DML, DDL, DQL, DCL)

Allows developer to write performance-intensive logic inside database. One of the technique used in
code-to-data paradigm.

Q. How does the system process SQL script?

Q. What are different type of Statements in SQL Logic?

Q. On what all instances SAP HANA comes out of Parallelization mode?

Ans. Instances when HANA comes out of parallel mode:
“Select Statements” are executed in SAP HANA in parallel unless:
· Local scalar parameters and variables are used in containers (procedure).
· Read/write procedure or DDL/DML statements are execute (eg: CREATE,
INSERT,UPDATE,MODIFY).
· Imperative Logic is used (IF, CASE, LOOP)

· SQL statements which are not assigned to variable. ( Eg: Lt_Anubhav = select * from
snwd_pd where price > 1000; –Query 1 )

Q. What are different types of SQL Scripts?

Q. What are advantages of SQL script?

· SQL Script is executed and processed in the calculation engine within the HANA database.
· SQL Script is able to perform complex calculations.
· 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.

Q. What are different Data Types in SAP HANA?

Ans. Different Data Types that are called Primitive Data Types in HANA are:
· Numeric : TINYINT, SMALLINT, INT, BIGINT, DECIMAL, SMALL-DECIMAL, DOUBLE
· Characters: VARCHAR, NVARCHAR, ALPHANUM
· Data/time : TIMESTAMP, DATETIME
· Binary type: VARBINARY
· Large obj: CLOB, BLOB, NLOB

Q. What are Containers in SAP HANA?

Ans. Containers are the blocks in which we write the Imperative or Declarative logic.

Q. What are different types of Blocks ( Containers ) in SAP HANA?

Q. What is the difference between PROCEDURES and USER DEFINED FUNCTIONS in HANA?

Q. How do you declare variables in SQL script?

Ans. When we declare variable in SAP HANA SQL Script ( Scalar Parameters ), These variables are
initialized with NULL value. We can explicitly assign value during creation also.
When we want to use a variable in SQL script, we use symbol colon (:) to refer the variable.
E.g.
Declare x integer;

😡 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 (;)

Q. Syntax to declare Scalar Variable?

Ans. DECLARE = ;

Q. Syntax to Declare an Anonymous Block?

Ans. DO (in pname ptype => ?, out pname ptype => ?)
BEGIN
….
END;

Q. What is advantage of procedure over anonymous block?

· Procedure are pre-compiled containers with name.
· We can call procedure from another procedure.

Q. Syntax to create a Procedure and Call a Procedure?

Ans. CREATE PROCEDURE (in pname ptype, out pname ptype, inout pname ptype)
LANGUAGE SQLSCRIPT/R
DEFAULT SCHEMA READS SQL DATA
WITH ENCRYPTION AS
BEGIN
—-code
END;
CALL (params);

Q. What does DROP PROCEDURE in SQL do?

Ans. Whenever a New Procedure is created, in order to re-create or replace the existing procedure,
it needs to be dropped first. Syntax to Drop Procedure:
DROP PROCEDURE .

Q. What are different syntaxes in SQL script for different functionalities?

Ans. If condition
IF THEN
…..
ELSE IF THEN
….
END IF;
Loops – iteration

  1. While Loop
    While DO

END WHILE;
BREAK;

  1. For loop
    FOR i IN startIndex..EndIndex DO
    ….
    END FOR;

Q. What does “READ SQL DATA” do?

Ans. It tells the system to enter into Parallelization mode.

Q. How to define EXCEPTION in SQL?

Ans. TRY.
…..code…
……code…
CATCH ex_class INTO lx_obj.

ENDTRY.
Syntax:
DECLARE EXIT HANDLER FOR

  1. SQLEXCEPTION –generic exception case
  2. SQL_ERROR_CODE
    —code
    END;

Q. What is the range of Custom Exceptions Error Code?

Ans. 10000 ~ 19999
Syntax:
SIGNAL SQL_ERROR_CODE 10000 SET message_text = ‘xyz’;

Q. What are Cursors in HANA Database?

Ans. Whenever we want to work with multiple records in DB,

  1. Load all data records in a table parameters, manipulate using table
  2. Cursor – Process records directly from DB table Line By Line
    Cursors are used to fetch data records from table row-by-row from result of a query assigned to
    cursor. We always bind a Query to cursor. It is also possible to parameterize cursor.
    NOTE!!: If possible Avoid using Cursors in HANA DB , since HANA cannot optimize or run SQL in
    Parallel mode

Q. What steps to process a Cursor?

1. Declare a cursor and assign to query DECLARE CURSOR() FOR