InterviewPitch
ABAP interview questions

ABAP Interview Questions with Answers

Most Asked ABAP Interview Questions for Software Engineer Roles

123+ QuestionsDetailed AnswersCode ExamplesUpdated for 2026

Introduction

This page provides a comprehensive collection of SAP ABAP Interview Questions and Answers designed for students, fresh graduates, SAP consultants, and experienced ABAP developers preparing for technical interviews. The questions cover everything from basic ABAP syntax to advanced SAP development concepts used in enterprise applications. SAP ABAP (Advanced Business Application Programming) is the primary programming language used for developing applications inside SAP ERP systems. Companies using SAP require developers who understand Data Dictionary objects, Internal Tables, Reports, ALV, SmartForms, Module Pool Programming, BAPIs, BADIs, RFCs, performance tuning, debugging, and database optimization. Whether you are preparing for SAP implementation projects, support roles, S/4HANA migration interviews, or senior ABAP developer positions, these interview questions will help you revise important concepts with practical explanations. The questions are organized from beginner to advanced level, making this guide suitable for both freshers and experienced professionals.

Why ABAP?

  • Core language for SAP systems – powers the world's leading ERP platform
  • Enterprise-grade – used by thousands of companies worldwide for business-critical processes
  • Rich data handling – native support for internal tables, database access, and business objects
  • Strong integration capabilities – BAPIs, BADIs, RFCs, and IDocs for seamless system communication
  • Performance and scalability – optimized for large‑volume transactions and reporting
  • Continuous evolution – modern ABAP supports S/4HANA, CDS views, and OData services
  • High demand in the job market – SAP skills are consistently sought after in enterprise IT

Most Asked ABAP Interview Questions

Beginner
1. What is ABAP?

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.
Why developers use ABAP
  • 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.
Used by
  • SAP S/4HANA ERP systems, Custom transactional monitors, Global enterprise processes.
Beginner
2. What are modularization units?

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.

ABAP
REPORT 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.
Beginner
3. What is Open SQL?

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.

ABAP
* 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.
Beginner
4. Functional Classes vs Procedural Components?

ABAP supports two paradigms: Classical Procedural and Object-Oriented (ABAP Objects). Today, enterprise design guidelines almost exclusively mandate ABAP Objects (Classes).

ABAP
CLASS lcl_airplane DEFINITION.
  PUBLIC SECTION.
    METHODS: display_details.
ENDCLASS.

CLASS lcl_airplane IMPLEMENTATION.
  METHOD display_details.
    WRITE: / 'Displaying Flight Information'.
  ENDMETHOD.
ENDCLASS.
  • 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.
Beginner
5. What are parameters and interfaces?

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.

ABAP
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, or EXPORTING.
  • Interface signatures prevent variable reference mutations unless marked with a CHANGING statement indicator.
  • Any typed entry configuration can be mapped: single data values, structures, or dynamic internal tables.
Beginner
6. What is variable state tracking?

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.

ABAP
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 DATA instantiation declarations.
  • Never manipulate structural states without safety steps—ensure index validations are performed before row mutations.
Beginner
7. What is data structure initialization?

Internal data operations store transactional line values inside operational memories dynamically by populating internal work areas and appending them safely into memory index arrays.

ABAP
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.
Beginner
8. What is the SAP Database Buffer?

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.

  • 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.
  1. Data request triggered → The system checks if table buffers contain relevant records.
  2. If matching buffer matrices exist, data returns instantly without hitting database engines (Cache Hit).
  3. If unbuffered, queries execute directly against storage rows, populating memory caches (Sync Replication).
Beginner
9. What is user action command handling?

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.

ABAP
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.
Beginner
10. What is conditional logic execution?

Conditional logic means routing program execution paths dynamically based on business criteria evaluations using conditional statements.

ABAP
IF lv_is_logged_in = abap_true.
  WRITE 'Welcome User'.
ELSE.
  WRITE 'Please Login'.
ENDIF.
Beginner
11. What is an Internal Table loop and key in ABAP?

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.

ABAP
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.
Beginner
12. What is an Include Program block?

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.

ABAP
* 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.
Beginner
13. What is Field Symbol dereferencing?

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.

ABAP
* 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.
Beginner
14. What are Structures in ABAP?

A structure is a data object made up of multiple fields (components) of possibly different types, grouped under one name — similar to a row in a table.

ABAP
TYPES: BEGIN OF ty_employee,
         id   TYPE i,
         name TYPE string,
         dept TYPE string,
       END OF ty_employee.

DATA: ls_emp TYPE ty_employee.
ls_emp-id   = 1.
ls_emp-name = 'Akash'.
Beginner
15. What is an Internal Table?

An internal table is a dynamic, in-memory data structure that holds multiple rows of a given line type, similar to an array or list. It's one of ABAP's most powerful runtime features.

ABAP
DATA: lt_employees TYPE TABLE OF ty_employee.
APPEND ls_emp TO lt_employees.

LOOP AT lt_employees INTO DATA(ls_row).
  WRITE: / ls_row-name.
ENDLOOP.
  • Standard Table — index-based, allows duplicates, fast insert.
  • Sorted Table — kept sorted by key, efficient binary search.
  • Hashed Table — unique key, O(1) lookup, no linear index access.
Beginner
16. What are Table Types?

A table type is a reusable Data Dictionary or local definition that specifies the line type and table category (standard, sorted, hashed) for internal tables.

ABAP
TYPES: tt_employees TYPE STANDARD TABLE OF ty_employee WITH DEFAULT KEY.

DATA: lt_emp TYPE tt_employees.
Beginner
17. What is the ABAP Data Dictionary (SE11)?

