SAP ABAP Interview Questions (1 - 10)
What is SAP ABAP?
SAP ABAP is the programming language used in SAP to develop and customize business applications. It is mainly used to create reports, interfaces, forms, and enhancements within SAP systems. In simple terms, ABAP helps developers build and modify SAP functionality based on business requirements.
Why interview questions are important?
Interview questions are important to test both your coding knowledge and real-time problem-solving skills. They help interviewers understand how well you can write programs, debug issues, and handle real business scenarios in SAP.
What the reader will learn?
In this guide, you’ll learn top SAP ABAP interview questions along with clear, beginner-friendly answers commonly asked in real interviews. You’ll understand key concepts, coding approaches, and practical usage behind each answer, including simple examples where needed. By the end, you’ll be ready to confidently answer ABAP interview questions and handle real project scenarios.
1. What is SAP ABAP and its role in SAP systems?
SAP ABAP (Advanced Business Application Programming) is the programming language used to build applications inside SAP systems. It is mainly used to create reports, interfaces, forms, enhancements, and business logic on top of SAP modules like SAP PP, MM, SD, etc.
2. What is the architecture of SAP (3-tier architecture)?
The SAP 3-tier architecture consists of three layers:
- Presentation Layer – This is the user interface (like SAP GUI or SAP Fiori) where users interact with the system.
- Application Layer – This layer processes the business logic, executes programs, and handles user requests.
- Database Layer – This layer stores all the data and retrieves it when required.
3. What is the difference between Open SQL and Native SQL?
Open SQL is the SAP standard SQL used inside ABAP programs, and it works on different databases supported by SAP. Native SQL is database-specific, so it directly talks to a particular database and may not work the same everywhere.
Open SQL is preferred in normal SAP development because it is safer and more portable.
" Open SQL
SELECT carrid, carrname
FROM scarr
INTO TABLE @DATA(it_scarr).
" Native SQL
EXEC SQL.
SELECT CARRID, CARRNAME
INTO :lv_carrid, :lv_carrname
FROM SCARR
ENDEXEC.
4. What is Data Dictionary (DDIC) and why is it important?
The ABAP Data Dictionary, or DDIC, is the central place where SAP stores table definitions, views, domains, data elements, and structures. It helps keep data definitions consistent, so different programs can use the same field types and meanings. This is important as it improves reusability, reduces errors, and makes maintenance much easier.
5. Difference between Transparent, Cluster, and Pooled tables?
A transparent table has a direct one-to-one relation with a database table, so what you define in SAP is what exists in the database. Cluster and pooled tables were older SAP table types where multiple SAP tables were stored together in the database. In modern SAP systems, transparent tables are the main type used, and cluster/pooled tables are mostly considered old concepts.
6. What is Internal Table? Types of internal tables?
An internal table is a temporary table stored in memory while the ABAP program is running. It is used to hold multiple rows of data so the program can process them without going to the database again and again.
Types of Internal Tables:
- Standard Table – Default type, stores data in normal order and is good for general use, but searching can be slower if the table is large.
- Sorted Table – Automatically sorted by key, faster search using binary search.
- Hashed Table – Uses hash algorithm, fastest access with unique key (no duplicates allowed), but it does not allow index-based access like standard tables.
DATA: it_std TYPE STANDARD TABLE OF scarr WITH DEFAULT KEY,
it_srt TYPE SORTED TABLE OF scarr WITH UNIQUE KEY carrid,
it_hsh TYPE HASHED TABLE OF scarr WITH UNIQUE KEY carrid.
For large data search, use hashed table for fast access. For sorted output, use sorted table. For simple cases, use standard table.
7. What is the difference between Work Area and Field Symbol?
A work area stores a copy of one row from an internal table, so data is moved into it before use. A field symbol acts like a reference or pointer, so it directly points to the existing row in memory instead of copying it. Because of that, field symbols are often faster and are commonly used in loops for better performance.
DATA: it_scarr TYPE TABLE OF scarr,
wa_scarr TYPE scarr.
FIELD-SYMBOLS: <fs_scarr> TYPE scarr.
LOOP AT it_scarr INTO wa_scarr.
WRITE: / wa_scarr-carrid.
ENDLOOP.
LOOP AT it_scarr ASSIGNING <fs_scarr>.
WRITE: / <fs_scarr>-carrid.
ENDLOOP.
8. What is Modularization in ABAP?
Modularization means dividing a large ABAP program into smaller and manageable parts. This makes the code easier to read, test, reuse, and debug. In ABAP, common modularization techniques are FORM routines, function modules, methods, and includes.
PERFORM display_data.
FORM display_data.
WRITE: / 'Displaying data...'.
ENDFORM.
9. What is the difference between FORM and FUNCTION MODULE?
A FORM routine is local to the program and is mainly used for small reusable logic within the same program. A function module is created separately in a function group and can be reused by many programs. Function modules are better when you need parameter handling, exception handling, and cross-program reuse.
* FORM example
FORM add_numbers USING a b.
DATA result TYPE i.
result = a + b.
WRITE result.
ENDFORM.
PERFORM add_numbers USING 5 10.
* Function Module call example
CALL FUNCTION 'Z_ADD_NUMBERS'
EXPORTING
a = 5
b = 10
IMPORTING
result = lv_result.
10. What is Object-Oriented ABAP (OOABAP)?
OOABAP means writing ABAP programs using classes and objects instead of only procedural code. It supports concepts like encapsulation, inheritance, and polymorphism, which help organize code better. Modern SAP development uses OOABAP a lot because it makes programs cleaner, reusable, and easier to maintain.
CLASS lcl_demo DEFINITION.
PUBLIC SECTION.
METHODS: say_hello.
ENDCLASS.
CLASS lcl_demo IMPLEMENTATION.
METHOD say_hello.
WRITE: / 'Hello from OOABAP'.
ENDMETHOD.
ENDCLASS.
DATA lo_demo TYPE REF TO lcl_demo.
CREATE OBJECT lo_demo.
lo_demo->say_hello( ).