Skip to content

ABAP Basics Interview Questions for SAP

25 ABAP Basics questions with answers for sap roles — 3 easy, 12 medium, 10 hard.

About ABAP Basics

Learn the foundations of ABAP development: the data dictionary, internal tables, modern ABAP SQL, ALV output, debugging, BAPIs and enhancement options such as BAdIs and key user extensibility. You also meet S/4HANA concepts like CDS views, code pushdown, RAP and ABAP Cloud, which define clean core development today.

Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is ABAP?

Save to ▾
Show answer
ABAP (Advanced Business Application Programming) is SAP's programming language for building reports, enhancements, interfaces, forms and services on the SAP application server. It has built-in database access through Open SQL (ABAP SQL), internal tables for in-memory data, and strong integration with the data dictionary. Modern ABAP supports object orientation, CDS views and the RAP framework, and ABAP Cloud is the restricted model for clean core development.
02

What is the ABAP Data Dictionary?

Save to ▾
Show answer
The ABAP Dictionary (transaction SE11) is the central place where database tables, views, data elements, domains, structures, table types, search helps and lock objects are defined. A domain defines technical type and value range, and a data element adds business meaning and field labels. Definitions are shared by all programs, so changes are consistent across the system and tables are created in the database on activation.
03

What are internal tables in ABAP?

Save to ▾
Show answer
Internal tables hold multiple rows of data in memory during program run time, similar to arrays of structures. Types are standard (index access, appended rows), sorted (kept sorted by key, binary search) and hashed (unique key access with constant time). Programs fill them with SELECT, then loop, read, modify or sort them. Choosing the right type matters for performance with large data.
04

What are the ways to enhance standard SAP without modifying it?

Save to ▾
Show answer
Options include user exits and customer exits (older), BAdIs (Business Add-Ins, classic and new kernel-based), implicit and explicit enhancement points, and in S/4HANA, key user extensibility with custom fields and custom logic in Fiori apps. Developer extensibility uses released objects and ABAP Cloud. Modifications through the modification assistant are the last resort because they must be checked at every upgrade.
05

What are CDS views?

Save to ▾
Show answer
Core Data Services views are data models defined in ABAP using DDL (in ADT, the Eclipse-based ABAP Development Tools). They support joins, associations, calculations, aggregations, annotations for UI and analytics, and access control with DCL. In S/4HANA they are the base for Fiori apps, analytics and APIs. Newer CDS view entities (DEFINE VIEW ENTITY) replace older DDIC-based CDS views and push logic to HANA.
06

What is the code pushdown concept?

Save to ▾
Show answer
Code pushdown means moving data-intensive logic from the ABAP application server to the HANA database, so calculations happen close to the data and only results travel. Techniques include CDS views, ABAP SQL with aggregations and expressions, and AMDP (ABAP Managed Database Procedures) written in SQLScript. Instead of selecting millions of rows and looping in ABAP, the database filters and aggregates, which improves performance a lot.
07

Write a simple ABAP report that reads purchase orders for a vendor and displays them in ALV.

Save to ▾
Show answer
Select header data with modern ABAP SQL into an inline table, then show it with the SALV class. REPORT zpo_list. PARAMETERS p_lifnr TYPE lifnr OBLIGATORY. START-OF-SELECTION. SELECT ebeln, bukrs, bedat, lifnr FROM ekko WHERE lifnr = @p_lifnr INTO TABLE @DATA(lt_po). TRY. cl_salv_table=>factory( IMPORTING r_salv_table = DATA(lo_alv) CHANGING t_table = lt_po ). lo_alv->display( ). CATCH cx_salv_msg. MESSAGE 'ALV error' TYPE 'E'. ENDTRY.
08

How do you read a single row from an internal table using modern ABAP syntax?

Save to ▾
Show answer
Use a table expression with a TRY block, or READ TABLE with a key. For sorted or hashed tables use the key for fast access. TRY. DATA(ls_po) = lt_po[ ebeln = '4500000010' ]. CATCH cx_sy_itab_line_not_found. " row not found ENDTRY. READ TABLE lt_po INTO DATA(ls_row) WITH KEY ebeln = '4500000010'. IF sy-subrc = 0. " found ENDIF.
09

