SAP ABAP Interview Questions and Answers

ABAP interviews test whether you can write correct, maintainable and fast code, and whether you know when to extend SAP without modifying it. The questions below move from ABAP fundamentals for freshers through reports, ALV, BAPIs, enhancements and OOP, to ABAP on HANA, CDS view entities, AMDP and the ABAP RESTful Application Programming Model (RAP) for experienced developers, followed by coding exercises and troubleshooting scenarios.

Code samples use modern ABAP syntax (7.40 and later). Where classic techniques still appear in support projects, the answers explain both and say which approach SAP recommends for new development.

  • Freshers & trainee developers
  • Classic ABAP developers moving to S/4HANA
  • ABAP on HANA / RAP developers
  • Technical consultants in support projects
  • 77questions with answers
  • 12scenario-based
  • October 2026last updated

Jump to your level

Answers reflect SAP S/4HANA terminology. Transaction codes, menu paths and cloud features can vary by release and edition, so confirm details in your project system.

Fresher

Basic SAP ABAP Interview Questions for Freshers

Foundational ABAP interview questions on the language, the Data Dictionary, internal tables, ABAP SQL and reports.

18 questions
Q1

What is ABAP?

Fresher

ABAP (Advanced Business Application Programming) is SAP's programming language for business applications running on the ABAP platform, including SAP ECC, SAP S/4HANA and the SAP BTP ABAP environment. It is used to build reports, interfaces, conversions, enhancements, forms and workflows (RICEFW objects), as well as modern services and Fiori applications with CDS and RAP.

Link
Q2

What is the ABAP Data Dictionary?

Fresher

The ABAP Data Dictionary (transaction SE11, or ABAP Development Tools in Eclipse) centrally defines and manages metadata: database tables, views, data elements, domains, structures, table types, search helps and lock objects. Database tables defined here are created in the database, and their definitions are reused by programs, which ensures consistent types and field labels across the system.

Link
Q3

What is the difference between a domain and a data element?

Fresher

A domain defines technical attributes: data type, length, decimals, fixed values or value table and conversion routine. A data element defines semantic attributes: field labels, documentation and search help, and refers to a domain or a built-in type. Several data elements can share one domain, for example different date fields with different meanings.

Link
Q4

What are transparent, pooled and cluster tables?

Fresher

A transparent table has a one-to-one relationship with a database table. Pooled and cluster tables stored several logical tables in one physical table, an older technique for saving space. In SAP S/4HANA most pooled and cluster tables have been converted to transparent tables (for example BSEG is now transparent), because SAP HANA handles large tables efficiently.

Link
Q5

What is an internal table and what types exist?

Fresher

An internal table is a dynamic, in-memory table used to process sets of data in a program.

  • Standard table – index access, non-unique key, linear search unless sorted and searched with BINARY SEARCH.
  • Sorted table – always sorted by its key, unique or non-unique; key access uses binary search.
  • Hashed table – unique key only, constant-time key access via hashing, no index access.
Link
Q6

What is a work area and why are header lines obsolete?

Fresher

A work area is a structure that holds a single row while you read or modify an internal table. Header lines were an implicit work area with the same name as the table, which made code ambiguous. They are obsolete and not allowed in classes. Modern code uses explicit work areas, field symbols or inline declarations such as LOOP AT lt_data INTO DATA(ls_data).

Link
Q7

What is the difference between APPEND, INSERT, MODIFY and COLLECT?

Fresher
  • APPEND adds a row at the end of a standard (or, if the order is kept, sorted) table.
  • INSERT adds a row at a given index or according to the table key; for sorted and hashed tables it places the row correctly.
  • MODIFY changes existing rows, by index or key, optionally only specified fields with TRANSPORTING.
  • COLLECT adds the numeric fields of a row to an existing row with the same non-numeric key, or appends it if none exists.
Link
Q8

What is ABAP SQL (Open SQL)?

Fresher

ABAP SQL, formerly Open SQL, is the database-independent subset of SQL integrated into ABAP. It works on Data Dictionary objects and CDS entities, handles client handling automatically and uses the table buffer where configured. Modern ABAP SQL supports joins, expressions, aggregates, CASE, subqueries, common table expressions and inline declarations with host variables escaped by @.

Link
Q9

What is the difference between SELECT SINGLE and SELECT ... UP TO 1 ROWS?

Fresher

SELECT SINGLE reads one row and is intended for a fully specified primary key; if the key is not complete, the row returned is not defined. SELECT ... UP TO 1 ROWS reads the first row of the result set and can be combined with ORDER BY to define which row that is. Use SELECT SINGLE with the full key, and UP TO 1 ROWS with ORDER BY for "latest" or "first" logic.

Link
Q10

What are the main events in an executable report?

Fresher
  • LOAD-OF-PROGRAM – when the program is loaded.
  • INITIALIZATION – before the selection screen, for default values.
  • AT SELECTION-SCREEN OUTPUT / AT SELECTION-SCREEN – screen modification and input validation.
  • START-OF-SELECTION – main processing.
  • END-OF-SELECTION – after main processing, often for output.
  • TOP-OF-PAGE, END-OF-PAGE, AT LINE-SELECTION – list events for classical and interactive lists.
Link
Q11

What is the difference between PARAMETERS and SELECT-OPTIONS?

Fresher

