Abaphana Iq
Abaphana Iq
Abaphana Iq
Choosing table as Row Store is not as restrict as If you see there is large amount of data and
column having 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
values(distinct) table)
Not applying any aggregation on table. Always selecting FEW columns in your programs
out of so many columns in table.
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
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
Page |2
When you release a transport from your dev. System a code inspector check is
executed automatically.
Prio 1, 2, 3
Q. What are the Guidelines to be followed for SQL performance on ABAP on HANA?
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
Page |4
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
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
Page |6
Ans. It is used to create a Table in ABAP by specifying symbol #
Ex:
struct2 = CORRESPONDING #( struct1 ).
itab = VALUE #( ( 1 ) ( 2 ) ( 3 ) ).
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 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. 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.
Right Outer This join type returns all rows from the right table, and the matched rows
from the left
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
Page |9
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.
Referential This 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 Join This join type is used to obtain language-specific data from the text
tables using a language column.
Full Outer Joins This 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.
Text Join A join between master table and its text table with language key
Temporal Join join for timeframe – also known as Equi-join. BETWEEN condition in
select query. ** applicable only on Analytical Views
Star join Its only used in calculation views, it is used to combine multiple fact table
directly.
Spatial Join used to join coordinates table
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 10
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
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 11
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 ADBC?
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 12
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)
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 13
Allows developer to write performance-intensive logic inside database. One of the technique used in
code-to-data paradigm.
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.
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 15
Ans.
Q. 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;
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 16
: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 (;)
BEGIN
….
END;
LANGUAGE SQLSCRIPT/R
DEFAULT SCHEMA <schema> READS SQL DATA
WITH ENCRYPTION AS
BEGIN
----code
END;
CALL <procname>(params);
IF <cond> THEN
…..
ELSE IF <cond> THEN
….
END IF;
Loops – iteration
1. While Loop
While <condition> DO
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 17
END WHILE;
BREAK;
2. For loop
FOR i IN startIndex..EndIndex DO
….
END FOR;
…..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;
Q. 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
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 19
Q. What are disadvantages of using ADBC to CALL PROCEDURE?
Complex coding using SQL interface
No syntax check at design time.
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 20
Advantages:
- Syntax check
- Lifecycle management is completely controlled by ABAP system.
Disadvantage:
- Client handling
- Locking and LUW
Extensions Yes No
Q. From semantic point of view of S/4 HANA what are the categories of CDS views?
Ans.
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 22
Ans. It represents join where the two columns are used in join where one of the column is a
Projection. To make it available in the Data Preview, it has to be exposed to the DB. In S/4 HANA the
association is indicated with a name starting underscore. Eg. _Supplier, _BusinessPartner etc.
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 23
https://www.microsoft.com/en-us/download/details.aspx?id=40784
3. login to sap cc -
access via https://localhost:8443/
user: Administrator/manage
4. add cloud sub account, hcp user password
expose resources
user linux exernal ip with port 50000 protocol http
5. Create handshake between OP and HCC
6. create destination
no authentication, on premise
client, webideenabled, system, usage
Q. 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:
http://onlinefioritrainings.com
Prepared by : Charu Borkar charusb@gmail.com
SAP UI5, Fiori, ABAP on HANA Consultant, Australia
Referenced from Training delivered by Anubhav Oberoy (anubhav.abap@gmail.com) on ABAP on HANA
P a g e | 25