SAP ABAP Interview Questions
SAP ABAP Reports (ALV, Classical, Interactive) and Forms (Smart Forms, Adobe Forms, Scripts) are essential for data analysis and document generation. Key concepts include ALV field catalogs, event-driven programming (AT SELECTION-SCREEN), dynamic table rendering in Smart Forms, and converting layouts to PDF.
Some Basic Questions
What is ALV Programming?
ABAP List Viewer is a set of function modules (like REUSE_ALV_GRID_DISPLAY) used to display structured data in a standard, flexible tabular format with built-in sorting and filtering.What is the difference between Smart Forms and SAP Scripts?
Smart Forms are graphical, client-independent, and generate a function module upon activation; SAP Scripts are client-dependent, older tools that require more manual coding and layout design.
SAP ABAP Reports Interview Questions & Answers
Q1. What is the difference between Classical, Interactive, and ALV reports?
Classical: Simple, static, one-page report using WRITE statements.
Interactive: Allows user interaction; double-clicking a line displays detailed data (e.g., AT LINE-SELECTION).
ALV (ABAP List Viewer): Advanced, interactive grid/list with built-in functionality like sorting, filtering, and exporting, typically using function modules like REUSE_ALV_GRID_DISPLAY.
Q2. What is a Field Catalog in ALV and how is it built?
A field catalog is a table containing metadata about the output columns (field name, description, length, formatting).
Automatically: Using REUSE_ALV_FIELDCATALOG_MERGE.
Manually: By appending field definitions to an internal table of type SLIS_T_FIELDCAT_ALV.
Semi-automatically: By filling specific fields in the catalog for a dictionary structure.
Q3. What are common ALV events and their use?
Events like TOP_OF_PAGE (adds headers), END_OF_PAGE (adds footers), and USER_COMMAND (handles custom toolbar buttons) are used to enhance report interactivity and layout.
Q4. Explain the difference between AT NEW and ON CHANGE OF.
AT NEW f (inside LOOP) triggers when the value of field f or any higher-level control break field changes.
ON CHANGE OF can be used outside a loop and triggers when the variable value changes.
SAP ABAP Forms Interview Questions & Answers
Q5. What are the key differences between SAP Scripts and Smart Forms?
Smart Forms: GUI-based, easy to maintain, supports dynamic table rendering, and outputs directly to PDF.
SAP Scripts: Line-oriented, harder to maintain, requires strict layout constraints, and requires different forms for different languages.
Q6. What are the main components of a Smart Form?
Form Interface: Imports data from the driver program.
Global Definitions: Defines global variables, types, and internal tables.
Pages and Windows: Layout design (Main Window for flowing text, Secondary Windows for static info).
Q7. How do you pass data from an ABAP program to a Smart Form?
Data is passed from the driver program to the Smart Form via the Function Module generated by the Smart Form (Smart Form name is passed to SSF_FUNCTION_MODULE_NAME).
Q8. What are Adobe Forms (IFbA) and their advantage over Smart Forms?
Adobe Forms (SAP Interactive Forms by Adobe) are XML-based, offering better layout flexibility, interactive capabilities (filling forms offline), and superior PDF rendering compared to Smart Forms.
General Reporting Questions
Q9. How do you optimize the performance of a report?
Use SELECT with specific fields rather than SELECT *.
Use FOR ALL ENTRIES for joining internal tables with database tables.
Use INDEX in database tables.
Use BUFFERING for frequently accessed tables.
Q10. What is an ABAP/4 Query and when to use it?
It is a tool (T-codes: SQ01, SQ02, SQ03) used to create reports without writing code, suitable for functional users or quick report generation based on InfoSets.