PARAMETERS creates a single input field. SELECT-OPTIONS creates a range table with fields SIGN, OPTION, LOW and HIGH, allowing single values, ranges, exclusions and patterns, used in WHERE field IN so_field. An empty select-option means "no restriction", which is a common source of unexpectedly large selections.

Link
Q12

What are modularisation techniques in ABAP?

Fresher

Includes and macros (source code reuse), subroutines (FORM, obsolete for new development), function modules (in function groups, can be remote-enabled), and methods of classes (the recommended approach). Modularisation improves readability, reuse and testability.

Link
Q13

What is the difference between a function module and a method?

Fresher

A function module belongs to a function group, which shares global data across its modules, and can be RFC-enabled or used as an update module. Methods belong to classes, support encapsulation, inheritance, interfaces and unit testing with test doubles. New logic should be written in classes; function modules are still needed for RFC, update tasks and some frameworks.

Link
Q14

What is SY-SUBRC?

Fresher

SY-SUBRC is a system field set by many ABAP statements to indicate success (0) or a specific failure (non-zero). For example, READ TABLE returns 4 if no row is found, and a SELECT returns 4 if no data is found. Always check it immediately after the statement, before another statement overwrites it.

Link
Q15

What are lock objects?

Fresher

Lock objects, defined in the Data Dictionary, generate ENQUEUE_<name> and DEQUEUE_<name> function modules. They set logical locks in the SAP lock table (visible in SM12) to prevent two users from changing the same business data at the same time. Database locks alone are not sufficient because an SAP transaction spans several dialog steps.

Link
Q16

What are transport requests?

Fresher

Transport requests move development and configuration between systems, typically development, quality and production. Workbench requests contain repository objects (programs, classes, tables) and are usually client-independent; customising requests contain client-specific configuration. Objects are locked in a request until it is released.

Link
Q17

What is the difference between TYPE and LIKE?

Fresher

TYPE refers to a data type (a built-in type, a Data Dictionary type or a type defined with TYPES). LIKE refers to the type of an existing data object. Using TYPE with Dictionary types is preferred because it keeps code independent of other variables.

Link
Q18

What message types exist in ABAP and how do they behave?

Fresher

S (success), I (information popup), W (warning), E (error), A (termination) and X (exit with short dump). Their effect depends on context: for example, an E message at AT SELECTION-SCREEN returns the user to the screen for correction, while in START-OF-SELECTION it ends processing.

Link
Intermediate

Intermediate SAP ABAP Interview Questions

Interview questions for developers with project exposure: ALV, BAPIs, data migration, enhancements, forms, IDocs, RFC, the update task and object-oriented ABAP.

17 questions
Q19

What ALV options are available in ABAP?

Intermediate
  • REUSE_ALV_GRID_DISPLAY – function-module-based ALV, common in older code.
  • CL_GUI_ALV_GRID – flexible, event-driven ALV in a container on a screen; supports editable grids.
  • CL_SALV_TABLE – simple, object-oriented ALV for display; quick to implement but limited for editing.
  • In S/4HANA, many reporting needs are better served by CDS views with Fiori elements or analytical apps.
Link
Q20

What is a BAPI and how do you use it?

Intermediate

A BAPI (Business Application Programming Interface) is a standardised, RFC-enabled function module that represents a method of a business object in the Business Object Repository, for example BAPI_PO_CREATE1 or BAPI_ACC_DOCUMENT_POST. BAPIs perform business checks like the application does, return messages in a RETURN table (BAPIRET2) and do not commit on their own: you call BAPI_TRANSACTION_COMMIT after a successful call or BAPI_TRANSACTION_ROLLBACK on error. Use transaction BAPI to explore them.

Link
Q21

What are the options for loading data into SAP?

Intermediate

BAPIs or released APIs called from a custom program, batch input (BDC) for transactions without an API, IDocs for interfaces, LSMW in older ECC projects, and in S/4HANA the SAP S/4HANA Migration Cockpit for initial data migration. Prefer APIs over BDC because screen recordings break when screens change.

Link
Q22

What is the difference between call transaction and session method in BDC?

Intermediate

Call transaction processes the recorded screens immediately, synchronous or asynchronous, and you handle errors yourself, typically from MESSAGES INTO. The session method creates a batch input session that is processed later in SM35, with a built-in log and the ability to reprocess errors. Call transaction is faster; the session method is more robust for large volumes needing manual correction.

Link
Q23

What enhancement techniques exist in SAP?

Intermediate
  • User exits – form routines in SAP includes (modification-based, mainly SD).
  • Customer exits – function module exits, screen and menu exits via SMOD/CMOD.
  • BAdIs – object-oriented enhancement interfaces; classic BAdIs (SE18/SE19) and new kernel BAdIs within the enhancement framework.
  • Enhancement points and sections – explicit points provided by SAP, plus implicit points at the start and end of routines.
  • Key user extensibility – in S/4HANA, custom fields and custom logic apps, which use released BAdIs.
Link
Q24

How do you find a suitable BAdI or exit for a requirement?

Intermediate

Search for BAdIs in the relevant package and in the IMG enhancement nodes, set a breakpoint in CL_EXITHANDLER=>GET_INSTANCE for classic BAdIs, search the code for GET BADI and CALL BADI for new BAdIs, use the enhancement framework search in ADT, and check SAP notes or the *Custom Logic* app for released BAdIs in S/4HANA.

Link
Q25

What is the difference between classic and new BAdIs?

Intermediate