The ABAP Dictionary (transaction SE11) is where you centrally define database tables, structures, views, data elements, domains, and search helps, shared consistently across the whole system.

  • Tables — physical database objects (transparent, cluster, pooled).
  • Structures — reusable field groupings without physical storage.
  • Views — logical combinations of one or more tables.
  • Data Elements & Domains — reusable semantic and technical field definitions.
Beginner
18. What are Domains and Data Elements?

A domain defines the technical properties of a field (data type, length, value range). A data element adds business semantics (field labels, documentation) on top of a domain.

ABAP
* Domain: ZDOM_STATUS (CHAR, length 1, fixed values A/I)
* Data Element: ZDE_STATUS references ZDOM_STATUS, adds field labels
* Table field: STATUS TYPE ZDE_STATUS
Beginner
19. What is a Transparent Table?

A transparent table is a database table defined in the ABAP Dictionary that has a direct one-to-one relationship with an actual physical table in the underlying database.

  • Every field corresponds directly to a database column.
  • Contrast with pooled/cluster tables, which store several logical tables inside one physical database table.
Beginner
20. What is the difference between a Structure and an Internal Table?

A structure holds exactly one row of data (like a single record). An internal table holds multiple rows, each matching the structure's line type.

ABAP
DATA: ls_emp TYPE ty_employee,      " single row
      lt_emp TYPE TABLE OF ty_employee. " multiple rows
Beginner
21. What are Views in the ABAP Dictionary?

A view is a virtual table that combines fields from one or more database tables, typically via a JOIN, without physically storing duplicate data.

  • Database View — joins tables, read access, materialized in DB.
  • Projection View — subset of fields from a single table.
  • Maintenance View — allows data entry across joined tables.
Beginner
22. What is a Search Help?

A search help (F4 help) provides users with a dropdown list of valid values for an input field, improving usability and data consistency in selection screens and dialogs.

Beginner
23. What is a Lock Object?

A lock object (created via SE11, prefixed EZ) prevents concurrent processes from modifying the same data record simultaneously, avoiding inconsistent updates.

ABAP
CALL FUNCTION 'ENQUEUE_EZLOCK_ORDER'
  EXPORTING
    order_id = lv_order_id
  EXCEPTIONS
    foreign_lock = 1
    OTHERS       = 2.
Beginner
24. What is a Function Module?

A function module is a reusable, named procedure with a formally defined interface (IMPORTING, EXPORTING, CHANGING, TABLES, EXCEPTIONS) that can be called from anywhere in the system, including via RFC.

ABAP
FUNCTION z_get_employee_name.
*"----------------------------------------------------------------------
*"  IMPORTING VALUE(IV_ID) TYPE I
*"  EXPORTING VALUE(EV_NAME) TYPE STRING
*"----------------------------------------------------------------------
  SELECT SINGLE name FROM zemployee INTO ev_name WHERE id = iv_id.
ENDFUNCTION.
Beginner
25. What is a Function Group?

A function group is a container (like a special program) that groups related function modules together and holds their shared global data and includes.

Beginner
26. What are System Fields (sy-*)?

System fields are predefined global variables maintained automatically by the runtime engine, giving access to system status, dates, and processing results.

  • sy-subrc — return code of the last statement (0 = success).
  • sy-tabix — current line index of an internal table.
  • sy-datum / sy-uzeit — current date / time.
  • sy-uname — logged-in user ID.
Beginner
27. What is the SELECT statement basics?

The SELECT statement retrieves data from database tables into ABAP variables, structures, or internal tables.

ABAP
SELECT id, name FROM zemployee
  INTO TABLE @DATA(lt_employees)
  WHERE dept = 'IT'.
Beginner
28. What is a WHERE clause in Open SQL?

The WHERE clause filters rows returned from a database query based on specified conditions, just like in standard SQL.

ABAP
SELECT * FROM zemployee INTO TABLE @DATA(lt_it_staff)
  WHERE dept = 'IT' AND status = 'A'.
Beginner
29. What are String Operations in ABAP?

ABAP provides built-in operators and functions for manipulating strings: concatenation, splitting, searching, replacing, and trimming.

ABAP
DATA(lv_full_name) = |{ lv_first } { lv_last }|.
FIND 'Akash' IN lv_full_name.
REPLACE 'Akash' IN lv_full_name WITH 'Rahul'.
Beginner
30. What is CONCATENATE / SPLIT?

CONCATENATE joins multiple strings into one; SPLIT divides a string into parts based on a separator.

ABAP
CONCATENATE 'Hello' 'World' INTO DATA(lv_greeting) SEPARATED BY space.

SPLIT lv_greeting AT space INTO DATA(lv_word1) DATA(lv_word2).
Beginner
31. What are Date and Time functions in ABAP?

ABAP provides system fields and functions for working with dates and times, useful for reporting, validation, and scheduling logic.

ABAP
DATA(lv_today) = sy-datum.
DATA(lv_now)   = sy-uzeit.

* Adding days to a date
lv_today = lv_today + 7.
Beginner
32. What is the CASE statement?

CASE evaluates a single variable against multiple possible values, similar to switch statements in other languages.

ABAP
CASE lv_status.
  WHEN 'A'. WRITE 'Active'.
  WHEN 'I'. WRITE 'Inactive'.
  WHEN OTHERS. WRITE 'Unknown'.
ENDCASE.
Beginner
33. What is a DO loop vs WHILE loop?

DO ... ENDDO repeats a fixed or indefinite number of times (often with a counter). WHILE ... ENDWHILE repeats as long as a condition remains true.

ABAP
DO 3 TIMES.
  WRITE: / 'Iteration', sy-index.
ENDDO.

WHILE lv_count < 5.
  lv_count = lv_count + 1.
ENDWHILE.
Beginner
34. What is the MESSAGE statement?

