All ABAP on HANA interview questions in one place, grouped by topic (OData, Web Services and BRF+ questions are in the CORE ABAP section's interview page; RAP questions are on RAP › 14 · Interview Questions; clean core questions on Clean Core › 03 and ABAP Cloud language questions on BTP Foundations › 05 · Interview Questions). Each group is copied from the "Interview questions" part of its page – read the page when an answer needs more depth.
How to practise: cover the answer, say yours out loud in 30–60 seconds, then compare.
01 · HANA Fundamentals & Code Pushdown
What is ABAP on HANA, and how is it different from SAP HANA?
SAP HANA is an in-memory database. ABAP on HANA is the technology / skill of running ABAP on HANA and using its strengths – mainly code pushdown with ABAP SQL, CDS and AMDP. ("HANA vs ABAP" compares a database with a programming language.)
Row store vs column store – when do you use which?
Column store for almost everything: big tables, aggregation, search, analytics; it compresses well and needs few indexes. Row store only for small tables that are always read as whole records (config, buffers).
How does HANA compress data, and what is the delta merge?
Dictionary encoding: each distinct value stored once in a sorted dictionary, rows store integer value IDs. Because that makes writes expensive, writes go to a write-optimised delta store; the delta merge periodically (auto-merge rules) rebuilds the compressed main store from main + delta.
What is code pushdown (code-to-data)?
Doing data-intensive work – filtering, joins, aggregation, calculations – inside the database and sending only the result to ABAP, instead of reading all rows and looping in ABAP. Tools: ABAP SQL, CDS, AMDP, ALV IDA.
How can you optimise the performance of ABAP on HANA applications?
Find the hot spots with SQLM / SWLT / ST05 (page 02), then push down: lean ABAP SQL (field lists, WHERE, aggregates, joins instead of nested SELECTs), CDS views for reusable models, AMDP for complex logic.
Bottom-up vs top-down approach?
Bottom-up (7.40 SP02): build HANA views/procedures in HANA Studio, expose them with external views or DB procedure proxies, transport ABAP and HANA parts separately. Top-down (7.40 SP05+): write CDS views and AMDPs in ADT; activation creates the DB objects; one ABAP transport. Top-down replaced bottom-up.
What is table partitioning and why use it?
Splitting a column table into parts by hash, range or round-robin (DDL PARTITION BY). Gives partition pruning, parallelism, load balancing over hosts, faster delta merges, and gets around the 2-billion-rows limit.
Attribute, analytic and calculation views?
Attribute = master data, analytic = star schema of facts + dimensions, calculation = flexible model on top. Attribute and analytic views (and scripted calc views) are deprecated; only graphical calculation views remain, and in S/4HANA ABAP development CDS views take this role.
When a CDS view is activated, which HANA view is created? Do I transport it?
None of the HANA modelling types – activation creates an ordinary SQL view in the database. You transport only the CDS source; activation in Q and P creates the DB view again there.
HANA CDS vs ABAP CDS?
Same idea, different worlds. ABAP CDS lives in the ABAP system, is DB-independent and used in S/4HANA. HANA CDS (.hdbdd, XS classic) was for native HANA developers without ABAP and is deprecated (replaced by HDI / CAP CDS).
INSERT vs UPSERT; ON DELETE CASCADE vs RESTRICT?
INSERT fails on an existing key; UPSERT inserts or updates (WITH PRIMARY KEY). CASCADE deletes the child rows with the parent; RESTRICT (default) blocks deleting a parent that still has children.
Abbreviations to know
IM = information model (HANA view) · HTC = HANA Transport Container (moved delivery units) · View proxy = external view (7.40 SP02) · UDF = user-defined function (scalar / table) · ADT = ABAP Development Tools · AMDP = ABAP Managed Database Procedure · MVCC = multi-version concurrency control.
02 · Migration to S/4HANA & Performance Tools
Greenfield vs brownfield vs selective data transition?
Greenfield: new system, redesigned processes, only master data and open items migrated. Brownfield (system conversion): the existing ERP is converted in place, keeping custom code and history. Selective data transition: a mix – merge or split systems, move selected company codes or data.
What are the main steps of a system conversion?
Prepare: Readiness Check, SI check (/SDF/RC_START_CHECK), system requirements (Unicode, AS ABAP only, client 066), custom code scoping (SCMON/UPL) and ATC checks. Realise: SUM with DMO, SPDD during SUM, SPAU/SPAU_ENH after. Follow-up: remediation, functional adaptation, testing, performance tuning.
SPDD vs SPAU vs SPAU_ENH?
SPDD adjusts modified DDIC objects during SUM (before tables are converted). SPAU adjusts modified repository objects and notes afterwards; SPAU_ENH does the same for enhancements.
What is a simplification item? Give an example.
A documented change of S/4HANA versus ECC, with SAP Notes that tell you what to do. Examples: MKPF/MSEG merged into MATDOC, material number extended to 40 characters, customers/vendors as Business Partners.
Which custom code issues appear when moving to HANA?
Missing ORDER BY where code relied on implicit sorting (binary search, delete adjacent duplicates), native SQL and DB hints written for the old database, pool/cluster table assumptions, and performance anti-patterns (SELECT *, SELECT in loops, FAE) that HANA makes visible.
Why does a missing ORDER BY become a problem on HANA?
HANA reads columns in parallel and gives no guaranteed row order. Code that assumed key order – READ … BINARY SEARCH, DELETE ADJACENT DUPLICATES, taking the first row – returns wrong results without any error. Fix with ORDER BY, SORT or a sorted table.
What are the five golden rules?
Keep the result set small, minimise transferred data, minimise the number of DB accesses, minimise search overhead, avoid unnecessary DB load. On HANA: do the work in the DB, but read only what you need.
ATC vs SCI?
SCI is the check engine (variants, object sets, inspections). ATC is the quality framework on top: same checks, plus central runs, scheduling, exemptions, transport integration, ADT quick fixes and remote checks for S/4HANA readiness.
SQLM vs ST05 – and why SWLT?
SQLM runs long-term in production and shows which statements cost most overall; ST05 traces one run in detail with execution plans. SWLT combines SQLM runtime data with ATC findings so you fix the code that is both bad and actually used.
SAT vs ST05?
SAT (or the ADT Profiler) shows where ABAP time is spent – methods, loops, DB share. ST05 shows the SQL statements themselves. Start with SAT to see if the DB is the problem, then ST05 to see which statement.
Abbreviations to know
SUM = Software Update Manager · DMO = Database Migration Option · SI = simplification item · UPL = Usage Procedure Logging · SCMON = ABAP Call Monitor · ATC = ABAP Test Cockpit · SQLM = SQL Monitor · SWLT = SQL Performance Tuning Worklist · SAT = ABAP Runtime Analysis.
03 · ABAP New Syntax 7.4 / 7.5+
Q1. What is an inline declaration and what type does the variable get?
DATA( ) / FIELD-SYMBOL( ) declare a variable where it is first written (7.40). The type comes from the right side – DATA(x) = 'ABC' is c LENGTH 3, DATA(n) = 5 is i. The variable is valid until the end of the method.
Q2. What happens when a table expression finds no line?
It raises CX_SY_ITAB_LINE_NOT_FOUND. Avoid it with OPTIONAL / DEFAULT in a VALUE expression, TRY/CATCH, line_exists( ) first, or ASSIGN itab[ … ] TO <fs> + sy-subrc.
Q3. Do line_exists( ) and line_index( ) set sy-subrc or sy-tabix?
No. line_exists is a predicate used only in conditions; line_index returns the index as its value (0 = not found). Table expressions do not set sy-subrc / sy-tabix either.
Q4. Is a table expression on a sorted table always a binary search?
Only when the given fields cover the leading part of the table key. On a standard table with a free key it is a linear search; use a sorted/hashed table or a secondary key (itab[ KEY k COMPONENTS … ]).
Q5. COND vs SWITCH?
COND = IF/ELSEIF with any condition in each WHEN. SWITCH = CASE: one operand compared for equality. Both return the initial value if nothing matches and there is no ELSE; both can THROW (7.40).
Q6. CORRESPONDING vs MOVE-CORRESPONDING?
MOVE-CORRESPONDING keeps target fields that are not copied. The CORRESPONDING operator builds a new value, so non-copied fields become initial – unless you add BASE ( target ). CORRESPONDING also has MAPPING, EXCEPT and DISCARDING DUPLICATES.
Q7. What does FILTER need?
A sorted or hashed key (primary or secondary via USING KEY) covering the WHERE fields, and conditions joined with AND (only = for a hashed key). Variants: EXCEPT WHERE, and IN ftab with a filter table.
Q8. Is FOR faster than LOOP?
Not in general. FOR/VALUE/REDUCE make code shorter and clearer; performance is about the same. Choose the right table kind and keys for speed.
Q9. How does LOOP AT … GROUP BY replace AT NEW?
It groups by any key without sorting first and without the AT NEW pitfalls (fields left of the key). The outer loop runs per group; LOOP AT GROUP reads the members; GROUP SIZE / GROUP INDEX and WITHOUT MEMBERS are optional.
Q10. Which release brought these features – and are they HANA-only?
Mostly 7.40 (SP02: inline, VALUE/NEW/CONV/COND/SWITCH, table expressions; SP05: FOR, REDUCE, CORRESPONDING; SP08: FILTER, GROUP BY, BASE). String templates are 7.02. They are ABAP language features and run on any database.
Q11. What is the difference between & and && in strings?
&& joins strings at runtime (variables, templates). & only joins literals at compile time.
04 · ABAP SQL, ADBC & ALV IDA
Q1. Open SQL (ABAP SQL) vs native SQL?
ABAP SQL is part of ABAP: checked at compile time, database-independent, automatic client handling, uses the table buffer, translated by the DB interface. Native SQL (EXEC SQL / ADBC) is passed unchanged to the database: DB-specific, no compile-time check, no buffer, manual client handling.
Q2. Why the @ in front of variables, and what is strict mode?
@ marks host (ABAP) variables so the parser can tell them from column names. Using any new feature puts the statement in strict mode: comma lists, @ and INTO at the end become mandatory.
Q3. When was Open SQL renamed?
In 7.53 (S/4HANA 1809) it became ABAP SQL.
Q4. FOR ALL ENTRIES or JOIN on HANA?
Prefer a JOIN (or a join with @itab, 7.52): one statement, aggregates possible. FAE pitfalls: empty driver table reads everything, duplicates are removed, no aggregates.
Q5. UNION vs UNION ALL?
UNION (= DISTINCT) removes duplicates, which costs extra work. UNION ALL keeps all rows and is faster. Both need the same number of compatible columns; names come from the first SELECT.
Q6. What is NULL and how do you handle it?
NULL = no value (e.g. outer-join columns without partner); it is not the initial value. In ABAP it arrives as initial. Handle it in SQL with IS [NOT] NULL and coalesce( ).
Q7. WHERE vs HAVING?
WHERE filters single rows before grouping; HAVING filters groups after GROUP BY and can use aggregates.
Q8. Window expression vs GROUP BY?
GROUP BY collapses rows into one row per group. OVER( PARTITION BY … ) computes the aggregate per window but keeps every row – e.g. item value next to order total, ranks, running totals (7.54+).
Q9. What is a CTE?
A named subquery (WITH +name AS ( SELECT … ), 7.51) that lives only for one statement – used for subtotals and multi-step queries without temporary tables.
Q10. What are the risks of ADBC?
SQL injection if strings are concatenated (bind with ?), missing client filter, no syntax check, no buffer, DB-specific SQL, not ABAP Cloud. Use it only for secondary DB connections or non-DDIC objects.
Q11. ALV with IDA vs classic ALV?
Classic ALV needs all data in an internal table. IDA reads only the visible rows and runs sorting, filtering and totals as SQL in the database – fast and memory-friendly for millions of rows. SAP GUI only.
Q12. When ABAP SQL, CDS, AMDP?
ABAP SQL for program-specific access and all updates; CDS for reusable, semantically rich read models (Fiori, RAP, analytics, DCL); AMDP for logic SQL/CDS cannot express or several result sets.
Q13. USING CLIENT vs CLIENT SPECIFIED?
Both read another client. USING CLIENT '100' (7.40 SP05) is the modern form and keeps automatic client handling for that one client; CLIENT SPECIFIED is obsolete.
05 · CDS Views
Q1. In which layer are CDS views created, and what happens on activation?
In the ABAP layer (ADT, DDIC). Activation creates an SQL view on the database (and for DDIC-based views also an SE11 SQL view). It is not a "HANA CDS view". Only the DDL source is transported; activation recreates the DB view in QA/PRD.
Q2. CDS view entity vs DDIC-based CDS view?
View entities (define view entity, 7.55+) have no extra SE11 view, no sqlViewName, faster activation, automatic client handling and stricter checks. DDIC-based views are obsolete; migrate with RUTDDLSV2MIGRATION.
Q3. Join vs association?
A join is always executed. An association is a reusable join condition executed only when a target field is requested (left outer join by default). Associations can be exposed for consumers, OData and RAP.
Q4. Does the database have to be HANA for CDS?
No. ABAP CDS views run on every database supported by AS ABAP (available since 7.40 SP05). Table functions (AMDP) are HANA-only.
Q5. Why use CDS when SE11 views exist?
Not just performance: expressions, outer joins and unions, parameters, associations, annotations, DCL, extensions, the VDM, and they are the foundation of RAP, Fiori elements and embedded analytics.
Q6. Can a CDS view create, update or delete data? Can you debug it?
Not by itself – CDS is read-only. With a RAP behaviour definition (or legacy BOPF) the BO supports CUD. There is no debugger; use Data Preview, ST05, the SQL CREATE statement and the dependency analyzer.
Q7. How do you implement authorisation in CDS?
@AccessControl.authorizationCheck: #CHECK plus a DCL role (define role … grant select … where … aspect pfcg_auth(…)). ABAP SQL adds the condition automatically. Native SQL / AMDP bypass DCL.
Q8. What is a CDS table function and when do you use it?
A CDS entity whose result is computed by an AMDP function (BY DATABASE FUNCTION) in SQLScript. Use it when CDS syntax cannot express the logic (e.g. STRING_AGG, procedural steps). It is HANA-only.
Q9. What are the VDM view types and S/4HANA naming conventions?
I_ interface (basic and composite – stable, reusable), C_ consumption (app-specific), R_ restricted reuse (RAP base), P_ private (never use). Data categories for analytics: #DIMENSION, #FACT, #CUBE.
Q10. How do you expose a CDS view as OData today?
With RAP: service definition (define service … expose …) and a service binding (OData V2/V4). @OData.publish: true and SEGW Reference Data Source are legacy and not available for view entities.
Q11. What is a virtual element?
A field calculated in ABAP after the DB read, via a class implementing IF_SADL_EXIT_CALC_ELEMENT_READ (@ObjectModel.virtualElementCalculatedBy: 'ABAP:ZCL_…'). Only OData / RAP evaluate it.
Q12. How do you make CDS views perform well?
Filter early (parameters, WHERE), keep joins minimal and use associations so unused joins are skipped, avoid to-many paths in field lists, CAST to matching types in join conditions, build on released I_ views, and check the plan with ST05 / PlanViz.
06 · AMDP & SQLScript
Before AMDP (7.40 bottom-up approach) a procedure was built in HANA Studio in the XS classic repository (runtime object in _SYS_BIC, e.g. "_SYS_BIC"."ZPACK/READ_EMPLOY_DATA") and exposed to ABAP via a database procedure proxy in ADT (Dictionary → Database Procedure Proxy), which generated an interface with the parameter types.
Q1. What is AMDP and why use it?
ABAP Managed Database Procedures: SQLScript written in a method of an ABAP class with IF_AMDP_MARKER_HDB, implemented BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT. Top-down: only ABAP transports, ADT tooling, ST22 and debugger. Used for complex, data-intensive logic that ABAP SQL and CDS cannot express.
Q2. What are the restrictions of AMDP methods?
Parameters by VALUE only, no RETURNING for procedures, elementary or flat table types, every object in USING, no ABAP statements, no COMMIT/ROLLBACK or DDL, no writes to buffered tables, no automatic client handling, no DCL, HANA only.
Q3. How do you handle the client in AMDP?
Filter it explicitly: WHERE mandt = SESSION_CONTEXT('CLIENT'), or pass sy-mandt as a parameter, or AMDP OPTIONS CDS SESSION CLIENT current when reading CDS views. Also join on the client column.
Q4. When is the DB procedure created, and what is it called?
At the first call of the method (not at activation), in the ABAP schema, named "<CLASS>=><METHOD>".
Q5. How do you pass select-options to an AMDP?
Convert them to a WHERE string with cl_shdb_seltab=>combine_seltabs, pass it as an IMPORTING string, and apply it with APPLY_FILTER( :lt_data, :iv_where ).
Q6. AMDP vs CDS view?
CDS is declarative, DB-independent, reusable (RAP, OData, analytics), with automatic client and DCL, one result set. AMDP is imperative SQLScript, HANA-only, can return several results, but needs manual client and authorisation handling. Prefer CDS; AMDP (or a CDS table function) only when needed.
Q7. AMDP vs database procedure proxy?
Proxy = bottom-up: procedure in HANA Studio + proxy in ADT, two transports, lifecycle problems. AMDP = top-down: the ABAP class is the only master, one transport. AMDP replaced proxies.
Q8. SQL SECURITY DEFINER vs INVOKER? What does READS SQL DATA mean?
DEFINER (the default) runs with the owner's privileges, INVOKER with the caller's. READS SQL DATA marks a procedure read-only (no DML/DDL), which allows optimisation and use in functions.
Q9. Scalar UDF vs table UDF?
A scalar UDF returns one or more scalar values and is used in the SELECT list; a table UDF returns one table and is used in the FROM clause. Both are read-only and cannot be CALLed.
Q10. Cursor vs cursor FOR loop – and should you use them?
An explicit cursor needs DECLARE, OPEN, FETCH, CLOSE and a NOTFOUND check; a FOR loop does it implicitly. On HANA avoid both where possible: set-based SQL runs in parallel.
Q11. How do you debug an AMDP and handle its errors?
Breakpoint in the SQLScript body in ADT (AMDP debugger). Errors arrive as CX_AMDP_* exceptions (e.g. CX_AMDP_EXECUTION_ERROR) that you catch in ABAP; uncaught they appear in ST22.
Q12. Can an AMDP return a value with RETURNING?
AMDP procedures: no. AMDP functions (BY DATABASE FUNCTION): yes, they must – a table or a scalar. CDS table function implementations have no parameter list and use RETURN SELECT.
General
Q. What is the difference between SAP HANA and ABAP?
SAP HANA is the in-memory database platform; ABAP is the programming language running on the application server. ABAP on HANA means writing ABAP that pushes data-intensive work down into HANA (ABAP SQL, CDS, AMDP) instead of processing large data sets in the application server.
Q. Authentication vs authorization?
Authentication = proving who you are (user/password, SSO, certificate). Authorization = what you are allowed to do once logged in (PFCG roles, authorization objects, AUTHORITY-CHECK, CDS access control).