Classic BAdIs are instantiated through CL_EXITHANDLER and defined in SE18 as standalone objects. New (kernel) BAdIs are part of the enhancement framework, called with GET BADI and CALL BADI, are faster, support filters and fallback classes, and are integrated with enhancement spots. New BAdIs are the recommended approach.

Link
Q26

What is the difference between SAPscript, Smart Forms and Adobe Forms?

Intermediate

SAPscript is the oldest form technology, client-dependent and harder to maintain. Smart Forms are client-independent, graphical and generate a function module. SAP Interactive Forms by Adobe separate the interface/context from the PDF layout designed in Adobe LiveCycle Designer and support interactive PDFs. In S/4HANA, output management increasingly uses Adobe-based forms.

Link
Q27

What is an IDoc?

Intermediate

An IDoc (Intermediate Document) is SAP's standard container for asynchronous data exchange through ALE or EDI. It has a control record (sender, receiver, message type), data records (segments) and status records. Key configuration includes the message type, basic type and optional extension (WE30/WE31), partner profiles (WE20) and ports (WE21). Monitor IDocs with WE02/WE05 and reprocess with BD87.

Link
Q28

What types of RFC exist?

Intermediate
  • sRFC – synchronous; the caller waits.
  • aRFC – asynchronous; the caller continues and can receive results later.
  • tRFC – transactional; executed exactly once, in no guaranteed order.
  • qRFC – queued; exactly once and in order.
  • bgRFC – background RFC, the recommended successor of tRFC and qRFC with better performance and monitoring.
Link
Q29

What is the update task and what are V1 and V2 updates?

Intermediate

Database changes can be bundled into update function modules called with CALL FUNCTION ... IN UPDATE TASK; they run when COMMIT WORK is executed. V1 updates are time-critical (for example document postings) and run in one database LUW. V2 updates are less critical, such as statistics, and run after V1 succeeds. Failed updates are visible in SM13.

Link
Q30

What is the difference between an SAP LUW and a database LUW?

Intermediate

A database LUW is a set of changes committed or rolled back by the database together. An SAP LUW spans several dialog steps and database LUWs and is committed together through bundling techniques such as update function modules or PERFORM ... ON COMMIT, finished by COMMIT WORK. This keeps business changes consistent across screens.

Link
Q31

What is the difference between a field symbol and a data reference?

Intermediate

A field symbol is a placeholder that points to an existing data object; changes through it change the original data, and it avoids copying rows in loops (LOOP AT itab ASSIGNING FIELD-SYMBOL(<ls_row>)). A data reference (REF TO data) is a pointer stored in a variable, which can be passed around, stored in tables and dereferenced with ->*. Both are used for dynamic programming.

Link
Q32

Explain the main OOP concepts in ABAP.

Intermediate
  • Encapsulation – visibility sections (PUBLIC, PROTECTED, PRIVATE) hide implementation details.
  • Inheritance – a subclass inherits and can redefine methods of its superclass.
  • Polymorphism – the same call behaves differently depending on the object's class, through redefinition or interfaces.
  • Interfaces – define a contract that several classes implement independently.
  • Abstraction – abstract classes and methods define structure without full implementation.
Link
Q33

What is the difference between a constructor and a class constructor?

Intermediate

The instance CONSTRUCTOR runs once for each object created with NEW or CREATE OBJECT and can have importing parameters. The CLASS_CONSTRUCTOR is a static method that runs once per internal session, before the class is first accessed, and has no parameters. It is used to initialise static attributes.

Link
Q34

How does exception handling work in ABAP?

Intermediate

Use class-based exceptions with TRY ... CATCH ... CLEANUP ... ENDTRY and raise them with RAISE EXCEPTION TYPE or RAISE EXCEPTION NEW. Exception classes inherit from:

  • CX_STATIC_CHECK – must be declared in the method signature and handled; checked at compile time.
  • CX_DYNAMIC_CHECK – must be declared, but the check happens at runtime.
  • CX_NO_CHECK – need not be declared, for errors that can occur anywhere.

Classic exceptions (EXCEPTIONS in function modules) are still common when calling older function modules.

Link
Q35

What is module pool programming?

Intermediate

Module pool (dialog) programming builds custom transactions with screens designed in Screen Painter. Each screen has flow logic with PBO (Process Before Output) for preparing the screen and PAI (Process After Input) for handling user actions and validations, plus POV and POH for value and field help. It is still found in support projects, while new UIs are typically built with Fiori.

Link
Experienced

Advanced SAP ABAP on HANA, CDS and RAP Interview Questions

Experienced-level ABAP interview questions on ABAP on HANA, CDS view entities, AMDP, RAP, clean core, performance and modern syntax.

18 questions
Q36

What changes when you develop ABAP on SAP HANA?

Experienced

The main principle is code-to-data (code pushdown): move data-intensive calculations to the database instead of transferring large datasets to the application server. Use ABAP SQL features such as aggregates, joins and expressions, CDS views for reusable data models, and AMDP only where ABAP SQL and CDS are not enough. Avoid unnecessary SELECT *, nested selects and processing large result sets row by row in ABAP.

Link
Q37

What are CDS views?

Experienced

Core Data Services (CDS) views are data models defined with an SQL-like DDL in ABAP Development Tools. They support joins, associations, calculations, aggregations, parameters and annotations that add semantics for analytics, UI, OData and access control. CDS views are the basis of the S/4HANA virtual data model, Fiori elements apps, analytical queries and RAP business objects.

Link
Q38