MESSAGE displays a system message to the user, sourced from a message class, with a type indicating severity (Information, Warning, Error, etc.).

ABAP
MESSAGE 'Record saved successfully' TYPE 'S'.
MESSAGE e001(zmsg_class) WITH lv_order_id.
  • I — Information
  • W — Warning
  • E — Error (stops processing)
  • S — Success
  • A — Abort
Beginner
35. What is a Selection Screen?

A selection screen is a standard input screen generated automatically for report programs, using PARAMETERS and SELECT-OPTIONS to gather user input before execution.

ABAP
PARAMETERS: p_dept TYPE string.
SELECT-OPTIONS: s_id FOR zemployee-id.
Beginner
36. What are Radio Buttons and Checkboxes on selection screens?

Selection screens can include RADIOBUTTON groups (mutually exclusive choices) and AS CHECKBOX fields (independent toggles) to capture user preferences.

ABAP
PARAMETERS: p_opt1 RADIOBUTTON GROUP grp1 DEFAULT 'X',
            p_opt2 RADIOBUTTON GROUP grp1,
            p_flag AS CHECKBOX.
Beginner
37. What is a Report Program (Type 1)?

A Type 1 (Report) Program is a classical executable ABAP program that runs top-to-bottom, typically used for listing, extracting, or processing data, often paired with a selection screen.

Beginner
38. What is a Module Pool Program (Type M)?

A Module Pool is a dialog program consisting of screens (dynpros) and PBO/PAI processing modules, used to build interactive transaction screens rather than simple linear reports.

Beginner
39. What is a Transaction Code (T-code)?

A transaction code is a short alphanumeric identifier that gives users direct access to a specific program, screen, or function within SAP, e.g. SE38, SE11, VA01.

Beginner
40. What is the difference between Report and Module Pool programs?

Reports (Type 1) run sequentially and typically end with a list output; Module Pools (Type M) are screen/dialog-driven and require an explicit transaction code, handling multiple user interaction cycles via PBO/PAI.

Intermediate
41. What is Object-Oriented ABAP (OO ABAP)?

OO ABAP (ABAP Objects) brings object-oriented concepts — classes, interfaces, inheritance, polymorphism — into ABAP, replacing older procedural constructs for modern, maintainable enterprise code.

Intermediate
42. What is a Class in ABAP Objects?

A class is a blueprint defining attributes (data) and methods (behavior). Classes can be local (inside a program) or global (created via SE24/ADT, reusable system-wide).

ABAP
CLASS zcl_employee DEFINITION.
  PUBLIC SECTION.
    METHODS: constructor IMPORTING iv_name TYPE string,
             get_name RETURNING VALUE(rv_name) TYPE string.
  PRIVATE SECTION.
    DATA: mv_name TYPE string.
ENDCLASS.

CLASS zcl_employee IMPLEMENTATION.
  METHOD constructor.
    mv_name = iv_name.
  ENDMETHOD.
  METHOD get_name.
    rv_name = mv_name.
  ENDMETHOD.
ENDCLASS.
Intermediate
43. What is an Interface in ABAP?

An interface declares a set of method signatures without implementation. Any class that implements the interface must provide its own implementation of those methods, enabling polymorphism.

ABAP
INTERFACE zif_notifier.
  METHODS: send_notification IMPORTING iv_message TYPE string.
ENDINTERFACE.

CLASS zcl_email_notifier DEFINITION.
  PUBLIC SECTION.
    INTERFACES zif_notifier.
ENDCLASS.

CLASS zcl_email_notifier IMPLEMENTATION.
  METHOD zif_notifier~send_notification.
    WRITE: / 'Email sent:', iv_message.
  ENDMETHOD.
ENDCLASS.
Intermediate
44. What is Inheritance in ABAP?

Inheritance lets a subclass reuse and extend the attributes and methods of a superclass using the INHERITING FROM clause.

ABAP
CLASS zcl_vehicle DEFINITION.
  PUBLIC SECTION.
    METHODS: display_type.
ENDCLASS.

CLASS zcl_car DEFINITION INHERITING FROM zcl_vehicle.
  PUBLIC SECTION.
    METHODS: display_type REDEFINITION.
ENDCLASS.
Intermediate
45. What is Polymorphism in ABAP?

Polymorphism allows different classes to be treated through a common interface or superclass reference, with each executing its own specific method implementation at runtime.

ABAP
DATA: lo_vehicle TYPE REF TO zcl_vehicle.
lo_vehicle = NEW zcl_car( ).
lo_vehicle->display_type( ). " calls the Car's overridden method
Intermediate
46. What is Encapsulation in ABAP?

Encapsulation restricts direct access to a class's internal data using visibility sections (PUBLIC, PROTECTED, PRIVATE), exposing only controlled access via public methods.

Intermediate
47. What are Constructors in ABAP classes?

The CONSTRUCTOR method runs automatically when an object is instantiated with NEW or CREATE OBJECT, typically used to initialize attributes. A CLASS_CONSTRUCTOR runs once per class, before its first use.

ABAP
DATA(lo_emp) = NEW zcl_employee( iv_name = 'Akash' ).
Intermediate
48. What is a Static (Class) Method vs Instance Method?

A static method (declared with CLASS-METHODS) belongs to the class itself and can be called without an instance. An instance method requires an object reference to be created first.

ABAP
CLASS zcl_util DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODS: get_timestamp RETURNING VALUE(rv_ts) TYPE timestamp.
ENDCLASS.

DATA(lv_ts) = zcl_util=>get_timestamp( ). " no instance needed
Intermediate
49. What is Exception Handling (TRY/CATCH)?

ABAP Objects supports structured exception handling using TRY / CATCH / CLEANUP / ENDTRY, catching class-based exceptions raised during execution.

