ABAP Β· Performance

SAP ABAP Performance Tuning Interview Questions

Performance tuning is almost never asked as a definition question. It arrives as a scenario β€” a report that used to finish in minutes now runs for hours β€” and the interviewer is measuring whether you measure. Candidates who start listing optimisations before naming a measurement tool are the ones who get filtered out.

This page collects reviewed ABAP performance and Open SQL interview questions with complete written answers. Between them they cover the analysis path (trace before change), the database side (selective WHERE clauses, index usage, aggregate and join behaviour, buffering), the ABAP side (nested loops, sorted and hashed access to internal tables, reads inside loops), and the S/4HANA-era question of what should be pushed down to the database instead of looped in ABAP.

The answers deliberately keep the order that works in a real interview: what you would measure, what the measurement would tell you, what you would change, and how you would prove the change helped. That last step is the one most candidates skip and most interviewers are listening for.

What interviewers actually probe

Measure first

Expect to be asked which tool you would reach for before touching code. SQL trace and runtime analysis are the two answers that carry weight, and being able to say what each one shows you β€” statements and their cost versus where the time is spent in the program β€” matters more than naming them.

Selectivity and indexes

Most slow SQL in ABAP is a selection that cannot use an index or a read placed inside a loop. Interviewers probe whether you reason about which fields are actually restricted, not whether you can recite 'add an index'.

Internal table access

Standard, sorted and hashed tables, binary search on a sorted table, and the cost of nested loops are near-guaranteed questions at 2–6 years of experience, usually as 'this loop is slow β€” what would you change?'.

Pushdown on HANA

For S/4HANA projects the question becomes where the logic belongs. Aggregation, joins and filtering done by the database instead of by an ABAP loop is the expected direction, along with an honest account of when that is not worth it.

12 questions with full answers

Ordered from foundational to advanced. No sign-in required.

mediumPerformance Tuning

1. What is the risk of using FOR ALL ENTRIES with an empty internal table?

If the FOR ALL ENTRIES driver table is empty, the condition based on that table can be ignored and the SELECT may fetch a much larger dataset than expected. Always check the driver table is not initial before the SELECT.
easyPerformance Tuning

2. Why is SELECT inside LOOP considered bad for performance?

SELECT inside LOOP can execute one database call per loop record. If the loop has thousands of entries, it creates thousands of database round-trips. A better design is to collect keys, fetch data once and use internal table lookup.
mediumPerformance Tuning

3. A nested LOOP AT itab1 / LOOP AT itab2 WHERE key = itab1-key is a hotspot. How do you refactor it?

Convert itab2 to a SORTED or HASHED table on the join key and use a single LOOP with READ TABLE ... WITH KEY, or use LOOP AT itab2 INTO ... USING KEY. Complexity drops from O(n*m) to O(n log m) or O(n). If both tables are large and static, materialise the join once into a lookup hashed table; if the join is DB-side, move it to a JOIN or CDS view.
mediumPerformance Tuning

4. How do you optimise a LOOP AT itab WHERE ... on a large standard table?

A WHERE clause on a STANDARD table is a linear scan. Options: (1) sort the table by the WHERE fields and use LOOP AT ... FROM/TO, (2) define a SORTED secondary key and LOOP ... USING KEY, (3) redesign as HASHED if lookup by unique key, (4) pre-filter into a smaller work table. On HANA, push the filter into the SELECT itself.
mediumPerformance Tuning

5. A memory dump (TSV_TNEW_PAGE_ALLOC_FAILED) occurs in a report processing 3M rows. What do you change?

Stop loading everything into memory. Read in packages with SELECT ... PACKAGE SIZE, process each package, then FREE the driver itab before the next fetch. Move as much filtering/aggregation as possible to CDS/Open SQL so the ABAP side handles a much smaller result. If output goes to a file, stream it (open dataset, write per package) instead of building a giant internal table.
mediumPerformance Tuning

6. What is code push-down and how does it change your ABAP performance mindset on HANA?

Push-down means executing set-based data logic (joins, filters, aggregations, calculations) on HANA rather than looping in ABAP. Shift your mindset from read once, loop in ABAP to shape the data in CDS/AMDP/Open SQL, receive a small result set. This reduces round-trips, leverages column store and parallelism, and keeps ABAP focused on orchestration and business rules.
mediumPerformance Tuning