What is the difference between DDIC-based CDS views and CDS view entities?

Experienced

DDIC-based CDS views (DEFINE VIEW with @AbapCatalog.sqlViewName) generate an additional SQL view in the Data Dictionary. CDS view entities (DEFINE VIEW ENTITY) do not need a separate SQL view, activate faster and have stricter, improved syntax checks. SAP recommends view entities for new development, and DDIC-based CDS views are considered obsolete.

Link
Q39

What is the difference between an association and a join in CDS?

Experienced

A join is always executed when the view is read. An association defines a relationship that is only turned into a join when a field of the associated entity is actually requested (path expression) or when the association is exposed and followed by a consumer, such as an OData service. Associations make data models reusable and avoid unnecessary joins.

Link
Q40

What is the virtual data model (VDM)?

Experienced

The VDM is SAP's structured set of CDS views in S/4HANA. Basic/interface views (I_ prefix) model business entities close to the tables, composite views combine them, and consumption views (C_ prefix) are tailored for specific apps or analytics. Released I_ views are the stable interface for custom development under clean core.

Link
Q41

How does authorisation work for CDS views?

Experienced

With CDS access control, defined in a DCL source with DEFINE ROLE. The role maps fields of the CDS entity to authorisation objects with PFCG_MAPPING (or other conditions). When the entity is read through ABAP SQL, the conditions are added automatically to the query. The annotation @AccessControl.authorizationCheck (#CHECK, #NOT_REQUIRED, etc.) controls whether access control is expected.

Link
Q42

What is AMDP and when would you use it?

Experienced

ABAP Managed Database Procedures let you implement methods in SQLScript inside an ABAP class marked with IF_AMDP_MARKER_HDB. The procedure is managed and transported with ABAP and created in SAP HANA on first call. Use AMDP for complex logic that ABAP SQL and CDS cannot express efficiently, such as multi-step calculations or HANA-specific functions. Prefer CDS and ABAP SQL first because they are database-independent and easier to maintain.

Link
Q43

What is a CDS table function?

Experienced

A CDS table function defines a CDS entity whose result is implemented by an AMDP function. It can be used like a CDS view in other CDS views and ABAP SQL, so complex SQLScript logic becomes part of the CDS data model. It is often used when a calculation cannot be expressed in a CDS view.

Link
Q44

What is the ABAP RESTful Application Programming Model (RAP)?

Experienced

RAP is SAP's programming model for building transactional Fiori apps and Web APIs on the ABAP platform, in S/4HANA and the SAP BTP ABAP environment. Its main artefacts are:

  • Data model – CDS view entities defining the business object structure (root and child entities).
  • Behaviour definition – operations (create, update, delete), actions, determinations, validations, locking, ETags, draft and authorisation.
  • Behaviour implementation – ABAP classes with the business logic.
  • Projection and service definition – what is exposed to a consumer.
  • Service binding – the protocol, such as OData V2 or V4, for a UI or Web API.
Link
Q45

What is the difference between managed and unmanaged RAP scenarios?

Experienced

In a managed scenario the RAP framework handles standard operations, buffering and saving to the database tables; developers add determinations, validations and actions. In an unmanaged scenario the developer implements the transactional buffer and save logic, often to reuse existing legacy code such as BAPIs. A managed scenario can also use an additional save or unmanaged save for special persistence needs.

Link
Q46

What is draft in RAP?

Experienced

Draft lets users save incomplete changes on the server and continue later, with draft data stored in a separate draft table. The behaviour definition declares with draft, a draft table and draft actions such as Edit, Activate, Discard and Resume. Fiori elements apps then provide draft handling automatically, including locking the active instance while it is being edited.

Link
Q47

What is EML?

Experienced

Entity Manipulation Language is the ABAP syntax for accessing RAP business objects: READ ENTITIES, MODIFY ENTITIES (create, update, delete, execute actions) and COMMIT ENTITIES. Inside behaviour implementations, IN LOCAL MODE skips authorisation and feature control checks for the business object's own logic. EML results come back in MAPPED, FAILED and REPORTED structures.

Link
Q48

What are determinations, validations and actions in RAP?

Experienced
  • Determinations calculate or set values automatically when specified triggers occur, on modify or on save.
  • Validations check data consistency on save and reject invalid instances through FAILED and REPORTED.
  • Actions are custom operations, such as *approve* or *copy*, triggered by a user or API, optionally with parameters and a result.
  • Feature control dynamically enables or disables fields and operations.
Link
Q49

What is ABAP Cloud and what are the clean core levels?

Experienced

ABAP Cloud is SAP's development model for cloud-ready, upgrade-stable extensions. It uses a restricted ABAP language version, released APIs only, and RAP and CDS for new applications. It is available in the SAP BTP ABAP environment, in SAP S/4HANA Cloud and, as on-stack extensibility, in S/4HANA private cloud and on-premise.

SAP describes extensions with clean core levels A to D, from A (ABAP Cloud with released APIs, the most upgrade-stable) to D (techniques such as modifications or use of internal objects that create the highest upgrade risk). ATC checks help classify findings. This model replaced the earlier three-tier extensibility explanation, so use current terminology in interviews.

Link
Q50

Which new ABAP syntax features do you use regularly?

Experienced

Inline declarations (DATA(...), FIELD-SYMBOL(...)), constructor expressions (VALUE, NEW, CORRESPONDING, CONV, CAST, COND, SWITCH, REDUCE, FILTER), table expressions (itab[ key = value ]) with line_exists and line_index, string templates (|Text { variable }|), FOR loops in constructor expressions, LOOP AT ... GROUP BY, and ABAP SQL with host expressions, CASE, joins and inline result tables.

Link
Q51

Which tools do you use for ABAP performance analysis?

Experienced
  • ST05 – SQL, buffer, enqueue and RFC trace; identifies expensive and repeated statements.
  • SAT – runtime analysis, showing where time is spent in ABAP and database.
  • ST12 – combined ABAP and SQL trace, widely used in support.
  • SQLM and SWLT – SQL Monitor and SQL Performance Tuning Worklist for production hotspots.
  • ATC / Code Inspector – static checks, including performance and S/4HANA readiness checks.
  • ST22 and SM50/SM66 – dumps and running work processes.
Link
Q52

How do you process very large data volumes in ABAP?

Experienced

Push aggregation to the database, read in packages with PACKAGE SIZE or cursors, use appropriate internal table types and secondary keys, avoid unnecessary copies by using field symbols or references, run in background jobs, and parallelise with asynchronous RFC (STARTING NEW TASK) or background RFC within the available work processes. Coordinate with Basis on resource limits.

Link
Q53

How do you expose an OData service from ABAP?

Experienced

Classic projects use the SAP Gateway Service Builder (SEGW) to model and implement OData V2 services, or reference CDS views with @OData.publish (obsolete for new development). Modern development uses RAP: define a service definition over projection views and create a service binding for OData V2 or V4, UI or Web API. The service is then published and consumed by Fiori elements or external clients.

Link
Coding

SAP ABAP Coding Interview Questions with Examples

Practical ABAP coding interview questions with short, modern code samples. Interviewers often ask you to write or explain code like this on a whiteboard or screen share.

12 questions
Q54

How do you declare and populate an internal table using modern syntax?

Coding

Define a type, create the table with VALUE and loop with an inline declaration. A sorted table with a unique key prevents duplicates and gives fast key access.

ABAP
TYPES: BEGIN OF ty_stock,
         matnr TYPE matnr,
         werks TYPE werks_d,
         qty   TYPE i,
       END OF ty_stock,
       tt_stock TYPE SORTED TABLE OF ty_stock WITH UNIQUE KEY matnr werks.

DATA(lt_stock) = VALUE tt_stock(
  ( matnr = 'MAT-100' werks = '1000' qty = 25 )
  ( matnr = 'MAT-200' werks = '1000' qty = 40 ) ).

LOOP AT lt_stock ASSIGNING FIELD-SYMBOL(<ls_stock>) WHERE qty < 30.
  <ls_stock>-qty = <ls_stock>-qty + 10.   " changes the table row directly
ENDLOOP.
Link
Q55

How do you read a row safely with a table expression?

Coding

A table expression raises CX_SY_ITAB_LINE_NOT_FOUND if no row matches. Check with line_exists, catch the exception, or use OPTIONAL/DEFAULT in a VALUE expression.

ABAP
IF line_exists( lt_stock[ matnr = 'MAT-100' werks = '1000' ] ).
  DATA(ls_row) = lt_stock[ matnr = 'MAT-100' werks = '1000' ].
ENDIF.

TRY.
    DATA(lv_qty) = lt_stock[ matnr = 'MAT-999' werks = '1000' ]-qty.
  CATCH cx_sy_itab_line_not_found.
    lv_qty = 0.
ENDTRY.

DATA lv_qty2 TYPE i.
lv_qty2 = VALUE #( lt_stock[ matnr = 'MAT-999' werks = '1000' ]-qty OPTIONAL ).
Link
Q56

How do you use FOR ALL ENTRIES correctly?

Coding

Always check that the driver table is not empty; otherwise the WHERE condition on it is ignored and all rows are selected. FOR ALL ENTRIES also removes duplicate result rows, so select the full key to avoid losing data.

ABAP
SELECT vbeln, kunnr, erdat
  FROM vbak
  WHERE erdat IN @s_erdat
  INTO TABLE @DATA(lt_orders).

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.
Link
Q57

How would you write a join in ABAP SQL instead of nested SELECTs?

Coding
ABAP
SELECT h~vbeln, h~kunnr, i~posnr, i~matnr, i~netwr
  FROM vbak AS h
  INNER JOIN vbap AS i ON i~vbeln = h~vbeln
  WHERE h~erdat IN @s_erdat
  ORDER BY h~vbeln, i~posnr
  INTO TABLE @DATA(lt_order_items).

One database round trip replaces a SELECT inside a LOOP, which reduces database calls dramatically for large volumes.

Link
Q58

How do you remove duplicate entries from an internal table?

Coding

Sort by the fields that define a duplicate, then delete adjacent duplicates comparing those fields.

ABAP
SORT lt_items BY matnr.
DELETE ADJACENT DUPLICATES FROM lt_items COMPARING matnr.

If you only need distinct values from the database, use SELECT DISTINCT instead of reading everything first.

Link
Q59

How do you display data in an ALV with CL_SALV_TABLE?

Coding
ABAP
SELECT carrid, connid, fldate, price, currency
  FROM sflight
  ORDER BY carrid, connid, fldate
  INTO TABLE @DATA(lt_flights)
  UP TO 100 ROWS.

TRY.
    cl_salv_table=>factory(
      IMPORTING r_salv_table = DATA(lo_alv)
      CHANGING  t_table      = lt_flights ).
    lo_alv->get_functions( )->set_all( abap_true ).
    lo_alv->get_columns( )->set_optimize( abap_true ).
    lo_alv->display( ).
  CATCH cx_salv_msg INTO DATA(lx_salv).
    DATA(lv_text) = lx_salv->get_text( ).
    MESSAGE lv_text TYPE 'I'.
ENDTRY.
Link
Q60

How do you call a BAPI and handle commit and errors?

Coding

Check the RETURN table for messages of type E or A; commit only when there are none.

ABAP
DATA: ls_header TYPE bapiache09,
      lt_gl     TYPE STANDARD TABLE OF bapiacgl09,
      lt_amount TYPE STANDARD TABLE OF bapiaccr09,
      lt_return TYPE STANDARD TABLE OF bapiret2.

" ... fill header, G/L lines and amounts ...

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
  EXPORTING
    documentheader = ls_header
  TABLES
    accountgl      = lt_gl
    currencyamount = lt_amount
    return         = lt_return.

IF line_exists( lt_return[ type = 'E' ] ) OR line_exists( lt_return[ type = 'A' ] ).
  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = abap_true.
ENDIF.
Link
Q61

How do you implement polymorphism with an interface?

Coding
ABAP
INTERFACE lif_discount.
  TYPES ty_amount TYPE p LENGTH 15 DECIMALS 2.
  METHODS apply
    IMPORTING iv_amount        TYPE ty_amount
    RETURNING VALUE(rv_amount) TYPE ty_amount.
ENDINTERFACE.

CLASS lcl_percent_discount DEFINITION.
  PUBLIC SECTION.
    INTERFACES lif_discount.
    METHODS constructor IMPORTING iv_percent TYPE i.
  PRIVATE SECTION.
    DATA mv_percent TYPE i.
ENDCLASS.

CLASS lcl_percent_discount IMPLEMENTATION.
  METHOD constructor.
    mv_percent = iv_percent.
  ENDMETHOD.

  METHOD lif_discount~apply.
    rv_amount = iv_amount * ( 100 - mv_percent ) / 100.
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  DATA lo_discount TYPE REF TO lif_discount.
  lo_discount = NEW lcl_percent_discount( 10 ).
  DATA(lv_net) = lo_discount->apply( CONV #( 1000 ) ).

Another class, such as a fixed-amount discount, can implement the same interface; the calling code does not change.

Link
Q62

How do you aggregate values per key using GROUP BY and REDUCE?

Coding
ABAP
SELECT vbeln, kunnr, netwr
  FROM vbak
  WHERE erdat IN @s_erdat
  INTO TABLE @DATA(lt_orders).

TYPES: BEGIN OF ty_total,
         kunnr TYPE kunnr,
         netwr TYPE netwr_ak,
       END OF ty_total.
DATA lt_totals TYPE SORTED TABLE OF ty_total WITH UNIQUE KEY kunnr.

LOOP AT lt_orders INTO DATA(ls_order)
     GROUP BY ls_order-kunnr INTO DATA(lv_customer).
  INSERT VALUE #( kunnr = lv_customer
                  netwr = REDUCE netwr_ak( INIT s = VALUE netwr_ak( )
                                           FOR m IN GROUP lv_customer
                                           NEXT s = s + m-netwr ) )
         INTO TABLE lt_totals.
ENDLOOP.
Link
Q63

How do you define a CDS view entity with associations?

Coding
ABAP
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales order header'
define view entity ZI_SalesOrderHeader
  as select from vbak
  association [0..*] to ZI_SalesOrderLine as _Item
    on $projection.SalesOrder = _Item.SalesOrder
  association [0..1] to I_Customer as _Customer
    on $projection.SoldToParty = _Customer.Customer
{
  key vbeln as SalesOrder,
      erdat as CreationDate,
      kunnr as SoldToParty,
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      netwr as NetAmount,
      waerk as TransactionCurrency,
      _Item,
      _Customer
}

This example reads a table directly for illustration. Under clean core, build on released VDM views such as I_SalesOrder where they meet the requirement, and add a DCL role because the view declares #CHECK.

Link
Q64

How do you write an AMDP method?

Coding
ABAP
CLASS zcl_sales_totals DEFINITION PUBLIC FINAL CREATE PUBLIC.
  PUBLIC SECTION.
    INTERFACES if_amdp_marker_hdb.
    TYPES: BEGIN OF ty_total,
             kunnr TYPE kunnr,
             waerk TYPE waerk,
             netwr TYPE netwr_ak,
           END OF ty_total,
           tt_total TYPE STANDARD TABLE OF ty_total WITH EMPTY KEY.
    CLASS-METHODS get_totals
      IMPORTING VALUE(iv_client) TYPE mandt
                VALUE(iv_from)   TYPE erdat
      EXPORTING VALUE(et_total)  TYPE tt_total.
ENDCLASS.

CLASS zcl_sales_totals IMPLEMENTATION.
  METHOD get_totals BY DATABASE PROCEDURE
                    FOR HDB LANGUAGE SQLSCRIPT
                    OPTIONS READ-ONLY
                    USING vbak.
    et_total = SELECT kunnr, waerk, SUM( netwr ) AS netwr
                 FROM vbak
                WHERE mandt = :iv_client
                  AND erdat >= :iv_from
                GROUP BY kunnr, waerk;
  ENDMETHOD.
ENDCLASS.
Link
Q65

How do you implement a validation in a RAP behaviour implementation?

Coding

Behaviour definition (excerpt):

ABAP
managed implementation in class zbp_i_travel unique;
strict ( 2 );

define behavior for ZI_Travel alias Travel
persistent table ztravel
lock master
authorization master ( instance )
etag master LastChangedAt
{
  create;
  update;
  delete;

  field ( readonly, numbering : managed ) TravelUUID;
  field ( mandatory ) CustomerID, BeginDate, EndDate;

  validation validateDates on save { create; field BeginDate, EndDate; }
  action acceptTravel result [1] $self;

  mapping for ztravel corresponding;
}

Validation method in the behaviour pool:

ABAP
METHOD validateDates.
  READ ENTITIES OF zi_travel IN LOCAL MODE
    ENTITY Travel
      FIELDS ( BeginDate EndDate ) WITH CORRESPONDING #( keys )
    RESULT DATA(lt_travel).

  LOOP AT lt_travel INTO DATA(ls_travel).
    IF ls_travel-EndDate < ls_travel-BeginDate.
      APPEND VALUE #( %tky = ls_travel-%tky ) TO failed-travel.
      APPEND VALUE #( %tky             = ls_travel-%tky
                      %msg             = new_message_with_text(
                                           severity = if_abap_behv_message=>severity-error
                                           text     = 'End date must not be before begin date' )
                      %element-EndDate = if_abap_behv=>mk-on )
             TO reported-travel.
    ENDIF.
  ENDLOOP.