ABAP
TRY.
    lv_result = 10 / lv_divisor.
  CATCH cx_sy_zerodivide INTO DATA(lo_ex).
    WRITE: / 'Error:', lo_ex->get_text( ).
ENDTRY.
Intermediate
50. What are Class-based Exceptions?

Class-based exceptions are objects derived from the global superclass CX_ROOT (or CX_STATIC_CHECK/CX_DYNAMIC_CHECK), representing structured, typed error conditions that can carry additional attributes.

ABAP
CLASS cx_insufficient_balance DEFINITION INHERITING FROM cx_static_check.
ENDCLASS.

RAISE EXCEPTION TYPE cx_insufficient_balance.
Intermediate
51. What is ALV (ABAP List Viewer)?

ALV is a standard SAP framework for displaying tabular data in a professional, interactive grid with built-in sorting, filtering, totals, and export options — sparing developers from building custom list layouts.

Intermediate
52. What is CL_GUI_ALV_GRID?

CL_GUI_ALV_GRID is the classic OO ABAP class used to display and manage an interactive ALV grid embedded inside a screen container.

ABAP
DATA: lo_alv TYPE REF TO cl_gui_alv_grid,
      lo_container TYPE REF TO cl_gui_custom_container.

CREATE OBJECT lo_container EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT lo_alv EXPORTING i_parent = lo_container.

lo_alv->set_table_for_first_display(
  EXPORTING it_fieldcatalog = lt_fieldcat
  CHANGING  it_outtab       = lt_data ).
Intermediate
53. What is a BAPI?

A BAPI (Business Application Programming Interface) is a standardized, released function module that provides stable, documented access to SAP business objects (e.g. creating a sales order, posting a document) — safe for external systems to call.

ABAP
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
  EXPORTING
    order_header_in = ls_header
  TABLES
    return          = lt_return.
Intermediate
54. What is RFC (Remote Function Call)?

RFC is SAP's protocol for calling function modules across system boundaries — between two SAP systems, or between SAP and an external application — synchronously or asynchronously.

ABAP
CALL FUNCTION 'Z_GET_EMPLOYEE_DATA'
  DESTINATION 'RFC_DEST_ERP'
  EXPORTING iv_id = lv_emp_id
  IMPORTING es_data = ls_employee.
Intermediate
55. What is a BADI (Business Add-In)?

A BADI is an object-oriented enhancement technique that lets customers implement custom logic at predefined enhancement points in standard SAP code, without modifying the original source.

ABAP
CLASS zcl_im_my_badi_impl DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC.
  PUBLIC SECTION.
    INTERFACES zif_ex_my_badi.
ENDCLASS.
Intermediate
56. What is a User Exit?

A user exit is a predefined hook (often a subroutine call, e.g. USEREXIT_...) left by SAP in standard programs, letting customers insert custom logic at that specific point without modifying core code.

Intermediate
57. What is the Enhancement Framework?

The Enhancement Framework (transaction SE18/SE19/enhancement spots) is SAP's modern extensibility mechanism, offering BAdIs, enhancement points, and implicit/explicit enhancement options directly within standard code, all upgrade-safe.

Intermediate
58. What is a Customer Exit?

A Customer Exit (via transaction SMOD/CMOD) is an older enhancement technique that groups related exits into an enhancement, activated via a project, commonly used in classic SAP ERP releases before the modern Enhancement Framework.

Intermediate
59. What is an IDoc?

An IDoc (Intermediate Document) is SAP's standard data container format used to exchange business data (orders, invoices, master data) between SAP systems or with external systems, typically via ALE.

Intermediate
60. What is ALE (Application Link Enabling)?

ALE is SAP's technology for building distributed, loosely coupled business processes across multiple SAP systems, using IDocs as the message format for asynchronous data exchange.

Intermediate
61. What is SAPscript vs Smart Forms vs Adobe Forms?

All three are SAP form-printing technologies of increasing modernity.

  • SAPscript: The oldest, text-based form tool with limited layout flexibility.
  • Smart Forms: Graphical form designer, easier maintenance, generates function modules.
  • Adobe Forms (Interactive Forms by Adobe): PDF-based, supports interactive/fillable forms and complex layouts.
Intermediate
62. What is BDC (Batch Data Communication)?

BDC is a classic technique for automating data entry by simulating user input into standard SAP transaction screens, using a batch input session or call transaction.

ABAP
PERFORM bdc_dynpro USING 'SAPMV45A' '0101'.
PERFORM bdc_field   USING 'BDC_CURSOR' 'VBAK-AUART'.
PERFORM bdc_field   USING 'VBAK-AUART' 'OR'.

CALL TRANSACTION 'VA01' USING lt_bdcdata MODE 'N'.
Intermediate
63. What is LSMW?

LSMW (Legacy System Migration Workbench) is a tool for migrating legacy data into SAP, supporting multiple methods including batch input, direct input, BAPI, and IDoc, guided by a step-based wizard.

Intermediate
64. What is a Transport Request?

A transport request packages development or customizing changes made in one SAP system (e.g. Development) so they can be released and moved consistently to other systems (Quality, Production), tracked via transaction SE09/SE10.

Intermediate
65. What is the ABAP Debugger?

The ABAP Debugger (classic or new debugger, accessed via /h or breakpoints) lets developers step through code execution line by line, inspect variable values, and diagnose runtime issues.

ABAP
BREAK-POINT.
" or a conditional breakpoint:
BREAK-POINT ID zbreak_group.
Intermediate
66. What is Authorization Check (AUTHORITY-CHECK)?

AUTHORITY-CHECK verifies whether the current user has the required authorization (via roles/profiles) to perform a specific action, based on authorization objects and fields.

