Understand the fundamentals
Be precise on Data Dictionary objects, internal table types, ABAP SQL, report events, modularisation and transport basics.
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.
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.
Foundational ABAP interview questions on the language, the Data Dictionary, internal tables, ABAP SQL and reports.
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.
LinkThe 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.
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.
LinkA 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.
An internal table is a dynamic, in-memory table used to process sets of data in a program.
BINARY SEARCH.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).
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.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 @.
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.
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.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.
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.
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.
LinkSY-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.
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.
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.
LinkTYPE 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.
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.
Interview questions for developers with project exposure: ALV, BAPIs, data migration, enhancements, forms, IDocs, RFC, the update task and object-oriented ABAP.
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.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.
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.
LinkCall 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.
SE18/SE19) and new kernel BAdIs within the enhancement framework.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.
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.
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.
LinkAn 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.
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.
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.
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.
PUBLIC, PROTECTED, PRIVATE) hide implementation details.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.
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.
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.
Experienced-level ABAP interview questions on ABAP on HANA, CDS view entities, AMDP, RAP, clean core, performance and modern syntax.
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.
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.
LinkDDIC-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.
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.
LinkThe 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.
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.
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.
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.
LinkRAP 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:
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.
LinkDraft 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.
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.
FAILED and REPORTED.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.
LinkInline 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.
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.ST22 and SM50/SM66 – dumps and running work processes.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.
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.
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.
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.
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.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.
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 ).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.
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.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.
Sort by the fields that define a duplicate, then delete adjacent duplicates comparing those fields.
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.
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.Check the RETURN table for messages of type E or A; commit only when there are none.
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.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.
LinkSELECT 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.@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.
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.Behaviour definition (excerpt):
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:
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.
LinkReal-time ABAP scenario questions from development and support projects. Explain how you diagnose first, then how you fix and prevent the issue.
SAT for ABAP versus database time and ST05 for SQL statements (or ST12 for both). In production, check SQLM/SWLT data.SELECT inside loops, SELECT *, missing WHERE conditions, no suitable index, FOR ALL ENTRIES with an empty or duplicate-heavy driver table, repeated identical reads.READ TABLE without binary search or a sorted/hashed key, copying large rows instead of using field symbols, unnecessary conversions.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.
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.
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.
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.
LinkSCMON or usage logging) to identify unused custom code and decommission it.ORDER BY assumptions with HANA) and performance hotspots.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.
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.
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.
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.
LinkPrefer 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.
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.
ABAP interviews reward hands-on practice. Write code daily for a few weeks before your interview.
Be precise on Data Dictionary objects, internal table types, ABAP SQL, report events, modularisation and transport basics.
Practise inline declarations, constructor expressions, table expressions, new ABAP SQL syntax and class-based exception handling.
Prepare explanations for performance tuning, dump analysis, BAPI errors, IDoc failures and enhancement design using examples from your work.
Know BAPIs, RFC types, IDocs, OData services and how ABAP code interacts with FI, SD and MM processes. Functional understanding sets developers apart.
Get comfortable with the debugger, ST22, ST05, SAT, SM37, SM12 and SM13. Many questions are "what would you check first?".
For each major object you built (report, interface, enhancement, form, RAP app), prepare the requirement, design, challenges and testing approach.
Separate classic ABAP from ABAP on HANA, CDS and RAP experience, and be ready to write code for anything listed on your resume.
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.
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.
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.
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.
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.
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.
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.
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.
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-111Last updated: · Prepared by the Aplus Edtech SAP training team.