ENDMETHOD.

Real projects use message classes instead of literal texts so messages can be translated.

Link
Scenario

SAP ABAP Scenario-Based Interview Questions

Real-time ABAP scenario questions from development and support projects. Explain how you diagnose first, then how you fix and prevent the issue.

12 questions
Q66

How would you troubleshoot a slow-running ABAP report?

Scenario
  1. Reproduce and measure – note the selection, data volume and runtime; check whether it is slow for all inputs or only some.
  2. Find where the time goes – run SAT for ABAP versus database time and ST05 for SQL statements (or ST12 for both). In production, check SQLM/SWLT data.
  3. Typical database issues – SELECT inside loops, SELECT *, missing WHERE conditions, no suitable index, FOR ALL ENTRIES with an empty or duplicate-heavy driver table, repeated identical reads.
  4. Typical ABAP issues – nested loops on standard tables, READ TABLE without binary search or a sorted/hashed key, copying large rows instead of using field symbols, unnecessary conversions.
  5. Fix – use joins or CDS views, aggregate in the database, select only required fields, use sorted or hashed tables or secondary keys, buffer master data reads, and process in packages or parallel if needed.
  6. Verify – compare runtime and trace results before and after, and test with production-like volumes.
Link
Q67

A program dumps in production. How do you approach it?