ABAP
AUTHORITY-CHECK OBJECT 'ZEMP_DISP'
  ID 'ACTVT' FIELD '03'
  ID 'DEPT'  FIELD lv_dept.

IF sy-subrc <> 0.
  MESSAGE 'Not authorized' TYPE 'E'.
ENDIF.
Intermediate
67. What is a Message Class?

A message class (transaction SE91) is a collection of numbered, language-translated messages used with the MESSAGE statement, keeping user-facing text centralized and reusable.

Intermediate
68. What is SELECT ... FOR ALL ENTRIES?

FOR ALL ENTRIES performs a database SELECT using the contents of an existing internal table as filter criteria, avoiding the need for a nested loop with individual SELECTs (a major performance anti-pattern).

ABAP
SELECT * FROM zorderitem
  INTO TABLE @DATA(lt_items)
  FOR ALL ENTRIES IN @lt_orders
  WHERE order_id = @lt_orders-order_id.
  • Always check that the driver internal table is not empty before using FOR ALL ENTRIES.
  • Automatically removes duplicate WHERE values internally — be mindful when working with aggregate functions.
Intermediate
69. What is JOIN in Open SQL?

Open SQL supports INNER JOIN, LEFT OUTER JOIN, and others to combine rows from multiple database tables in a single query, based on matching key fields.

ABAP
SELECT o~order_id, c~name
  FROM zorder AS o
  INNER JOIN zcustomer AS c ON o~cust_id = c~id
  INTO TABLE @DATA(lt_result).
Intermediate
70. What is a Subquery in Open SQL?

A subquery is a SELECT statement nested inside another SELECT's WHERE clause, used to filter results based on the outcome of the inner query.

ABAP
SELECT * FROM zemployee INTO TABLE @DATA(lt_emp)
  WHERE dept_id IN ( SELECT id FROM zdept WHERE region = 'APAC' ).
Intermediate
71. What is Nested Loop vs FOR ALL ENTRIES performance?

Issuing a SELECT statement inside a LOOP AT ('nested SELECT') causes one database round-trip per iteration and is a serious performance anti-pattern. FOR ALL ENTRIES (or a JOIN) retrieves all needed data in a single round-trip instead.

Intermediate
72. What is a Work Process in SAP?

A work process is an operating-system-level process on the SAP application server that executes ABAP program logic. Types include Dialog (online user interaction), Background (batch jobs), Update, Spool, and Enqueue.

Intermediate
73. What is Background Job Scheduling (SM36/SM37)?

SAP lets you schedule ABAP programs to run unattended as background jobs, defined via transaction SM36 (create/schedule) and monitored via SM37 (job overview/logs), useful for batch processing and periodic reports.

ABAP
SUBMIT z_nightly_report
  WITH p_dept = 'IT'
  VIA JOB 'Z_NIGHTLY_JOB' NUMBER lv_job_num
  AND RETURN.
Intermediate
74. What are ABAP Unit Tests?

ABAP Unit is a built-in testing framework for writing automated unit tests against ABAP classes, using test classes marked FOR TESTING and assertion methods like cl_abap_unit_assert.

ABAP
CLASS ltc_calculator DEFINITION FOR TESTING.
  PRIVATE SECTION.
    METHODS test_addition FOR TESTING.
ENDCLASS.

CLASS ltc_calculator IMPLEMENTATION.
  METHOD test_addition.
    cl_abap_unit_assert=>assert_equals(
      act = 2 + 2
      exp = 4 ).
  ENDMETHOD.
ENDCLASS.
Intermediate
75. What are Regular Expressions (REGEX) in ABAP?

ABAP supports regular expressions for advanced pattern matching and text manipulation via statements like FIND and REPLACE with the REGEX addition, or the CL_ABAP_REGEX class.

ABAP
FIND REGEX '\d{3}-\d{4}' IN lv_phone MATCH OFFSET DATA(lv_off).

REPLACE ALL OCCURRENCES OF REGEX '\s+' IN lv_text WITH ' '.
Advanced
76. What are CDS Views (Core Data Services)?

CDS Views are modern, semantically rich data models defined in Data Definition Language (DDL) directly in the database layer, supporting associations, annotations, and calculations — foundational for SAP Fiori and S/4HANA.

ABAP
@AbapCatalog.sqlViewName: 'ZEMPV'
define view ZI_Employee as select from zemployee {
  key id,
      name,
      dept
}
Advanced
77. What is AMDP (ABAP Managed Database Procedures)?

AMDP lets developers write native database procedures (e.g. HANA SQLScript) inside ABAP classes, managed by the ABAP runtime, enabling code pushdown for performance-critical calculations.

ABAP
CLASS zcl_amdp_demo DEFINITION.
  PUBLIC SECTION.
    INTERFACES if_amdp_marker_hdb.
    METHODS get_total_sales
      IMPORTING iv_year TYPE i
      EXPORTING ev_total TYPE p
      FOR TABLE FUNCTION ztf_sales_total.
ENDCLASS.

CLASS zcl_amdp_demo IMPLEMENTATION.
  METHOD get_total_sales BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT.
    ev_total := SELECT SUM(amount) FROM sales WHERE year = :iv_year;
  ENDMETHOD.
ENDCLASS.
Advanced
78. What is Code Pushdown?

Code pushdown means moving data-intensive computation (aggregation, filtering, joins) from the ABAP application layer down into the database layer (CDS Views, AMDP), taking advantage of in-memory HANA processing power and reducing data transfer.

Advanced
79. What is an OData Service in SAP?

An OData service exposes SAP data and business logic as a RESTful API following the OData protocol, consumed by Fiori apps, mobile apps, or external systems, typically built via SAP Gateway or the RAP model.

Advanced
80. What is SAP Gateway?

SAP Gateway is the technology layer that converts backend ABAP data models into OData services, acting as the bridge between SAP business logic and modern UI technologies like Fiori.

