Land the job you want — prepare
with Real interviews Q&A
Curated interview questions, company-wise guides and coding rounds. Practice mock interviews, improve with feedback, and track your progress.
ABAP stands for Advanced Business Application Programming. It is a high-level programming language created by SAP used for building business applications, customization, and data processing execution modules within the SAP ecosystem environment.
ABAP lets you manage data layer interactions efficiently via built-in database tools and construct structured execution architectures like transaction monitors, screens, batch workflows, and interactive report outputs.
Key ideas in ABAP- Data Types & Dictionary: Central definitions of databases, views, and data types (SE11).
- Open SQL: DB-independent syntax that lives natively inside ABAP.
- Internal Tables: Highly efficient dynamic arrays stored directly in memory during runtime.
- Modularization: Code reuse components such as Methods, Subroutines (Forms), and Function Modules.
- Event-Driven Processing: Processing segments bound directly to runtime engine hooks.
- Deep integration with SAP enterprise application business logic layers.
- Database independence out-of-the-box via Open SQL architecture translations.
- Robust framework capabilities managing vast structures of concurrent business records.
- Backward compatibility guarantees spanning multiple decades of SAP server upgrades.
- SAP S/4HANA ERP systems, Custom transactional monitors, Global enterprise processes.
In ABAP, modularization units are functional blocks used to split up monolithic application structures into reusable, distinct blocks of logic. Think of them like LEGO blocks—each module controls a designated functional element (Methods, Subroutines, Function Modules) that can be called repeatedly.
Example of a Modularization StructureREPORT z_welcome_message.
WRITE 'Welcome to ABAP Development'.- z_welcome_message is an executable report context.
- It outputs data directly to the user screen layout list.
- You can reuse logic paths by isolating routines using subroutines or methods.
Open SQL is a standardized subset of database manipulation commands written natively inside ABAP. It abstracts underlying vendor database layers, allowing code to operate identically whether running over SAP HANA, Oracle, or SQL Server. Modern ABAP applications feature inline data declaration tags using the @DATA(...) mechanism.
* Classical Open SQL (Older Syntax)
SELECT SINGLE name FROM zusers INTO lv_name WHERE id = '1'.
* New Open SQL Syntax (With Inline Declaration)
SELECT SINGLE name FROM zusers WHERE id = '1' INTO @DATA(lv_name).- Open SQL automatically validates object targets against the SAP Data Dictionary definitions.
- Use host variable escapes
@when matching variables within inline syntax commands. - Target variables and structures are populated in memory safely via transactional buffers.
ABAP supports two paradigms: Classical Procedural and Object-Oriented (ABAP Objects). Today, enterprise design guidelines almost exclusively mandate ABAP Objects (Classes).
Object-Oriented ClassesGlobal or local object structures that support encapsulation, polymorphism, inheritance, and clear method access controls.
CLASS lcl_airplane DEFINITION.
PUBLIC SECTION.
METHODS: display_details.
ENDCLASS.
CLASS lcl_airplane IMPLEMENTATION.
METHOD display_details.
WRITE: / 'Displaying Flight Information'.
ENDMETHOD.
ENDCLASS.Functional routines using FORM...ENDFORM contexts that are discouraged in modern development stacks.
- Modern ABAP Objects access system states cleanly using Methods and event triggers.
- Classical engines rely on global lifecycle include parameters and subroutines.
- Object-Oriented methods provide strict parameter checks, explicit visibility scoping, and simplified unit testing setups.
Parameters are variables used to pass external data payloads across component boundaries, such as from a calling report execution into a targeted functional block or method subroutine interface.
FORM display_user USING pv_name TYPE string.
WRITE: / 'Hello', pv_name.
ENDFORM.
PERFORM display_user USING 'Akash'.- Parameters explicitly declare value assignments via
USING,IMPORTING, orEXPORTING. - Interface signatures prevent variable reference mutations unless marked with a
CHANGINGstatement indicator. - Any typed entry configuration can be mapped: single data values, structures, or dynamic internal tables.
State represents the variable data held inside your system work process memory context at runtime. When processing values change, conditional statements steer execution flows accordingly.
State = values that change over program execution duration. Examples: loop counters, application status switches, screen configuration values, or loaded database buffers.
DATA: lv_counter TYPE i VALUE 0.
DO 5 TIMES.
lv_counter = lv_counter + 1.
WRITE: / 'Current Count:', lv_counter.
ENDDO.- State is managed inside programs using explicit
DATAinstantiation declarations. - Never manipulate structural states without safety steps—ensure index validations are performed before row mutations.
Internal data operations store transactional line values inside operational memories dynamically by populating internal work areas and appending them safely into memory index arrays.
DATA: lt_customers TYPE TABLE OF zcustomer,
ls_customer TYPE zcustomer.
ls_customer-id = '1001'.
ls_customer-name = 'Akash'.
APPEND ls_customer TO lt_customers.DATA: lt_...— initializes a collection array framework internally.ls_...— creates an individual structural work area matching layout specifications.APPEND ... TO ...— commits structural states down into targeted list structures.
The SAP Database Buffer acts as an intermediate performance layer managed in the application server instance memory. It avoids excessive overhead costs by minimizing direct calls to database disks.
How it works- Data request triggered → The system checks if table buffers contain relevant records.
- If matching buffer matrices exist, data returns instantly without hitting database engines (Cache Hit).
- If unbuffered, queries execute directly against storage rows, populating memory caches (Sync Replication).
- Direct physical disk operations add significant execution latency.
- The buffering model reduces network traffic between application and database layers.
- Results in faster, enterprise-grade application response times.
User interface flows require tracking interactive actions like mouse clicks, menu selections, screen transitions, and button inputs. These are managed within transactional screen processing blocks.
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT'.
LEAVE TO SCREEN 0.
WHEN 'SAVE'.
PERFORM save_data.
ENDCASE.
ENDMODULE.sy-ucomm— holds the system user command trigger code values.AT SELECTION-SCREEN— validates data entry parameter fields.AT USER-COMMAND— intercepts menu or output list clicks.PBO (Process Before Output)— configures screen states before rendering.PAI (Process After Input)— handles user interactions on a screen.
ABAP utilizes system fields (like sy-ucomm) to track runtime states and interaction details automatically.
Conditional logic means routing program execution paths dynamically based on business criteria evaluations using conditional statements.
IF lv_is_logged_in = abap_true.
WRITE 'Welcome User'.
ELSE.
WRITE 'Please Login'.
ENDIF.ABAP iterates over rows in internal tables using the LOOP AT structural command. To optimize data access, tables should be defined with an explicit KEY type configuration.
INITIALIZATION.
lv_status = 'INITIALIZED'.
START-OF-SELECTION.
PERFORM fetch_data.- Table keys must match structural criteria configurations uniformly.
- Use
ASSIGNING <field_symbol>instead of copying lines to work areas to maximize performance. - Proper table keys help the runtime engine find specific records instantly.
An Include Program is a global modularization block used to group source code across files. It lets you split large programs into manageable source files without creating standalone runtime entry overheads.
* Triggered before selection screen displays
INITIALIZATION.
* Triggered when selection screen outputs (modify screen fields)
AT SELECTION-SCREEN OUTPUT.
* Triggered when core execution begins
START-OF-SELECTION.
* Triggered when database processing ends, before output list layout
END-OF-SELECTION.- Keeps application frameworks clean by separating data declarations from logic layers.
- Short syntax declaration wrapper:
INCLUDE z_my_program_top. - Include programs cannot be executed independently; they must belong to a host report or module pool.
A Field Symbol acts as a memory pointer to an existing data object. Modifying a field symbol updates the underlying data value in memory directly, without the performance cost of a copy operation.
* Modifying global data inside procedural includes without parameters
PERFORM calculate_total. " Relies heavily on globally shared structures
* Encapsulated alternative passing parameters explicitly
PERFORM calculate_total USING lv_quantity
CHANGING lv_total.- Accessing live memory allocations dynamically without copying records.
- Modifying internal table records directly during loop processing.
- Handling dynamic structure components whose types are unknown until runtime.