Scenario

Open the dump in ST22 and read the runtime error, exception class, the source position and the "What happened" and "Error analysis" sections. Check the variable values and call stack, reproduce in quality with similar data, and look for recent transports affecting the program. Typical causes include CX_SY_ITAB_LINE_NOT_FOUND, conversion errors, division by zero, TIME_OUT and TSV_TNEW_PAGE_ALLOC_FAILED (memory). Fix the root cause, add proper exception handling and transport through the normal path.

Link
Q68

A BAPI returns a success message but the document is not saved. What happened?

Scenario

Most likely BAPI_TRANSACTION_COMMIT was not called, or the program ended or rolled back before the commit. Check whether any E or A messages were overlooked in the RETURN table, whether the commit happens within the same LUW, and whether subsequent logic reads the document before a synchronous commit (wait = abap_true). Also check SM13 for failed update records.

Link
Q69

A business user needs an additional field in a standard S/4HANA app and table. How do you deliver it?

Scenario

Check first whether key user extensibility fits: the *Custom Fields* app can add fields to supported business contexts and propagate them to UIs, CDS views, APIs and reports, and *Custom Logic* can fill them through released BAdIs. If developer extensibility is needed, use released extension includes and CDS view extensions (EXTEND VIEW ENTITY) or, for classic objects, append structures. Avoid modifications.