Advanced
81. What is SAP Fiori and its relation to ABAP?

SAP Fiori is SAP's modern web-based UX design system for building responsive apps. On the backend, Fiori apps are powered by ABAP-based OData services (via Gateway or RAP) that expose the underlying business data and logic.

Advanced
82. What is RAP (RESTful ABAP Programming Model)?

RAP is SAP's current strategic model for building Fiori-ready, OData-based business applications entirely in ABAP, using CDS views, behavior definitions, and behavior implementations, replacing older Gateway-based approaches for new development.

ABAP
define behavior for ZI_Employee
alias Employee
persistent table zemployee
{
  create;
  update;
  delete;
}
Advanced
83. What is an ABAP Managed Database Procedure vs Native SQL?

Native SQL (EXEC SQL ... ENDEXEC) lets you write database-vendor-specific SQL directly, bypassing Open SQL's portability. AMDP is the modern, structured, HANA-optimized alternative that integrates cleanly with ABAP classes and supports code pushdown safely.

Advanced
84. What is Table Buffering (Full/Generic/Single Record)?

Table buffering configures how a Dictionary table's data is cached on the application server to reduce database access.

  • Full buffering: Entire table cached — best for small, rarely-changed tables.
  • Generic buffering: Buffered by a specified key prefix (partial buffering).
  • Single record buffering: Only individually accessed records are cached.
Advanced
85. What is Database Locking (SELECT ... FOR UPDATE)?

SELECT ... FOR UPDATE places a database-level lock on selected rows to prevent other transactions from modifying them until the current transaction completes, ensuring data consistency.

ABAP
SELECT SINGLE * FROM zorder INTO ls_order
  WHERE id = lv_id
  FOR UPDATE.
Advanced
86. What is Optimistic vs Pessimistic Locking?

Pessimistic locking locks a record immediately (e.g. via ENQUEUE) and holds it until the transaction finishes, blocking others. Optimistic locking allows concurrent reads and only checks for conflicts (e.g. via a timestamp/version field) at save time, offering better concurrency for less contested data.

Advanced
87. What are Internal Table Performance techniques (Hashed/Sorted/Standard)?

Choosing the right internal table type dramatically affects performance for lookups and inserts.

  • Standard Table: Fast append, linear/binary search lookup — good for sequential processing.
  • Sorted Table: Maintains sort order automatically, efficient binary search on the key.
  • Hashed Table: Constant-time key lookup, but no index-based access — best for large lookup tables.
Advanced
88. What is the difference between Hashed, Sorted, and Standard Tables?

They differ in storage, access, and key requirements.

ABAP
DATA: lt_std    TYPE STANDARD TABLE OF ty_row,
      lt_sorted TYPE SORTED TABLE OF ty_row WITH UNIQUE KEY id,
      lt_hashed TYPE HASHED TABLE OF ty_row WITH UNIQUE KEY id.
  • Standard tables allow duplicate entries and index-based access.
  • Sorted tables require a defined key and stay automatically ordered.
  • Hashed tables require a unique key and offer the fastest direct-key reads on large datasets.
Advanced
89. What are Constructor Expressions (NEW, VALUE, COND, SWITCH)?

Modern ABAP (7.40+) introduced constructor expressions for building values inline, reducing boilerplate DATA declarations and explicit assignments.

ABAP
DATA(lo_emp) = NEW zcl_employee( iv_name = 'Akash' ).

DATA(lt_table) = VALUE tt_employees( ( id = 1 name = 'Akash' )
                                      ( id = 2 name = 'Rahul' ) ).

DATA(lv_status_text) = COND string( WHEN lv_status = 'A' THEN 'Active'
                                     ELSE 'Inactive' ).

DATA(lv_label) = SWITCH string( lv_status WHEN 'A' THEN 'Active'
                                          WHEN 'I' THEN 'Inactive' ).
Advanced
90. What is Inline Declaration (DATA(...))?

Inline declarations let you declare a variable at the point of first use with DATA(var), with the type inferred automatically, reducing the need for separate up-front DATA statements.

ABAP
SELECT SINGLE name FROM zemployee INTO @DATA(lv_name) WHERE id = '1'.
LOOP AT lt_employees INTO DATA(ls_emp).
  WRITE: / ls_emp-name.
ENDLOOP.
Advanced
91. What is a Functional Method?

A functional method is one that returns a value (via RETURNING) and can therefore be used directly inline within expressions, rather than requiring a separate CALL METHOD and result variable.

ABAP
METHODS get_full_name RETURNING VALUE(rv_name) TYPE string.

" Used directly in an expression:
WRITE lo_employee->get_full_name( ).
Advanced
92. What is ABAP 7.40+ / 7.5 modern syntax overview?

Since release 7.40, ABAP added many expression-based constructs that make code more concise and functional in style.

  • Inline declarations: DATA(...), FIELD-SYMBOL(...).
  • Constructor expressions: NEW, VALUE, COND, SWITCH, REDUCE, FILTER.
  • String templates: |text { variable }|.
  • Table expressions: lt_table[ id = 1 ] for direct access without READ TABLE.
Advanced
93. What is Parallel Processing in ABAP (aRFC)?

Asynchronous RFC (aRFC) lets you call function modules in parallel work processes using STARTING NEW TASK, splitting large workloads across multiple processes to reduce total runtime for batch-heavy jobs.

ABAP
CALL FUNCTION 'Z_PROCESS_CHUNK'
  STARTING NEW TASK 'TASK1'
  PERFORMING return_handler ON END OF TASK
  EXPORTING it_chunk = lt_chunk1.
Advanced
94. What is Shared Memory / Shared Objects in ABAP?

