Smart Logic Academy Home Blog About Us Cont act Us More Log In
Invest In Yourself
ABAP on HANA
Interview Questions and Answers
1Q: What is SAP HANA?
A: SAP HANA is an in-memory, column-orient ed, relat ional dat abase management syst em developed by SAP. It is designed t o
process large amount s of dat a in real-t ime, enabling businesses t o make fast er and more informed decisions.
2Q: What is SAP ABAP on HANA?
A: SAP ABAP on HANA is a programming language used t o develop applicat ions in t he SAP HANA dat abase environment . ABAP
on HANA provides enhanced performance and improved processing speed by leveraging t he in-memory comput ing capabilit ies
of t he HANA dat abase. It provides improved performance, real-t ime analyt ics, simplified development , and enhanced
scalabilit y.
3Q. What is difference bet ween SAP HANA and S/4 HANA?
SAP HANA is an in-memory dat abase plat form t hat enables real-t ime dat a processing and analysis. It can be used as a
st andalone dat abase plat form or as t he underlying t echnology for ot her SAP applicat ions.
SAP S/4HANA, on t he ot her hand, is a suit e of ent erprise resource planning (ERP) applicat ions t hat are built on t op of t he SAP
HANA plat form. S/4HANA is a next -generat ion business suit e t hat is designed t o help businesses run more efficient ly by
providing real-t ime insight s and st reamlined processes.
In summary, SAP HANA is a t echnology plat form, while SAP S/4HANA is an ERP suit e t hat is built on t op of t he SAP HANA
plat form.
4Q: What is t he difference bet ween t radit ional ABAP and ABAP on HANA?
A: T he main difference bet ween t radit ional ABAP and ABAP on HANA is t hat ABAP on HANA uses t he HANA dat abase
t echnology t o process dat a fast er and more efficient ly. T his means t hat ABAP on HANA applicat ions can leverage t he power
of HANA t o provide real-t ime dat a processing and analysis.
5Q: What are t he main feat ures of SAP HANA?
A:
In-memory Dat abase:
Wit h SAP HANA, you can now st ore t he complet e dat abase in memory. T his means t hat disk movement is not needed and
swapping can be eliminat ed. Hence increase in t he speed of read-writ e access.
Mult icore CPU and parallel processing:
To get t he best performance from new advanced hardware, SAP HANA makes use of parallelism by using all t he cores of a CPU,
and several CPUs. Column st ore t ables are aut omat ically processed in parallel. Even t he same column can be split up and
processed by different cores at t he same t ime.
Column and Row st orage:
SAP HANA support s bot h col and row st ore t ables By accessing dat a in column-st ore order, you benefit immensely from
simplified t able scan and dat a pre-caching. T his can make all t he difference in performance.
Wit h column st ore, SAP HANA scans columns of dat a so quickly t hat addit ional indexes are usually not required.
It is easy t o alt er column st ore t ables wit hout dropping and reloading dat a.
Column st ore t ables are opt imal for parallel processing, as each core is able t o work on a different column.
Dat a Compression:
SAP HANA uses a dict ionary per column Operat es direct ly on compressed dat a using int egers.
It reduces t he amount of memory required.
It speeds up operat ions on columns because t he columns can be loaded int o t he CPU caches fast er and wit h fewer loading
cycles.
Aggregat es and Indexes:
Using t he power of SAP HANA, you can aggregat e on t he fly from any line it em t able. You do not need prebuilt aggregat es.
SAP HANA organizes dat a using column st ores, which means t hat indexes are not needed. T hey can st ill be creat ed but offer
lit t le improvement .
6Q: What is t he in-memory dat abase?
A: St oring dat a in main memory rat her t han on disk provides fast er dat a access, fast er querying and processing.
SAP HANA uses Dynamic t iering, frequent ly accessed "hot " dat a is st ored on main memory and less frequent ly accessed "warm"
dat a is st ored on disk.
7Q: What is t he difference bet ween a t radit ional dat abase and SAP HANA?
A: T he main difference bet ween a t radit ional dat abase and SAP HANA is t hat SAP HANA is an in-memory dat abase t hat st ores
dat a in columns rat her t han rows. T his enables fast er dat a processing and real-t ime analyt ics capabilit ies.
8Q: Advant ages of column st ore over row st ore?
A: you benefit immensely from simplified t able scan and dat a pre-caching.
only t he required columns are loaded t o memory, so you avoid using up memory wit h columns t hat will never be used t he dat a is
arranged efficient ly wit h all values of a column appearing one aft er anot her. T his cont inuous sequencing of t he column values is
preferred by t he CPU.
It is easy t o alt er column st ore t ables wit hout dropping and reloading dat a.
9Q: Guidelines t o increase ABAP code performance on SAP HANA dat abase?
A:
Keep result set small.
Minimize t he number of dat a t ransfer.
Minimize number of dat abase accesses.
Minimize search overhead.
Keep unnecessary load away from dat abase.
10Q: Can we creat e secondary index in SAP HANA?
A: Yes, A secondary index in SAP HANA is an addit ional index t hat can be creat ed on a t able t o improve t he performance of
specific queries.
11Q: What are t he benefit s of dat a compression in SAP HANA?
A: T he benefit s of dat a compression in SAP HANA include:
Reduced memory and st orage requirement s
Improved query performance due t o reduced dat a volume
Lower cost s for hardware and st orage
Fast er dat a backups and rest ores.
12Q: What are t he benefit s of parallel processing in SAP HANA?
A: T he benefit s of parallel processing in SAP HANA include:
Fast er query performance due t o t he abilit y t o process t asks concurrent ly.
Improved scalabilit y for larger workloads
Abilit y t o leverage dist ribut ed comput ing resources for improved processing power.
Reduced hardware cost s compared t o t radit ional single-node archit ect ures.
13Q: What are t he benefit s of SAP HANA mult i-CPU archit ect ure?
A: SAP ABAP HANA mult i-CPU archit ect ure offers several benefit s, including increased processing power, improved dat a
processing speed, and high availabilit y. By dist ribut ing t he workload across mult iple CPUs, t he syst em can handle larger dat a
volumes and execut e complex queries fast er. Addit ionally, t he syst em can cont inue t o operat e even if one or more CPUs fail,
ensuring high availabilit y.
14Q: How is code push down implement ed in SAP ABAP HANA?
A: Code push down in SAP ABAP HANA is implement ed t hrough t he use of new ABAP language const ruct s, such as inline
declarat ions and expressions, which allow developers t o perform complex dat abase operat ions direct ly in t he dat abase layer.
Addit ionally, SAP provides t ools such as ABAP Managed Dat abase Procedures (AMDPs) and Core Dat a Services (CDS) t o help
developers implement code push down t echniques in t heir applicat ions.
15Q: What are t he benefit s of code push down in SAP ABAP HANA?
A: T he benefit s of code push down in SAP ABAP HANA include improved applicat ion performance, reduced net work t raffic and
memory usage, and improved scalabilit y. By pushing processing down t o t he dat abase layer, t he applicat ion can t ake
advant age of t he in-memory comput ing capabilit ies of t he HANA dat abase, result ing in fast er dat a access and processing.
16Q: What is SAP ADT ?
A: SAP ADT st ands for ABAP Development Tools. It is an int egrat ed development environment (IDE) used by developers t o
develop, debug, and deploy ABAP applicat ions in t he SAP syst em.
17Q: Advant ages of using ADT over ABAP workbench?
A:
18Q: How do you creat e a new ABAP project in SAP ADT ?
A: To creat e a new ABAP project in SAP ADT, follow t hese st eps:
1. Open t he SAP Development perspect ive in Eclipse.
2. Right -click on t he ABAP Development node in t he Project Explorer and select New > ABAP Project .
3. Ent er a name and descript ion for t he project , and select t he syst em and client where t he project will be creat ed.
4. Select t he package where t he project will be saved and specify any addit ional project set t ings.
5. Click Finish t o creat e t he project .
19Q: How do you debug an ABAP program in SAP ADT ?
A: To debug an ABAP program in SAP ADT, follow t hese st eps:
1. Open t he ABAP Development perspect ive in Eclipse.
2. Navigat e t o t he program you want t o debug in t he Object Navigat or.
3. Set a breakpoint in t he program by double-clicking on t he line of code where you want t o pause t he program.
4. Execut e t he program in debug mode by right -clicking on t he program and select ing Debug As > ABAP Applicat ion.
5. St ep t hrough t he program line by line using t he debug t oolbar and inspect variables and object s in t he Debug Perspect ive.
20Q: What is t he CDS view?
A: To t ake advant age of SAP HANA for applicat ion development , SAP int roduced a new dat a modeling infrast ruct ure known as
core dat a services.
CDS is an enhancement of SQL which provides a Dat a Definit ion Language (DDL) for defining semant ically rich dat abase
t ables/views (CDS ent it ies) and user-defined t ypes in t he dat abase. Some of t he enhancement s are:
Expressions used for calculat ions and queries in t he dat a model
Associat ions on a concept ual level, replacing joins wit h simple pat h expressions in queries
Annot at ions t o enrich t he dat a models wit h addit ional (domain-specific) met adat a
21Q: Explain CDS-relat ed Reposit ory Object s?
A:
Dat a Definit ion :
Also referred t o as DDL Source (for Dat a Definit ion Language, named aft er t he DDL part of SQL)
Cont ains t he definit ion of eit her a CDS View or a CDS Table funct ion
Display only in ABAP workbench
Edit ing requires t he use of t he ABAP Development Tool (ADT in Eclipse)
Access Cont rol :
Also referred t o as DCL Source (for Dat a Cont rol Language, named aft er t he DCL part of SQL)
Cont ains t he definit ion of aut horizat ion rules t hat are aut omat ically checked when a program accesses a cert ain CDS View or
CDS t able funct ion
Display only in ABAP workbench
Edit ing requires t he use of t he ABAP Development Tool (ADT in Eclipse)
22Q: What are t he advant ages of using CDS views?
A: CDS Views offer several benefit s, including:
Improved performance: CDS Views are opt imized for SAP HANA, so t hey provide fast dat a access and processing.
Reusabilit y: CDS Views can be reused across different applicat ions, reducing t he need for redundant code and dat a
models.
Simplified dat a modeling: CDS Views provide a simplified and st andardized way t o define dat a models, making it easier t o
develop and maint ain applicat ions.
Int egrat ion wit h ot her SAP t echnologies: CDS Views can be int egrat ed wit h ot her SAP t echnologies, such as SAP Fiori and
SAP BW, t o provide a seamless user experience.
23Q: Difference bet ween ABAP dict ionary view and ABAP CDS view?
A:
24Q: Difference bet ween ABAP CDS and HANA CDS?
A:
25Q: How do you define a CDS View in SAP?
A: A CDS View is defined using a DDL (Dat a Definit ion Language) st at ement in t he ABAP Development Tools (ADT ) or SAP HANA
St udio. T he st at ement defines t he view name, dat a fields, and ot her at t ribut es, such as filt ering and sort ing crit eria.
26Q: What is a CDS ext ension?
A: CDS ext ensions are used t o enhance exist ing CDS views by adding addit ional fields or annot at ions. T hey allow developers t o
modify t he behavior of CDS views wit hout having t o creat e a new view from scrat ch.
27Q: What is Associat ions? How it is different from Join?
A: An associat ion defines relat ionship ent it ies. An associat ion associat es t he current CDS view as a source dat a source wit h
t he t arget dat a source t arget using an ON condit ion.
Alt hough associat ions and joins look different , t here is no difference on t he dat abase level. Event ually, any associat ion is
t ranslat ed int o an ordinary join. But in t he case of so-called exposed associat ions, it depends on t he way a view is consumed.
T he join is only execut ed if t he consumer request s dat a from t he associat ed dat a source. T his can have a posit ive effect on
t he performance and somet imes is referred t o as “JOIN on Demand”.
Associat ions may cont ain addit ional semant ic informat ion such as cardinalit y.
28Q: What are t he t ypes of associat ions?
A:
Ad-hoc associat ion
Exposed associat ion
Filt ered associat ion.
29Q: What is Union and union all?
A: UNION joins t he result set s of t wo queries.
T he rows of t he result set of t he query aft er UNION are insert ed int o t he result set of t he query before UNION.
If t he addit ion ALL is not specified, all duplicat e ent ries are removed from t he result s set . T hey are not removed if ALL is
specified.
30Q: How CDS view and SQL view are relat ed?
A: A CDS View is defined in a DDL Source, which is a new t ype of reposit ory object .
Upon act ivat ion of a DDL Source, t wo object s are creat ed: t he SQL View and t he CDS View.
T he SQL View is visible as an object in t he ABAP Dict ionary where it cannot be edit ed and only reveals a fract ion of t he
informat ion available in t he DDL source. It serves as a represent at ive of t he dat abase object .
T he CDS View carries more semant ics t han it s SQL view. It is not creat ed on t he Dat abase and it is not visible in t he ABAP
Dict ionary. It can, however, be consumed via open SQL.
31Q: What is t he use of Annot at ion?
A: Annot at ions enrich t he CDS definit ion wit h met adat a.
It st art s wit h charact er @.
T he annot at ion specifies t he propert ies and semant ics of an ent it y and it sbehavior when it is consumed.
32Q: What is t he cardinalit y in an associat ion?
A: Cardinalit y in an associat ion represent s t he number of occurrences of an ent it y t hat can be associat ed wit h anot her ent it y.
T he possible values for cardinalit y are:
[0..1]: zero or one occurrence of t he ent it y can be associat ed wit h t he current ent it y.
[1]: exact ly one occurrence of t he ent it y can be associat ed wit h t he current ent it y.
[0..n]: zero t o many occurrences of t he ent it y can be associat ed wit h t he current ent it y.
[1..n]: one t o many occurrences of t he ent it y can be associat ed wit h t he current ent it y
33Q: What is AMDP?
A: Allows developers t o creat e and execut e dat abase procedures in an ABAP environment using ABAP met hod.
AMDP is t he t op-down approach of using HANA Dat abase Procedures in ABAP. Allow t he execut ion of complex calculat ions
inside t he HANA dat abase. AMDP only requires ABAP Applicat ion Server (AS) for developing, managing and calling dat abase
procedures.
34Q: What makes AMDP class and ABAP met hod different from normal class and met hod?
A:
AMDP class
Can cont ain bot h regular met hods and AMDP met hods.
One or more AMDP met hods can be present in AMDP class.
Can only be creat ed using ADT.
class wit h AMDPs must implement int erface IF_AMDP_MARKER_HDB
AMDP Met hods
AMDP met hods can be defined in t he public, prot ect ed, or privat e visibilit y sect ion of t he class.
Alt hough you can define AMDP met hods as inst ance met hods, t hey are always execut ed like st at ic met hods.
All AMDP met hod paramet ers have t o be passed by value, and must be of eit her t able or scalar t ypes. Pass by reference is
not permit t ed
Export ing, import ing and changing paramet ers are allowed. Ret urning paramet ers are not allowed
AMDP Met hod is specified wit h addit ion BY DATABASE PROCEDURE in t he met hod implement at ion part , followed by t he
dat abase syst em (for example, HDB) and t he implement at ion language (for example, SQLScript ).
For paramet ers of t able t ypes, t he line t ypes have t o consist of element ary component s, because nest ed t ables are not
support ed. ABAP Dict ionary st ruct ure t ypes are not allowed.
35Q: Comparision bet ween ABAP CDS view and AMDP
A:
36Q: When t o use ABAP SQL, CDS views, AMDP ?
A: ABAP SQL, CDS views, and AMDP (ABAP Managed Dat abase Procedures) are all opt ions for accessing dat a in SAP syst ems.
T he choice of which t o use depends on various fact ors such as performance, complexit y, and dat a st ruct ure.
ABAP SQL should be used when simple dat a ret rieval or manipulat ion is required, and t he underlying dat abase t ables or views
are well-st ruct ured. ABAP SQL can be used for basic SELECT, INSERT, UPDAT E, and DELET E st at ement s, and it is suit able for
simple queries t hat do not require complex dat a processing.
CDS views should be used when a more complex view of dat a is required, and when t he dat a needs t o be accessed from
mult iple sources. CDS views can be used t o define complex joins, unions, and aggregat ions, and t hey are opt imized for
performance. T hey are also suit able for creat ing report s and analyt ical applicat ions.
AMDP should be used in sit uat ions where complex dat abase processing is required, and performance is a concern. For example,
if you need t o perform complex calculat ions, aggregat ions, or join operat ions on large dat a set s, using AMDP may be a good
opt ion.
It allows dat abase-specific funct ions t o be accessed t hat do not exist in Open SQL.
AMDP allows developers t o writ e dat abase procedures in ABAP t hat can be execut ed on t he dat abase server, rat her t han in
t he applicat ion server, which can result in improved performance.
In summary, ABAP SQL, CDS views, and AMDP all have t heir use cases, and t he choice of which t o use depends on t he specific
requirement s of t he t ask at hand.
37Q: What is CDS Table Funct ion?
A: T he AMDP framework support s AMDP funct ions alongside t he exist ing AMDP procedures.
AMDP funct ions use t he new addit ion BY DATABASE FUNCT ION of t he MET HOD st at ement in AMDP classes.
AMDP funct ions are funct ional met hods of global classes which define funct ions st ored and execut ed on t he dat abase. It is
not allowed t o call funct ional met hods t hat define AMDP funct ions direct ly in ABAP
ABAP CDS int roduced CDS t able funct ions t o make AMDP funct ions available as dat a sources of SELECT st at ement s.
38Q: What is t he difference bet ween AMDP procedure and AMDP funct ion?
A:
39Q: How t o use Select -Opt ions in CDS view?
A:
SELECT OPT IONS is not an SQL feat ure so
1. Conversion of t he select ion t ables int o an SQL WHERE clause using met hod CL_SHDB_SELT AB=>COMBINE_SELT ABS( )
2. Handling of dynamic WHERE clauses wit hin t he AMDP funct ion met hod using t he funct ion APPLY_FILT ER
40Q: What is SAP ADBC?
A: SAP ADBC st ands for ABAP Dat abase Connect ivit y, and it is a programming int erface t hat allows ABAP programs t o access
relat ional dat abases using SQL st at ement s. ADBC provides a way t o connect t o dat abases and execut e SQL st at ement s
wit hout needing t o use Open SQL, which is limit ed t o accessing t he dat abase schema defined in t he ABAP Dict ionary.
41Q: How t o creat e ADBC?
A: Below st eps are involved in creat ions of ADBC
Call met hod get _connect ion( ) of class CL_SQL_CONNECT ION t o get dat abase connect ion only when accessing
secondary DB
Creat e a st at ement object : Inst ant iat ion of class CL_SQL_STAT EMENT
Fill st ring variable wit h SQL synt ax
Call met hod execut e_query() of class CL_SQL_STAT EMENT t o issue nat ive SQL call
Call met hod set _param() or set _param_t able() of class CL_SQL_RESULT _SET t o assign t arget variable for result set :
Call met hod next _package() of class CL_SQL_RESULT _SET t o ret rieve result set :
Call Met hod close() of class CL_SQL_RESULT _SET t o close result and release resources
42Q: When t o use ABAP SQL, CDS views, AMDP and ADBC?
A:
ABAP SQL, CDS views, and AMDP (ABAP Managed Dat abase Procedures) are all opt ions for accessing and manipulat ing dat a in
SAP syst ems. T he choice of which t o use depends on various fact ors such as performance, complexit y, and dat a st ruct ure.
ABAP SQL should be used when simple dat a ret rieval or manipulat ion is required, and t he underlying dat abase t ables or views
are well-st ruct ured. ABAP SQL can be used for basic SELECT, INSERT, UPDAT E, and DELET E st at ement s, and it is suit able for
simple queries t hat do not require complex dat a processing.
CDS views should be used when a more complex view of dat a is required, and when t he dat a needs t o be accessed from
mult iple sources. CDS views can be used t o define complex joins, unions, and aggregat ions, and t hey are opt imized for
performance. T hey are also suit able for creat ing report s and analyt ical applicat ions.
AMDP should be used when complex dat a processing is required, and when t he dat a manipulat ion cannot be done efficient ly
using ABAP SQL or CDS views alone. AMDP allows developers t o writ e dat abase procedures in ABAP t hat can be execut ed on
t he dat abase server, rat her t han in t he applicat ion server, which can result in improved performance. AMDP is suit able for
complex dat a t ransformat ions and calculat ions t hat require significant processing power.
In summary, ABAP SQL, CDS views, and AMDP all have t heir use cases, and t he choice of which t o use depends on t he specific
requirement s of t he t ask at hand.
ABAP Dat abase Connect ivit y (ADBC) is used in SAP ABAP on HANA syst ems when a direct connect ion t o t he dat abase is
required for dat a access and manipulat ion. ADBC is part icularly useful when accessing and manipulat ing large volumes of dat a
or when execut ing complex SQL st at ement s t hat cannot be easily handled using ABAP Open SQL or CDS Views.
It is useful when working wit h legacy dat abase code t hat cannot be easily migrat ed t o modern dat a access t echnologies such
as CDS views or AMDP.
43Q: What is ALV IDA?
A:
T he SAP List Viewer wit h Int egrat ed Dat a Access (ALV wit h IDA) offers ABAP developers t he opt ion t o t ake advant age of SAP
HANA, wit hout having t o present t he user wit h a new or different int erface.
44Q: What is difference bet ween classical ALV and ALV IDA?
A:
45Q: What are t he benefit s of using ALV IDA?
A: ALV IDA provides several benefit s over t radit ional ALV grids, including:
T he abilit y t o display dat a from mult iple t ables in a single grid, wit hout t he need for complex joins or nest ed SELECT
st at ement s.
Improved performance, since ALV IDA ret rieves only t he dat a t hat is needed t o display t he grid, rat her t han ret rieving all t he
dat a from each t able and performing joins in memory.
Flexibilit y, since ALV IDA can be used t o display dat a from any combinat ion of t ables or views, regardless of t he underlying
dat a model.
Cust omizabilit y, since ALV IDA provides a wide range of opt ions for cust omizing t he layout and behaviour of t he grid
46Q: What is a Virt ual Dat a Model (VDM) in SAP CDS views?
A: A Virt ual Dat a Model (VDM) is a dat a model t hat defines a logical view of dat a based on one or more underlying t ables, views,
or ot her dat a sources. It provides a unified and st andardized way t o define and consume dat a models in SAP CDS views.
47Q: What are t ypes of CDS views in Virt ual Dat a Model (VDM)?
A:
1. Basic Views: Basic Views are t he simplest t ype of CDS view, which define a single dat abase t able or view. T hey provide a
simple way t o access t he dat a and can be used as a building block for more complex views.
2. Composit e Views: Composit e Views combine mult iple Basic Views t o creat e a more complex view of t he dat a. T hey can
include joins, unions, or project ions t o combine t he dat a from mult iple t ables or views. Composit e views can also be used t o
provide a simplified view of complex dat a st ruct ures.
3. Consumpt ion Views: Consumpt ion Views are used t o provide a business-orient ed view of t he dat a, which is opt imized for
report ing and analysis. T hey are built on t op of Basic and Composit e Views, and can include calculat ed fields, filt ers, and
aggregat ions t o provide a summarized view of t he dat a. Consumpt ion Views can be used t o define key performance
indicat ors (KPIs) and ot her met rics for business analysis.
T hese t hree t ypes of CDS views can be organized int o a layered archit ect ure in t he VDM t o creat e a scalable and flexible dat a
model t hat meet s t he needs of t he business.
48Q: Which is a Mandat ory annot at ion in CDS view
A: T he annot at ion @AbapCat alog.sqlViewName is mandat ory
49Q. Difference bet ween SAP HANA Nat ive SQL, Classic Open SQL and Enhanced Open SQL
A:
50Q: What condit ions have t o be fulfilled t o perform an SAP HANA full-t ext search on column COL of dat abase t able T AB.
Which of t he following ?
A:
Table T AB is locat ed in column st ore.
A full t ext index exist s for column COL of t able T AB.
About Us
Contact Us
Terms and Conditions
Refund Policy
Privacy Policy
© 2024 by Smart Logic Academy