Write a basic CDS view entity that shows sales order items with their header data.

Save to ▾
Show answer
A view entity joins header and item with an association and exposes fields with aliases. @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'Sales order items' define view entity ZI_SalesOrderItem as select from vbap as Item association [1..1] to vbak as _Header on $projection.SalesOrder = _Header.vbeln { key Item.vbeln as SalesOrder, key Item.posnr as SalesOrderItem, Item.matnr as Material, Item.kwmeng as OrderQuantity, _Header.kunnr as SoldToParty, _Header }
10

How do you avoid SELECT inside a LOOP in ABAP?

Save to ▾
Show answer
Read all needed rows once with a join or FOR ALL ENTRIES, then read from the internal table in the loop. SELECT ebeln, ebelp, matnr FROM ekpo WHERE ebeln IN @s_ebeln INTO TABLE @DATA(lt_items). IF lt_items IS NOT INITIAL. SELECT matnr, maktx FROM makt FOR ALL ENTRIES IN @lt_items WHERE matnr = @lt_items-matnr AND spras = @sy-langu INTO TABLE @DATA(lt_text). ENDIF. SORT lt_text BY matnr. Always check the driver table is not empty before FOR ALL ENTRIES.
11

How do you debug an ABAP program?

Save to ▾
Show answer
Set a breakpoint in the code (session or external breakpoint for web and Fiori calls), or type /h before executing. In the debugger, use single step (F5), execute (F6), return (F7) and continue (F8), watch variables, change values for testing, and view internal tables. Watchpoints stop when a variable changes. In ADT, the Eclipse debugger offers the same. Never change values in production without approval.
12

A functional consultant needs a new field on the purchase order screen. How would you deliver it cleanly?

Save to ▾
Show answer
In S/4HANA I would first try key user extensibility with the Custom Fields app, which adds the field to the database, Fiori UI, CDS views and APIs without code. If logic is needed, I use the Custom Logic app or a released BAdI. Only if these do not cover the case would I use classic enhancement such as a screen enhancement in ME21N. I document the choice for upgrade safety.
13

A program dumps in production with a TIME_OUT error. What do you do?

Save to ▾
Show answer
I check ST22 for the dump details, program, line and call stack. TIME_OUT means a dialog step exceeded the allowed run time (rdisp/max_wprun_time). I see if users ran it with very wide selections, and advise background execution as an immediate workaround. Then I trace the code with ST05 and SAT in quality with similar data, fix inefficient selects or loops, and move the fix through transports.
14

The business needs a nightly interface file of open sales orders. How would you build it?

Save to ▾
Show answer
I would write a report that selects open orders using a CDS view or ABAP SQL with proper filters, formats the data to the agreed layout, and writes the file to an application server directory or sends it through SAP Integration Suite. I would add a selection screen with variants, logging with the application log (SLG1), error notifications, and schedule it in SM36 or Application Jobs. Testing covers volume and format checks.
15

Describe how you handle code reviews.

Save to ▾
Show answer
Situation: our team had frequent production defects. Task: improve quality without slowing delivery. Action: I introduced a simple checklist covering naming, performance, error handling and ATC checks, and paired review for every transport. I kept comments respectful and focused on code, not people. Result: production defects from custom code dropped noticeably over two quarters, and juniors learned faster from review comments.
16

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

Save to ▾
Show answer
RAP is SAP's current model to build transactional Fiori apps and APIs. Developers define a CDS data model, a behavior definition with operations like create, update, delete, actions, validations and determinations, a behavior implementation in ABAP classes, and a service definition and binding to expose OData V2 or V4. RAP supports managed and unmanaged scenarios and draft handling, and it works in ABAP Cloud for clean core development.
17

What is ABAP Cloud and the tier model for extensions?