Shared Objects (via IF_SHM_... classes) let you cache read-only or read-mostly data in a memory area shared across all work processes on an application server instance, dramatically speeding up repeated access to reference/master data.

ABAP
DATA(lo_area) = zcl_my_shared_area=>attach_for_read( ).
DATA(lv_value) = lo_area->root->get_cached_value( ).
Advanced
95. What is Memory Management (EXPORT/IMPORT TO MEMORY)?

ABAP supports passing data between programs or across transaction/session boundaries using EXPORT ... TO MEMORY ID and IMPORT ... FROM MEMORY ID, a lightweight alternative to shared objects for one-off transfers.

ABAP
EXPORT lv_user_id FROM lv_user_id TO MEMORY ID 'USER_CONTEXT'.

IMPORT lv_user_id TO lv_current_user FROM MEMORY ID 'USER_CONTEXT'.
Advanced
96. What is an Adapter/Proxy class pattern in ABAP OO?

The Adapter/Proxy pattern wraps an external or incompatible interface (e.g. a legacy function module or external RFC) behind a clean, standardized ABAP OO interface, isolating the rest of the application from the details of the underlying system.

Advanced
97. What is Test-Driven Development in ABAP (ABAP Unit + Test Doubles)?

ABAP TDD combines ABAP Unit test classes with test doubles (via CL_ABAP_TESTDOUBLE) to isolate the class under test from its real dependencies, allowing fast, repeatable, dependency-free unit tests.

ABAP
DATA(lo_double) = cl_abap_testdouble=>create( 'ZIF_EMPLOYEE_DAO' ).
cl_abap_testdouble=>configure_call( lo_double )->returning( 'Akash' ).
lo_double->get_name( 1 ).
Advanced
98. What is Code Inspector / ATC (ABAP Test Cockpit)?

Code Inspector (SCI) and its successor ATC are static code analysis tools that check ABAP code against performance, security, and best-practice rules, commonly enforced as a quality gate before transport release.

Advanced
99. What is SAP HANA-specific ABAP optimization?

Optimizing ABAP for SAP HANA focuses on minimizing data transferred to the application server, favoring code pushdown (CDS Views, AMDP), avoiding row-by-row processing, and leveraging HANA's in-memory columnar engine for aggregations and joins.

Advanced
100. What is the difference between Classic Extensibility and In-App/Side-by-Side Extensibility?

Classic extensibility (user exits, BAdIs, enhancements) modifies or extends on-premise ABAP systems directly. In-app extensibility uses SAP's Fiori-based key user tools within S/4HANA Cloud. Side-by-side extensibility builds separate apps on SAP BTP that consume APIs from the core system, keeping the core clean and upgrade-safe.

Coding Round
101. Class definition and implementation example

A simple class with a constructor and a getter method.

ABAP
CLASS zcl_product DEFINITION.
  PUBLIC SECTION.
    METHODS: constructor IMPORTING iv_price TYPE p,
             get_price RETURNING VALUE(rv_price) TYPE p.
  PRIVATE SECTION.
    DATA mv_price TYPE p.
ENDCLASS.

CLASS zcl_product IMPLEMENTATION.
  METHOD constructor.
    mv_price = iv_price.
  ENDMETHOD.
  METHOD get_price.
    rv_price = mv_price.
  ENDMETHOD.
ENDCLASS.
Coding Round
102. Interface implementation example

Implementing a shared interface across two different classes.

ABAP
INTERFACE zif_shape.
  METHODS get_area RETURNING VALUE(rv_area) TYPE f.
ENDINTERFACE.

CLASS zcl_circle DEFINITION.
  PUBLIC SECTION.
    INTERFACES zif_shape.
    DATA radius TYPE f.
ENDCLASS.

CLASS zcl_circle IMPLEMENTATION.
  METHOD zif_shape~get_area.
    rv_area = 3.14159 * radius * radius.
  ENDMETHOD.
ENDCLASS.
Coding Round
103. Exception handling example (TRY/CATCH/CLEANUP)

Handling a division error safely with cleanup logic.

ABAP
TRY.
    lv_result = lv_numerator / lv_denominator.
  CATCH cx_sy_zerodivide INTO DATA(lo_ex).
    WRITE: / 'Division error:', lo_ex->get_text( ).
  CLEANUP.
    CLEAR lv_result.
ENDTRY.
Coding Round
104. Internal table with LOOP + WHERE example

Filtering rows directly within a LOOP using a WHERE condition.

ABAP
LOOP AT lt_employees INTO DATA(ls_emp) WHERE dept = 'IT'.
  WRITE: / ls_emp-name.
ENDLOOP.
Coding Round
105. Using VALUE constructor to build a table

Building an internal table inline without explicit APPEND statements.

ABAP
DATA(lt_employees) = VALUE tt_employees(
  ( id = 1 name = 'Akash' dept = 'IT' )
  ( id = 2 name = 'Rahul' dept = 'HR' )
).
Coding Round
106. Using COND for conditional value assignment

Assigning a value inline based on a condition.

ABAP
DATA(lv_message) = COND string(
  WHEN lv_score >= 90 THEN 'Excellent'
  WHEN lv_score >= 60 THEN 'Pass'
  ELSE 'Fail'
).
Coding Round
107. Using SWITCH for value mapping

Mapping a status code to a readable label.

ABAP
DATA(lv_label) = SWITCH string( lv_status
  WHEN 'A' THEN 'Active'
  WHEN 'I' THEN 'Inactive'
  ELSE 'Unknown'
).
Coding Round
108. String concatenation with the string template (&&) operator

Combining strings using the modern string template syntax.

ABAP
DATA(lv_greeting) = |Hello, { lv_name }! Today is { sy-datum DATE = USER }.|.
Coding Round
109. Reading a single record with SELECT SINGLE