Link
Q70

Standard SAP behaviour needs to change for one company code. How do you implement it?

Scenario

Find an appropriate BAdI or enhancement spot, preferably a released one. Implement it with a filter or check on the company code so other company codes are unaffected, keep the logic in a class that can be unit tested, and document the business reason. If no enhancement exists, discuss alternatives with the functional team before considering an implicit enhancement or, as a last resort, a registered modification.

Link
Q71

How would you prepare custom code for an SAP S/4HANA conversion?

Scenario
  • Collect usage data (for example with SCMON or usage logging) to identify unused custom code and decommission it.
  • Run ATC with S/4HANA readiness checks against the simplification database to find affected code, such as access to changed tables or removed transactions.
  • Use the *Custom Code Migration* app or ATC results to plan remediation, with quick fixes in ABAP Development Tools where available.
  • Fix database-related issues (for example missing ORDER BY assumptions with HANA) and performance hotspots.
  • Test thoroughly, and plan to move extensions towards released APIs and clean core over time.
Link
Q72

Inbound IDocs are failing with status 51. What do you do?

Scenario

Status 51 means application document not posted. Check the status messages in WE02/WE05 to see the error, such as missing master data, a closed period or a mapping issue. Correct the data or configuration, and reprocess the IDoc with BD87. If the error is in a custom function module or user exit, debug it with the IDoc test tools (WE19). For recurring errors, fix the source system or mapping and set up monitoring.

