SAP ABAP on HANA Interview Questions
ABAP on HANA interviews have a tell: the interviewer writes a perfectly legal 2010-era SELECT and asks what you would change. The syntax still runs — that is the trap. What they are measuring is whether your defaults moved with the platform: inline declarations, host expressions, comma-separated field lists, and an instinct for what the database should do.
The questions on this page come from ERPClimb's reviewed ABAP bank and centre on modern Open SQL, because that is where HANA-era behaviour is most visible in everyday code: joins and aggregations pushed down instead of looped, new syntax that removes boilerplate, and the classic patterns — SELECT *, SELECT SINGLE in a loop, ORDER BY habits — that now cost real time.
The answers are written to survive the follow-up question. Anyone can say 'push it down'; the candidates who get offers can say what they would measure, what the new syntax buys beyond style, and when the old pattern is still fine.
What interviewers actually probe
Modern Open SQL by default
Expect a code-review style question: escaping host variables, inline declarations, new join and aggregation syntax. The wrong answer is defending the old style as 'clearer' without a technical reason.
What pushdown really means
Not a slogan — the interviewer wants you to identify the loop or the client-side aggregation in a snippet and describe the set-based statement that replaces it.
SELECT * and field lists
On a column store, reading columns you do not use has a different cost profile than it did on row stores. Expect to explain why the advice survived the platform change.
When NOT to push down
Senior rounds reward restraint: tiny result sets, logic that depends on application-layer state, or readability costs that outweigh microseconds. Blanket rules fail these questions.
25 questions with full answers
Ordered from foundational to advanced. No sign-in required.
2. Write an Open SQL SELECT INTO TABLE statement that fetches material master header data from MARA for a list of materials. Include proper field selection, WHERE clause, and no-data handling.
3. Explain the GROUP BY and HAVING clauses in Open SQL. Provide an example that counts orders by customer and filters for customers with > 10 orders.
4. Explain the difference between SELECT SINGLE and SELECT ... UP TO 1 ROWS in Open SQL. When would you use each, and what are the performance and determinism implications?
5. A SELECT statement returns duplicate rows due to a JOIN with a table that has multiple matches. How would you identify this issue and resolve it?
6. Explain aggregate functions in Open SQL (SUM, COUNT, AVG, MAX, MIN) and how they work with GROUP BY. Include how to handle NULL values.
7. A SELECT query returns results, but you notice unexpected NULL values in certain fields. How would you handle NULL values in Open SQL, and what are the implications for business logic?
8. You notice that a SELECT statement with an IN operator and a large list (5000 values) is slow. Explain the performance issue and propose alternatives.
9. Your SELECT statement uses FOR ALL ENTRIES but the driver table is sometimes empty during execution. How does this affect the query result, and how would you code defensively?
10. Describe how client handling (MANDT) works in Open SQL. When is client filtering automatic, and when must it be handled explicitly?
11. After executing a SELECT statement in Open SQL, your SY-SUBRC is 0 but the result set is logically empty (e.g., all rows filtered out in your application logic). How does this differ from a true database 'no rows found' scenario, and what debugging approach would you take?
12. A SELECT statement into an internal table takes 30 seconds. After analyzing the code, you realize the WHERE clause doesn't use any indexed fields, and a full table scan is occurring. How would you refactor this, and what tools would you use to verify improvement?
13. Design a robust error handling and monitoring strategy for a production Open SQL batch job that processes 10 million rows. Include recovery, logging, and performance tracking.
14. Compare CDS Views vs. Open SQL for data retrieval in SAP S/4HANA. When would you recommend each approach?
15. You are tasked with fetching 500,000 sales orders and their line items for a month-end batch. Describe your approach to avoid memory issues and database timeouts, including PACKAGE SIZE, batching, and commit strategy.
16. You are debugging a SELECT query using ST05 (SQL Trace). Walk through the key metrics you would examine to diagnose performance issues and identify the root cause.
17. Explain the relationship between index field order and WHERE-clause selectivity in Open SQL. Does the written order of conditions in the WHERE clause matter?
18. You are designing a high-performance batch job to export 2 million sales orders to a data warehouse. Walk through your Open SQL strategy, including PACKAGE SIZE, indexing, and monitoring.
19. A performance report queries sales data across 10 SAP tables. Explain your approach to optimize this using Open SQL, including when you would consider a CDS View or materialized aggregates.
20. Explain the concept of database pushdown in S/4HANA and how it influences your Open SQL design decisions.
21. A report uses multiple SELECT statements inside a loop, fetching related data for each order. Redesign this using a single query with JOINs and explain the performance benefit.
22. A production system is experiencing slow response times. You suspect a SELECT inside a LOOP is the culprit. Describe the anti-pattern, its performance impact, and provide a refactored solution.
23. A monthly report processes sales orders but runs for 8 hours, causing a production backup. Using ST05, you identify that the query scans 50 million rows but returns only 10,000. Propose and implement a solution.
24. A report queries purchase orders from multiple vendors. You have a list of 800 vendor IDs and need to fetch orders for all of them efficiently. Compare FOR ALL ENTRIES vs. JOIN approaches and recommend based on your experience.
25. A background job frequently fails with cursor-related dumps or lock-timeout symptoms during large Open SQL processing. How would you diagnose and redesign it safely?
Practise by experience level
The questions above are tagged by the experience levels they are normally asked at, so the same page works for a first interview and for a lead-developer round.
SAP ABAP on HANA Interview Questions FAQ
What changes in everyday ABAP when the database is HANA?
The database becomes the fastest place to filter, join and aggregate, so loops that only reduce data move into the statement, and modern Open SQL — host expressions, inline declarations, richer joins — becomes the default style. The second part of the answer interviewers wait for: secondary indexes and buffering habits from row-store days need re-examining, not blind copying.
What is code pushdown in ABAP on HANA?
Letting the database execute set-oriented work instead of shipping rows to the application server and looping over them. In practice it means expressive Open SQL, CDS-based models, and fewer internal-table aggregations — plus the measurement habit to prove the pushdown actually helped.
Is SELECT * still a problem on HANA?
Yes, for a different reason: HANA is a column store, so the penalty for unused columns shrinks, but the data still crosses the network and lands in memory you did not need. The modern answer pairs the field list with the real goal — selecting only what the logic consumes — rather than reciting the rule.
What are host expressions in modern Open SQL?
The @-prefixed syntax that lets ABAP variables, expressions and literals sit inside a statement without the old CONCATENATE-and-pray patterns. Interviewers use it as a modernity check: code that escapes its variables reads as current; code that does not reads as migrated.
When would you keep logic in ABAP instead of pushing it down?
When the set is small and the logic is clearer in ABAP, when the result depends on application-layer state the database cannot see, or when the pushed-down version becomes unreadable. The expected answer treats pushdown as a default with exceptions, not a religion — and measures before moving anything.
Next practice step
Related SAP interview topics
ERP Climb is an independent educational platform and is not affiliated with SAP SE.