1000+ SAP ABAP Interview Questions and Answers

1. Data Dictionary
What is the difference between a transparent table and a pooled table?
- Transparent Table: Directly corresponds to a database table and stores application data. It has a one-to-one relationship with a database table.
- Pooled Table: Multiple pooled tables are stored together in a single database table (table pool) to reduce database overhead.
What is the purpose of a type group in ABAP?
- A type group is a collection of reusable types (like constants, structures, and data types) defined in
SE11
. It allows developers to define commonly used data types in one place and use them across programs.
How do you create a foreign key relationship in SAP Data Dictionary?
- Open the table in
SE11
. - Add a field that should reference another table.
- Define the foreign key relationship in the Foreign Keys tab by specifying:
- Check Table
- Cardinality
- Fields for relation
What is a search help, and how is it used?
- A Search Help provides F4 help for fields, allowing users to select values from a list.
- Used by associating it with table fields or screen fields via
SE11
.
Explain the difference between a table pool and a table cluster.
- Table Pool: Logical tables stored in a common physical table to reduce database load. Used for small, rarely accessed tables.
- Table Cluster: Groups logically related tables together for optimized access.
What are indexes in SAP ABAP, and how do they improve performance?
- Indexes are database objects that speed up data retrieval.
- Types: Primary Index (default) and Secondary Index (custom-defined for better search performance).
What is a domain and a data element?
- Domain: Defines value range and technical attributes (length, data type).
- Data Element: Provides semantic meaning to a field using a domain.
How do you enhance a standard table?
- Use Append Structure (Recommended) or Include Structure in
SE11
.
What is the difference between Append Structure and Include Structure?
- Append Structure: Adds fields to a standard table without modifying it.
- Include Structure: Allows reuse of structures in multiple tables.
What is a lock object, and how does it work?
- Prevents simultaneous updates to the same data by different users.
- Created in
SE11
and used withENQUEUE
andDEQUEUE
function modules.
SAP ABAP Interview Questions and Answers
2. Reports (Classical, Interactive, ALV)
What are the different types of reports in SAP ABAP?
- Classical Reports (Basic output lists)
- Interactive Reports (Allow user interaction with additional details)
- ALV Reports (Enhanced, formatted reports using ALV Grid)
How do you create an interactive report in SAP ABAP?
- Use the event AT LINE-SELECTION to allow navigation to a detailed list when a user clicks a row.
What is an ALV report, and how does it differ from a classical report?
- ALV (ABAP List Viewer) reports provide better formatting, sorting, and filtering options compared to classical reports.
How do you use the REUSE_ALV_GRID_DISPLAY function module?
- Call
REUSE_ALV_GRID_DISPLAY
in your report and pass:- Field catalog (
IT_FIELDCAT
) - Output table (
IT_OUTTAB
) - Layout settings (
IT_LAYOUT
)
- Field catalog (
What is the purpose of the AT LINE-SELECTION event in reports?
- Allows users to select a row and display detailed data.
How do you optimize report performance?
- Use internal tables, indexing, buffering, and efficient SELECT queries.
What is the significance of event blocks in reports?
- Event blocks like INITIALIZATION, START-OF-SELECTION, END-OF-SELECTION control the report flow.
How do you handle user inputs in a report?
- Use PARAMETERS and SELECT-OPTIONS in selection screens.
How do you display totals and subtotals in an ALV report?
- Use
IT_SORT
table withDO_SUM = 'X'
.
What is the use of a field catalog in ALV?
- Defines the properties of fields displayed in the ALV grid.
3. Select Query and Performance Optimization
What are the different types of SELECT statements in SAP ABAP?
- SELECT SINGLE, SELECT ENDSELECT, SELECT INTO TABLE, SELECT FOR ALL ENTRIES, INNER JOIN, LEFT JOIN.
What is the difference between SELECT SINGLE and SELECT UP TO 1 ROWS?
- SELECT SINGLE retrieves the first matching row (faster if primary key used).
- SELECT UP TO 1 ROWS fetches one row but may scan more data.
How can you improve the performance of a SELECT query?
- Use proper indexing, buffering, avoiding nested loops, and using FOR ALL ENTRIES.
What is buffering in SAP tables?
- Temporary storage of table data in memory to improve performance.
Explain the concept of aggregate functions in SAP ABAP.
- SUM, AVG, MIN, MAX, COUNT used to perform calculations in SELECT queries.
What is an inner join and an outer join?
- Inner Join: Returns matching records from both tables.
- Outer Join: Returns all records from one table and matching records from another.
How do you use FOR ALL ENTRIES in a select statement?
- Used to avoid multiple SELECT statements by fetching data in bulk.
What are database hints in SAP ABAP?
- Direct database optimizer to choose a specific access path.
How does indexing improve query performance?
- Speeds up data retrieval by providing a quick search mechanism.
How do you perform parallel processing in ABAP?
- Use asynchronous RFC (aRFC) or parallel processing using background jobs.
4. Module Pool Programming
What is module pool programming in SAP ABAP?
- It is dialog programming used to create custom screens (
SE51
) with user interactions.
How do you design a screen in module pool programming?
- Use Screen Painter (
SE51
) to create UI elements.
What is the difference between PAI and PBO events?
- PBO (Process Before Output): Prepares the screen before display.
- PAI (Process After Input): Handles user inputs.
How do you handle user input validations in module pool?
- Using PAI module and error messages.
What are table controls and how are they used in module pool?
- Interactive table UI elements for displaying and modifying data.
How do you use subscreens in module pool programming?
- Include them using
CALL SUBSCREEN
inside a main screen.
What is the purpose of a GUI status and GUI title?
- GUI Status: Defines menus, toolbar buttons.
- GUI Title: Displays the screen title.
How do you call a transaction from module pool?
- Using
CALL TRANSACTION
orLEAVE TO TRANSACTION
.
What is a screen exit in SAP ABAP?
- A way to enhance standard screens without modifying SAP code.
How do you navigate between screens in module pool programming?
- Using
CALL SCREEN
,SET SCREEN
,LEAVE TO SCREEN
.
5. SAP Scripts and SmartForms
What is the difference between SAP Scripts and SmartForms?
- SAP Scripts: Older technology, client-dependent, requires layout, header, main, and footer windows.
- SmartForms: More advanced, easier to maintain, supports graphics and barcodes, client-independent.
How do you migrate a SAP Script to a SmartForm?
- Use the program
RSTXSCRP
to convert a SAP Script into a SmartForm.
What are the different components of a SAP Script?
- Layout Set, Standard Text, Print Program, and Output Device.
How do you call a SmartForm in an ABAP program?
- Use
SSF_FUNCTION_MODULE_NAME
to get the function module name and call it.
What is the function module used to call a SmartForm?
- Dynamically generated function module name from
SSF_FUNCTION_MODULE_NAME
.
What are the different types of windows in SAP Scripts?
- Main window, Secondary window, Constant window, Final window.
How do you debug a SAP Script?
- Use
SE71 -> Utilities -> Activate Debugging
or useSE80
with the print program.
How do you translate a SmartForm into different languages?
- Use transaction
SE63
for translation.
What is a style in SAP Scripts?
- Defines fonts, paragraph formats, and styles for text formatting.
How do you print barcodes in SmartForms?
- Use barcode control in SmartStyle or SAPScript barcode printing techniques.
6. User Exits, Customer Exits, and BADI’s
What is the difference between a user exit and a customer exit?
- User Exit: Procedural enhancement using function modules.
- Customer Exit: Provided via
SMOD
andCMOD
and supports both function modules and menu exits.
How do you implement a customer exit in SAP ABAP?
- Find the exit via
SMOD
, activate it viaCMOD
, and implement custom logic inside the function module.
What is a BADI, and how is it different from a user exit?
- BADI (Business Add-In) is object-oriented and supports multiple implementations, whereas user exits allow only one implementation.
How do you find user exits available in a transaction?
- Use transaction
SE93
or search inSE84
.
What are the different types of BADIs in SAP?
- Classical BADIs and New BADIs (enhancement framework).
How do you implement multiple implementations of a BADI?
- Create multiple implementations via
SE19
.
What is an enhancement spot in SAP ABAP?
- A predefined point where custom code can be inserted.
What is the difference between an explicit and an implicit enhancement?
- Explicit Enhancement: Defined by SAP at specific points.
- Implicit Enhancement: Available at end of reports, function modules, or methods.
How do you use BAdI filter values?
- Define a filter type in
SE18
and use it inSE19
implementations.
How do you de-implement a customer exit?
- Deactivate the exit in
CMOD
.
7. BDC (Batch Data Communication) and BAPIs
What is the difference between BDC and BAPI?
- BDC is used for screen-based data input (transaction recording), while BAPI is a standardized API for business processes.
How do you create a BDC session?
- Use
CALL TRANSACTION
orSESSION METHOD
withBDC_INSERT
.
What are the different modes in BDC?
- A (Display all screens)
- E (Display errors only)
- N (No screens, background processing)
How do you handle errors in BDC processing?
- Store error messages in an internal table and log errors in SM35.
What is the difference between CALL TRANSACTION and SESSION method?
- CALL TRANSACTION: Immediate execution, faster.
- SESSION METHOD: Runs in background via
SM35
.
What are the advantages of using BAPIs over BDCs?
- More stable, supports object-oriented programming, does not rely on screen changes.
How do you find a suitable BAPI for a transaction?
- Use
BAPI Explorer (SE37)
orSE84
.
What is the difference between synchronous and asynchronous BAPIs?
- Synchronous: Immediate execution and response.
- Asynchronous: Runs in background without waiting for completion.
How do you create a custom BAPI?
- Create a function module.
- Set it as a Remote-enabled Function Module (RFC).
- Define in the BAPI transaction.
What is the purpose of the BAPI_TRANSACTION_COMMIT function module?
- Ensures that database updates are committed after calling a BAPI.
8. Object-Oriented Programming in ABAP (OOPS ABAP)
What are the basic concepts of OOPS ABAP?
- Encapsulation, Inheritance, Polymorphism, Abstraction.
What is a class and an object in SAP ABAP?
- Class: Blueprint that defines behavior and attributes.
- Object: Instance of a class.
What is the difference between instance and static methods?
- Instance Method: Works with instance-specific data.
- Static Method: Works without an instance.
What is inheritance in OOPS ABAP?
- Allows a class to inherit properties of another class.
How do you implement polymorphism in ABAP?
- Method Overriding and Interfaces.
What are interfaces in ABAP OOPS?
- A contract that defines methods without implementation.
What is an abstract class?
- A class that cannot be instantiated and only serves as a base.
What is the purpose of the constructor method?
- Initializes object properties when an object is created.
How do you implement events in OOPS ABAP?
- Use RAISE EVENT and EVENT HANDLER.
What is the difference between a local and a global class?
- Local Class: Defined in a single program.
- Global Class: Created in
SE24
and reusable across programs.
9. SPAU and SPDD
What is the purpose of SPAU in SAP?
- Used during upgrades to adjust repository objects modified by SAP.
What is SPDD, and when is it used?
- SPDD is used for dictionary objects (tables, structures) during an upgrade.
What is the difference between SPAU and SPDD?
- SPAU: Adjusts programs, function modules.
- SPDD: Adjusts dictionary objects.
How do you reset modifications in SPAU?
- Reset to SAP standard via SPAU transactions.
What happens if you don’t adjust changes in SPDD during an upgrade?
- Custom table fields may be lost.
How do you identify modified objects in SPAU?
- Run transaction
SPAU
and filter modified objects.
What are the risks of not adjusting SPAU and SPDD?
- Loss of custom changes after an upgrade.
What is a note correction in SPAU?
- SAP-provided fix for issues in modified objects.
How do you merge custom and SAP standard changes in SPDD?
- Manually adjust table fields to retain custom changes.
What are the best practices for handling SPAU adjustments?
- Backup custom changes before upgrade, review each modification carefully.
Know more on SAP