Fetching exactly one row matching a key.

ABAP
SELECT SINGLE name FROM zemployee
  INTO @DATA(lv_name)
  WHERE id = '1001'.
Coding Round
110. Reading multiple records with SELECT ... INTO TABLE

Fetching multiple rows directly into an internal table.

ABAP
SELECT id, name, dept FROM zemployee
  INTO TABLE @DATA(lt_employees)
  WHERE dept = 'IT'.
Coding Round
111. Using FOR ALL ENTRIES example

Fetching order items for a set of previously-selected orders.

ABAP
IF lt_orders IS NOT INITIAL.
  SELECT * FROM zorderitem
    INTO TABLE @DATA(lt_items)
    FOR ALL ENTRIES IN @lt_orders
    WHERE order_id = @lt_orders-order_id.
ENDIF.
Coding Round
112. JOIN example (INNER JOIN)

Joining orders with customer names in a single query.

ABAP
SELECT o~order_id, c~name AS customer_name
  FROM zorder AS o
  INNER JOIN zcustomer AS c ON o~cust_id = c~id
  INTO TABLE @DATA(lt_orders_with_names).
Coding Round
113. ALV Grid display example

Displaying an internal table as a simple ALV list using a function module.

ABAP
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    it_fieldcat = lt_fieldcat
  TABLES
    t_outtab    = lt_employees.
Coding Round
114. BAPI call example

Creating a sales order via a standard BAPI and checking the return messages.

ABAP
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
  EXPORTING
    order_header_in = ls_header
  TABLES
    order_items_in  = lt_items
    return          = lt_return.

READ TABLE lt_return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
  WRITE: / 'Order creation failed'.
ENDIF.
Coding Round
115. Function module call example

Calling a custom function module with exception handling.

ABAP
CALL FUNCTION 'Z_GET_EMPLOYEE_NAME'
  EXPORTING
    iv_id       = lv_emp_id
  IMPORTING
    ev_name     = lv_name
  EXCEPTIONS
    not_found   = 1
    OTHERS      = 2.

IF sy-subrc <> 0.
  WRITE: / 'Employee not found'.
ENDIF.
Coding Round
116. Field symbol loop example

Modifying rows in-place during a loop using a field symbol for performance.

ABAP
FIELD-SYMBOLS: <fs_emp> TYPE ty_employee.

LOOP AT lt_employees ASSIGNING <fs_emp>.
  <fs_emp>-status = 'A'.
ENDLOOP.
Coding Round
117. Authorization check example

Verifying a user's authorization before displaying sensitive employee data.

ABAP
AUTHORITY-CHECK OBJECT 'ZEMP_DISP'
  ID 'ACTVT' FIELD '03'
  ID 'DEPT'  FIELD ls_emp-dept.

IF sy-subrc <> 0.
  MESSAGE 'You are not authorized to view this record' TYPE 'E'.
ENDIF.
Coding Round
118. Background job submission example (SUBMIT)

Submitting a report to run as a background job with selection screen values.

ABAP
SUBMIT z_nightly_report
  WITH p_dept = 'IT'
  VIA JOB 'Z_NIGHTLY_JOB' NUMBER lv_job_num
  AND RETURN.

CALL FUNCTION 'JOB_CLOSE'
  EXPORTING
    jobcount  = lv_job_num
    jobname   = 'Z_NIGHTLY_JOB'
    strtimmed = 'X'.
Coding Round
119. ABAP Unit test example

A basic test class verifying a calculator method's result.

ABAP
CLASS ltc_calculator DEFINITION FOR TESTING RISK LEVEL HARMLESS.
  PRIVATE SECTION.
    METHODS test_add FOR TESTING.
ENDCLASS.

CLASS ltc_calculator IMPLEMENTATION.
  METHOD test_add.
    DATA(lv_result) = 2 + 3.
    cl_abap_unit_assert=>assert_equals( act = lv_result exp = 5 ).
  ENDMETHOD.
ENDCLASS.
Coding Round
120. CDS view definition example

A basic CDS view selecting active employees with an annotation.

ABAP
@AbapCatalog.sqlViewName: 'ZEMPACTV'
@EndUserText.label: 'Active Employees'
define view ZI_ActiveEmployee as select from zemployee {
  key id,
      name,
      dept
} where status = 'A'
Coding Round
121. AMDP method example

An AMDP method that pushes down a sum calculation to the HANA database.

ABAP
CLASS zcl_sales_amdp DEFINITION.
  PUBLIC SECTION.
    INTERFACES if_amdp_marker_hdb.
    METHODS get_total
      IMPORTING iv_year TYPE i
      EXPORTING ev_total TYPE p.
ENDCLASS.

CLASS zcl_sales_amdp IMPLEMENTATION.
  METHOD get_total BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT.
    ev_total := SELECT SUM(amount) FROM zsales WHERE year = :iv_year;
  ENDMETHOD.
ENDCLASS.
Coding Round
122. RAP behavior definition example (brief)

A minimal behavior definition enabling standard CRUD operations for a RAP business object.

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

define behavior for ZI_Employee alias Employee
persistent table zemployee
lock master
{
  create;
  update;
  delete;
  field ( readonly ) id;
}
Coding Round
123. Regex example (FIND/REPLACE with regex)

Validating and cleaning up a phone number string using regular expressions.

ABAP
IF lv_phone CP '+*'.
  " simple pattern check
ENDIF.

FIND REGEX '^\+\d{1,3}-\d{3,10}$' IN lv_phone MATCH OFFSET DATA(lv_off).
IF sy-subrc <> 0.
  WRITE: / 'Invalid phone format'.
ENDIF.

REPLACE ALL OCCURRENCES OF REGEX '[^0-9+]' IN lv_phone WITH ''.