7. A report takes 30 minutes. How would you start performance analysis?

I would reproduce the issue with realistic input, run ST05 to identify expensive SQL and execution count, run SAT to understand ABAP runtime, check data volume, identify whether DB or ABAP processing is the bottleneck, then optimize the highest-impact area first.
mediumPerformance Tuning

8. Explain buffered vs non-buffered DB tables and when buffering hurts more than it helps.

Buffering keeps table content in the application server buffer. Great for small, mostly-read config tables. It hurts when the table changes often (invalidation storms across servers), when the table is large (memory pressure), or when reads always use non-key access that bypasses the buffer. Check with ST02 and TU02, and disable buffering for volatile master data.
hardPerformance Tuning

9. How would you use parallel processing (aRFC or bgRFC) to shorten a batch run, and what risks do you plan for?

Split the workload by an even key (e.g. company code range) and dispatch chunks via CALL FUNCTION ... STARTING NEW TASK (aRFC) or bgRFC units. Reserve a bounded server group so you do not starve dialog users. Plan for: uneven partitions (long-tail chunk), retry semantics, cross-chunk locks, and result aggregation. Always add a serial fallback path when the RFC destination is down.
hardPerformance Tuning

10. A report runs for 2 hours on production and 5 seconds in DEV. How do you approach tuning?

First reproduce with production-like data volume in QA. Run ST05 (SQL, buffer, RFC, enqueue traces) during a representative execution; look at total DB time vs ABAP time. Use SAT (SE30) for ABAP hotspots. Check execution plan for missing/unused indexes on the top statements, buffer settings, and whether SELECT SINGLE / SELECT ... UP TO 1 ROWS is used properly. Look for SELECT inside LOOP, nested loops without secondary keys, unnecessary sorts, and internal-table copies. Fix top offender first, re-trace to confirm, and add a regression test with production-scale data.
hardPerformance Tuning

11. A job is fast in DEV/QA but slow in production only during month-end. Where do you start?

Compare data volumes (VBRK/BSEG are much bigger in prod) and the actual execution plan (ST05 + explain), because the DB optimiser can change plans as statistics shift. Check for concurrent long-running jobs in SM50, update statistics if outdated, and consider partitioning or scheduling to a quiet window. If a specific SQL plan flipped, freeze it with a hint after consulting the DB team.
hardPerformance Tuning

12. How would you assess the performance regression of a transport before releasing it to production?

Run ATC in the QA system with the performance-relevant checks enabled; execute the changed report/service under SAT (runtime analysis) with representative data volumes; capture SQL trace (ST05) before and after and diff the statement list. For services, use /IWFND/TRACES and a Postman/loadrunner script that mimics real payloads. Compare wall time, DB time, and memory use, and block the transport if any regression exceeds an agreed threshold.

Practise by experience level

8-12 years4-7 years1-3 years

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 Performance Tuning Interview Questions FAQ

What is the first thing you do when a report is reported as slow?

Reproduce it and measure it. A runtime analysis shows where the program spends its time and an SQL trace shows which statements the database actually executed and how expensive they were. Only after that measurement does it make sense to talk about indexes, buffering or restructuring loops.

Why is a SELECT inside a LOOP considered a problem?

Because it turns one database round trip into as many round trips as the loop has rows, and each of them carries fixed overhead regardless of how small the result is. The standard remedies interviewers expect are reading the required set once into an internal table and then working locally, or letting the database do the join and aggregation in a single statement.

How do you decide between a sorted table and a hashed table?

By the access pattern. A hashed table is for single-record access by full key and gives constant-time reads. A sorted table is for reads by a leading part of the key, for ranges and for processing in key order. A standard table with a linear search is the option to justify, not the default.

What does code pushdown mean in ABAP on HANA?

It means letting the database do set-oriented work β€” filtering, joining, aggregating, calculating β€” instead of transporting rows into ABAP and looping over them. In practice that shows up as more expressive Open SQL and CDS-based models, and as removing ABAP loops that only exist to add up or filter what the database could have returned already.

How do you prove a tuning change actually worked?

By comparing the same measurement before and after on comparable data volumes, and by checking that the result set is unchanged. Interviewers value the second half of that answer: a faster program that returns different data is a defect, not an optimisation.

Next practice step

Related SAP interview topics

ERP Climb is an independent educational platform and is not affiliated with SAP SE.