SAP ABAP interview questions and answers for developers
SAP ABAP interview questions check whether you can write and change code inside an SAP system without breaking it or slowing it down. Expect Data Dictionary objects, the three kinds of internal tables, Open SQL pitfalls such as FOR ALL ENTRIES with an empty table, enhancements through BAdIs and exits, interfaces with BAPIs and IDocs, and how updates commit in the SAP LUW. Newer roles add modern syntax, CDS views, AMDP and the RESTful application programming model.
By Evin JohnPublished 7 min read
How ABAP interviews are run
Most ABAP interviews are technical conversations with a lead developer, often with a short code review or a whiteboard task: fix a slow report, read a dump, design an enhancement. Support roles get more questions on debugging, IDocs and transports; project roles get specifications, enhancements and interfaces; S/4HANA roles lean on CDS, OData and the clean core approach. The broader SAP interview questions page covers how ABAP fits with the modules, and functional colleagues on the panel often check whether you can read a specification written in business language.
ABAP fundamentals questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Domain versus data element? | Dictionary | A domain holds the technical type, length and allowed values. A data element adds meaning on top: field labels, documentation and search help. Many data elements can share one domain. |
| Transparent table, structure and view? | Dictionary objects | A transparent table exists one-to-one in the database. A structure has no data of its own and types work areas or parameters. Views join or project tables, and maintenance views back table maintenance. |
| What is a lock object? | Concurrency | A dictionary object that generates ENQUEUE and DEQUEUE function modules, which set logical locks in the lock table so two users do not change the same record at once. |
| Standard, sorted and hashed internal tables? | Core data structures | Standard tables are index-based with linear key search unless sorted and read with BINARY SEARCH. Sorted tables stay ordered by key and search fast. Hashed tables need a unique key and give constant-time reads by the full key, with no index access. |
| Work area or field symbol in a loop? | Performance | LOOP INTO copies each row into a work area; ASSIGNING points a field symbol at the row itself, avoiding the copy and letting you change it directly. |
| What is the order of report events? | Classic reports | INITIALIZATION, AT SELECTION-SCREEN (input checks), START-OF-SELECTION (main logic), END-OF-SELECTION, plus TOP-OF-PAGE and AT LINE-SELECTION for list output. |
| PARAMETERS versus SELECT-OPTIONS? | Selection screens | PARAMETERS gives one input field. SELECT-OPTIONS gives a range table with SIGN, OPTION, LOW and HIGH, used directly in a WHERE clause with IN. |
| SELECT SINGLE versus UP TO 1 ROWS? | Open SQL | SELECT SINGLE is meant for reading one row by the full key. UP TO 1 ROWS reads the first match of a partial key and can use ORDER BY to choose which one. |
| Pass by value or by reference? | Modularization | By reference passes the original and is cheaper; by value works on a copy so the caller's data cannot be changed. Large tables are usually passed by reference. |
| Which exception classes exist in class-based handling? | Error handling | Exceptions inherit from CX_STATIC_CHECK (must be declared and is checked at compile time), CX_DYNAMIC_CHECK (checked at runtime) or CX_NO_CHECK (need not be declared). |
Open SQL and performance
IF lt_orders IS NOT INITIAL.
SELECT vbeln, posnr, matnr, kwmeng
FROM vbap
FOR ALL ENTRIES IN @lt_orders
WHERE vbeln = @lt_orders-vbeln
INTO TABLE @DATA(lt_items).
ENDIF.
TRY.
DATA(ls_first) = lt_items[ vbeln = lv_order posnr = '000010' ].
CATCH cx_sy_itab_line_not_found.
" no item 10 for this order
ENDTRY.- What happens if the FOR ALL ENTRIES table is empty? The condition on it is ignored and the SELECT reads every row that matches the rest of the WHERE clause, often the whole table. Always check the driver table first.
- What else does FOR ALL ENTRIES do quietly? It removes duplicate rows from the result, so select enough key fields to keep the rows you need, and it splits large driver tables into several database statements.
- JOIN or FOR ALL ENTRIES? A join lets the database do the work in one statement and is usually faster for tables in the same database. FOR ALL ENTRIES is useful when the driver data came from elsewhere, such as a file or a function module.
- Why is SELECT inside a LOOP bad? Each pass is a round trip to the database. Read everything once into an internal table, then use a sorted or hashed table for lookups inside the loop.
- How do you find why a program is slow? An SQL trace (ST05) shows statements, durations and identical selects; runtime analysis (SAT) shows where ABAP time goes. Code Inspector and the ABAP Test Cockpit catch known patterns before transport.
- What is table buffering and when is it a bad idea? The application server caches table contents to avoid database reads. Good for small, rarely changed configuration tables; bad for transaction data, because buffers sync between servers with a delay.
Enhancements, interfaces and the SAP LUW
| Question | What it tests | What a strong answer shows |
|---|---|---|
| How do you add logic to a standard transaction without modifying it? | Enhancement framework | Find a BAdI, customer exit or enhancement spot at the right point, implement it in the customer namespace, and only consider an implicit enhancement or modification when nothing else fits. |
| Classic BAdI versus kernel BAdI? | BAdI types | Classic BAdIs are defined in SE18 and created with a factory call. Newer kernel BAdIs belong to enhancement spots and are called with GET BADI and CALL BADI, which is faster and supports filters cleanly. |
| How do you find the right exit or BAdI? | Practical skill | Search the enhancement spots of the package, set a breakpoint on the BAdI call method in the debugger, or read the documentation for the process. Interviewers like a concrete method, not guessing. |
| What is a BAPI and how do you call one correctly? | Interfaces | A released, stable function module for a business object, callable through RFC. Check the RETURN table for errors and call BAPI_TRANSACTION_COMMIT, because most BAPIs do not commit on their own. |
| What is an IDoc made of? | ALE and EDI | A control record, data segments and status records. Message type, basic type, partner profiles and ports decide how it is built and where it goes. WE02 or WE05 to display, BD87 to reprocess. |
| CALL TRANSACTION versus session method in BDC? | Data loads | CALL TRANSACTION runs immediately and you handle errors in code. The session method creates a batch input session processed in SM35 with a log, which suits large loads needing review. |
| What is the SAP LUW? | Transactions | A logical unit of work that can span several dialog steps. Changes registered with CALL FUNCTION IN UPDATE TASK run together after COMMIT WORK, so they all succeed or all roll back. |
| Synchronous, asynchronous and transactional RFC? | Remote calls | Synchronous waits for the result. Asynchronous returns immediately. Transactional RFC executes exactly once in order of registration, useful when duplicate calls would corrupt data. |
| SAPscript, Smart Forms or Adobe Forms? | Output | SAPscript is the oldest, Smart Forms generate a function module and are easier to maintain, and Adobe Forms are the newer choice for interactive and print forms. |
| What is ALV and how do you build one? | Reports | The ABAP List Viewer, a standard grid with sorting, filtering and export. CL_SALV_TABLE builds a simple ALV in a few lines; the older function modules and CL_GUI_ALV_GRID give more control. |
Modern ABAP and S/4HANA questions
- What does modern syntax change? Inline declarations with DATA( ) and FIELD-SYMBOL( ), constructor operators such as VALUE, NEW, CONV and CORRESPONDING, string templates between pipes, table expressions, and FOR and REDUCE for building tables. It cuts boilerplate, and reviewers expect it in new code.
- What is a CDS view? A data model defined in ABAP with SQL-like syntax plus annotations, executed in the database. Associations describe relationships that are joined only when used, and access control objects add row-level authorization.
- What is AMDP and when would you use it? ABAP Managed Database Procedures let a class method contain SQLScript that runs in HANA. Use it when CDS and Open SQL cannot express the logic; it ties the code to HANA. SAP HANA interview questions covers the database side.
- What are the parts of a RAP business object? A CDS data model, a behavior definition for operations, validations and determinations, a behavior implementation class, then a service definition and a service binding that exposes it, usually as OData for a Fiori app.
- Managed versus unmanaged RAP? In managed scenarios the framework handles standard create, update and delete. Unmanaged scenarios call existing code, such as legacy function modules, for persistence.
- What does clean core mean for a developer? Extend through released APIs and extension points, keep custom code separate from SAP objects, and avoid modifications, so upgrades do not break your work.
- How do you test ABAP code? ABAP Unit test classes with test doubles for database and dependencies, run in the ABAP Test Cockpit with static checks before release.
Senior and scenario questions
- A report that ran in a minute now takes an hour after go-live. Where do you start? Trace it on production-like data. Look for a missing index or an unfiltered SELECT, FOR ALL ENTRIES with an empty table, nested loops over standard tables, and selects inside loops.
- An inbound IDoc fails with status 51. What do you do? Read the status message, check the data in the segments against master data, fix the cause (often missing master data or a mapping), and reprocess in BD87. If it repeats, fix the partner profile or mapping, not the IDoc by hand.
- You get a dump TIME_OUT in production. What does it tell you? A dialog step ran longer than the allowed runtime. Move the work to a background job, make the selection smaller, or fix the expensive statement the dump points to.
- How do you review a junior's code? Correctness first, then database access, error handling (RETURN tables, exceptions, sy-subrc), naming and readability, and whether a standard API already does the job.
- How would you migrate custom code to S/4HANA? Run the custom code checks, remove unused objects, fix incompatible table usage such as old finance and material tables, and replace modifications with enhancements or released APIs.
Fictional example
- Interviewer
- Here is a loop over 50,000 sales items. Inside it there is a SELECT SINGLE on the material description table. It takes minutes. What do you change?
- Candidate
- The SELECT SINGLE runs once per item, so it is 50,000 database round trips. I would collect the distinct material numbers first, check the list is not empty, and read all descriptions in one statement for the user's language, either with FOR ALL ENTRIES or a join if the items come from the database too. I would store the result in a hashed table keyed by material, then read it inside the loop with a table expression and handle the not-found case. I would also loop with ASSIGNING so each item is not copied. Then I would run an SQL trace before and after to show the difference instead of claiming it.
How to prepare for SAP ABAP interview questions
- Write one report end to endSelection screen, a join, a hashed lookup table, an ALV output and proper error messages.
- Practice one of each integrationCall a BAPI with commit and error handling, read an IDoc's structure, and explain what an RFC destination is.
- Implement one BAdIFind it, implement it, set a breakpoint and explain why you chose it over an implicit enhancement.
- Learn the modern piecesRewrite old code with inline declarations and VALUE, build a CDS view with an association, and sketch a RAP object.
- Prepare two storiesA performance fix and a production bug you traced, told with what you measured.
Many ABAP roles sit close to administration: SAP Basis interview questions covers transports, dumps and jobs from the system side, and SAP consultant interview questions shows what the functional people who write your specifications are asked.
Explaining code out loud is a separate skill from writing it. Natively, an AI interview assistant for Mac and Windows, transcribes a mock ABAP round on your computer, so you can review how clearly you walked through a fix. In practice it can read a screenshot of a code snippet, a dump or an IDoc status and suggest an approach, and with Pro or the free trial it uses the résumé and job description you add. Transcripts and notes from each session are there to revisit.
Questions people ask
What are common SAP ABAP interview questions?
Domain versus data element, standard versus sorted versus hashed internal tables, report events, FOR ALL ENTRIES, enhancements with BAdIs and exits, BAPIs and IDocs, BDC, the SAP LUW and update task, and modern topics such as CDS views, AMDP and RAP.
What happens when the FOR ALL ENTRIES table is empty?
The condition on that table is ignored, so the SELECT returns every row matching the rest of the WHERE clause. Check that the driver table is not initial before the SELECT.
What is the difference between a sorted and a hashed internal table?
A sorted table keeps rows in key order and supports fast binary search and index access. A hashed table needs a unique key and gives constant-time reads by the full key, without index access.
Do ABAP interviews ask about S/4HANA?
Increasingly. Expect CDS views and annotations, AMDP, the RESTful application programming model, OData services for Fiori, clean core extension rules and custom code migration checks.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