Link
Q73

A background job fails intermittently overnight. How do you analyse it?

Scenario

Check the job log in SM37 and any related dumps in ST22. Compare successful and failed runs: data volume, runtime, overlapping jobs, lock conflicts (SM12), work process availability and dependency on other jobs or interfaces. Common causes are locks from parallel jobs, timeouts for large data volumes or missing input files. Fix scheduling dependencies, add proper locking and error handling and make the job restartable.

Link
Q74

Users get "object is locked by another user" errors in a custom transaction. How do you fix it?

Scenario

Check in SM12 which user and program hold the lock and for how long. Review the custom code: locks should be set as late and released as early as possible, use the correct lock arguments (not a whole table when one document is enough), and be released after errors. Also check for orphaned locks from terminated sessions and whether the update task releases locks correctly.

Link
Q75

How would you build a custom approval app for a new business object?

Scenario

Model the data in custom tables and CDS view entities, build a managed RAP business object with draft, validations for mandatory checks, determinations for defaults and an *Approve* action with authorisation checks. Expose it via a service definition and an OData V4 UI service binding, generate a Fiori elements app with UI annotations, and integrate with SAP workflow or SAP Build Process Automation if multi-step approval is needed.

Link
Q76

The business wants to upload 50,000 records from Excel. What design do you propose?

Scenario

Prefer a standard tool such as the Migration Cockpit or a standard upload app where one exists. For a custom solution: read the file, validate all rows first (mandatory fields, formats, master data), offer a test run, post through a BAPI or released API in packages with commits per package, write a detailed log (for example application log SLG1), and run large volumes in the background. Make the program restartable so failed rows can be corrected and reprocessed.

Link
Q77

A report shows different results in production than in quality. How do you investigate?

Scenario

Compare inputs and data first: selection screen values, variants, master data and customising differences. Then check authorisations, because authority checks or CDS access control may filter data differently per user. Look for code differences from transports, table buffering effects, missing ORDER BY causing different row order, and date or time zone logic. Reproduce with the same user role and selection in quality.

Link

How to Prepare for an SAP ABAP Interview

ABAP interviews reward hands-on practice. Write code daily for a few weeks before your interview.

Understand the fundamentals

Be precise on Data Dictionary objects, internal table types, ABAP SQL, report events, modularisation and transport basics.

Learn modern ABAP

Practise inline declarations, constructor expressions, table expressions, new ABAP SQL syntax and class-based exception handling.

Practise real-world scenarios

Prepare explanations for performance tuning, dump analysis, BAPI errors, IDoc failures and enhancement design using examples from your work.

Understand integration

Know BAPIs, RFC types, IDocs, OData services and how ABAP code interacts with FI, SD and MM processes. Functional understanding sets developers apart.

Practise troubleshooting

Get comfortable with the debugger, ST22, ST05, SAT, SM37, SM12 and SM13. Many questions are "what would you check first?".

Review your project experience

For each major object you built (report, interface, enhancement, form, RAP app), prepare the requirement, design, challenges and testing approach.

Prepare your resume and project explanation

Separate classic ABAP from ABAP on HANA, CDS and RAP experience, and be ready to write code for anything listed on your resume.

Practise technical questions

Rewrite old-style code in modern syntax, build a small RAP app in a trial system and review the coding examples above. For guided practice with real scenarios, see Aplus Edtech's SAP ABAP training.

FAQ

SAP ABAP Interview FAQs

Is SAP ABAP still in demand?

Yes. S/4HANA conversions, custom code remediation, clean core extensions and RAP-based development keep ABAP developers in demand, particularly those with ABAP on HANA, CDS and RAP skills alongside classic ABAP.

What should freshers focus on for ABAP interviews?

Data Dictionary, internal tables, ABAP SQL, report events, ALV, modularisation, basic OOP and debugging. Add modern syntax and an introduction to CDS views to stand out.

What questions are asked in ABAP interviews for experienced developers?

Expect ABAP on HANA and performance, CDS view entities and access control, AMDP, RAP and OData, enhancements and BAdIs, BAPIs and IDocs, S/4HANA custom code migration and scenario questions about dumps and production issues.

Is ABAP RAP mandatory to learn now?

For new S/4HANA and SAP BTP ABAP environment development it is increasingly expected, because RAP is SAP's recommended model for transactional apps and APIs. Support roles still require classic ABAP, so learning both is the safest path.

Do ABAP developers need to know SAP functional modules?

A working understanding of the processes you develop for, such as procure-to-pay, order-to-cash and finance postings, makes you more effective and is often tested in interviews through business scenarios.

Should I learn Eclipse ADT or SE80?

Learn ABAP Development Tools in Eclipse, because CDS, RAP and ABAP Cloud development require it. SE80 and related transactions are still useful for older objects in support projects.

SAP Training

Build practical SAP ABAP skills before your interview

If several answers on this page felt unfamiliar, the gap is usually hands-on practice rather than theory. Aplus Edtech's SAP ABAP programme is instructor-led, with practice on SAP S/4HANA and real business scenarios, so you can walk an interviewer through what you configured, built or fixed.

Talk to an SAP training advisor

Share your background and target role. An advisor will explain batch timings, curriculum and the right module for you.

Explore SAP Training +91 910-8249-111

Last updated: · Prepared by the Aplus Edtech SAP training team.

Call Desk WhatsApp