Save to ▾
Show answer
ABAP Cloud is the development model that allows only released APIs, ADT tooling and modern constructs like RAP and CDS, so code survives upgrades. SAP describes a three-tier model for S/4HANA private and on-premise: tier 1 is ABAP Cloud using released objects, tier 2 is cloud API enablement where wrappers expose unreleased functions as released ones, and tier 3 is classic ABAP for remaining needs. Teams aim to keep most new code in tier 1.
18

How do you call a BAPI to create a document and commit it safely?

Save to ▾
Show answer
Call the BAPI, check the RETURN table for errors, then commit or roll back. CALL FUNCTION 'BAPI_PO_CREATE1' EXPORTING poheader = ls_head poheaderx = ls_headx IMPORTING exppurchaseorder = lv_ebeln TABLES poitem = lt_item poitemx = lt_itemx 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.
19

How do you analyse a slow custom ABAP report?

Save to ▾
Show answer
I run a runtime trace with SAT or ST12 to see whether time goes to database or ABAP processing, and an SQL trace with ST05 to find expensive or repeated statements. Typical fixes are adding WHERE conditions on key or indexed fields, removing SELECT in loops, using sorted or hashed tables, reading only needed columns, and pushing aggregation to CDS or SQL. The SQL Monitor (SQLM) shows heavy statements in production.
20

During conversion, ATC reports thousands of findings in custom code. How do you prioritise?

Save to ▾
Show answer
I combine ATC results with usage data from SCMON or UPL so unused objects are removed first. For used objects I fix mandatory findings first, such as removed tables, changed field lengths like the 40-character material number, and syntax errors. Performance and best-practice findings come later. I group similar fixes, use quick fixes in ADT where possible, and track progress with the custom code migration app.
21

A team wants to read standard tables directly from a BTP app. What would you recommend?

Save to ▾
Show answer
I would not allow direct table access because it breaks clean core and security. I would check the SAP Business Accelerator Hub for a released OData API or event that covers the data. If none exists, I would build a custom CDS-based RAP service using released objects in the S/4HANA system and expose it through a communication arrangement, then call it from BTP through destinations with proper authentication.
22

Two users update the same custom table at the same time and data is overwritten. How do you fix it?

Save to ▾
Show answer
I would add a lock object in SE11 on the table key and call the generated ENQUEUE function before changing data and DEQUEUE after saving, so the second user gets a lock message. I also check that the update happens in one logical unit of work with proper COMMIT WORK. In RAP-based apps, managed locking and ETag handling solve this automatically.
23

Tell me about a time you pushed back on a development request.

Save to ▾
Show answer
Situation: a consultant asked me to modify a standard SAP program for a small pricing display change. Task: meet the need without upgrade risk. Action: I explained the cost of modifications, proposed a BAdI implementation and a custom field instead, and built a quick prototype. Result: the business accepted it, the change was delivered in three days, and it survived the next upgrade with no rework.
24

How do you write an aggregation in ABAP SQL so the database does the work?

Save to ▾
Show answer
Use GROUP BY and aggregate functions in the SELECT instead of looping and summing in ABAP. SELECT bukrs, gjahr, SUM( hsl ) AS amount FROM acdoca WHERE rldnr = '0L' AND bukrs IN @s_bukrs AND gjahr = @p_gjahr GROUP BY bukrs, gjahr INTO TABLE @DATA(lt_totals). Only the totals travel to the application server, which is far faster than reading every line item of the Universal Journal.
25

A custom report shows different totals in development and quality for the same logic. What do you check?

Save to ▾
Show answer
I first confirm both systems have the same transport version of the program using version comparison. Then I compare the data itself, because test data, client settings and customizing differ between systems. I check selection screen defaults, user parameters such as company code, authorization-based filtering in CDS access control, and currency or unit conversion. Debugging with the same input on both systems usually shows the difference quickly.

Frequently asked questions

How important is ABAP Basics in SAP interviews?

Learn the foundations of ABAP development: the data dictionary, internal tables, modern ABAP SQL, ALV output, debugging, BAPIs and enhancement options such as BAdIs and key user extensibility. You also meet S/4HANA concepts like CDS views, code pushdown, RAP and ABAP Cloud, which define clean core development today.

How should I use the ABAP Basics sheet?

Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.