Chapter 09 · Core Classic ABAP
ALV Reports
The most common output format in SAP — sorting, filtering, totals, layouts, and interactive events with SALV and REUSE_ALV.
Every SAP interview asks about ALV. Every project uses it. Every business report you will ever build in classic ABAP ends up as an ALV. This is not an exaggeration — ALV (ABAP List Viewer) is the standard reporting framework in SAP, and mastering it is non-negotiable if you want a job as an ABAP developer [citation:5].
You already know how to read data with Open SQL (Chapter 6) and handle it with Internal Tables (Chapter 7). In Chapter 8, you learned to modularize. Now you will take all of that and display it the way SAP expects: in a sortable, filterable, interactive ALV grid.
🎯 What You Will Learn in This Chapter
- What ALV is and why it replaced classical WRITE-based reports
- How to build a simple ALV using
CL_SALV_TABLE(the modern SALV approach) [citation:2][citation:8] - How to build an ALV using
REUSE_ALV_GRID_DISPLAY(the classic Function Module approach) [citation:4] - What a Field Catalog is and how to control column behavior [citation:5]
- How to configure Layout settings (zebra stripes, column width, totals) [citation:10]
- How to handle events like
DOUBLE_CLICKand custom toolbar buttons [citation:9][citation:14] - When to use SALV vs REUSE_ALV and why SALV is the modern choice [citation:5]
📘 What is ALV and Why Does It Matter?
ALV stands for ABAP List Viewer. It is a SAP-provided reporting framework that displays internal table data in a standardized, interactive grid [citation:5].
Before ALV existed, developers had to write every column header, every sort, every total, and every filter manually using WRITE statements. That took hundreds of lines of code. ALV does all of that automatically — you just hand it an internal table, and it gives you a professional report with built-in functionality [citation:5][citation:12].
Why ALV is the industry standard
| Feature | Classical WRITE Report | ALV Report |
|---|---|---|
| Column headers | Manual WRITE statements | Automatic from Field Catalog |
| Sorting | Manual SORT + logic | One click by user |
| Filtering | Manual IF conditions | Built-in filter dialog |
| Totals | Manual SUM logic | Built-in SUM button |
| Excel export | Custom code | Built-in export |
| Layouts | Not possible | Users save their own layouts |
| Events (double-click) | Not possible | Built-in event handling |
| Code length | Hundreds of lines | ~20-30 lines |
⚖️ Two Ways to Build ALV: SALV vs REUSE_ALV
SAP provides two ways to create ALV reports. You need to know both for interviews and maintenance work [citation:4][citation:5].
| Aspect | SALV (CL_SALV_TABLE) | REUSE_ALV (Function Module) |
|---|---|---|
| Approach | Object-oriented | Procedural (Function Module) |
| Main Class / FM | CL_SALV_TABLE | REUSE_ALV_GRID_DISPLAY |
| Code length | ~15-20 lines | ~40-60 lines |
| Field Catalog type | LVC_T_FCAT | SLIS_T_FIELDCAT_ALV |
| Layout type | LVC_S_LAYO | SLIS_LAYOUT_ALV |
| Read-only reports | ✅ Perfect | Works but heavier |
| Editable grids | ❌ Not supported | ✅ Supported |
| Complex events | ✅ Supported | ✅ Full control |
| Recommendation | Use for new read-only reports | Legacy, use when needed for complex cases |
💻 Method 1: SALV — The Modern Approach
SALV uses the class CL_SALV_TABLE. It is the fastest way to build a report [citation:8].
Basic SALV — 3 lines of core code
REPORT z_alv_salv_demo.
DATA: lt_scarr TYPE TABLE OF scarr,
lo_alv TYPE REF TO cl_salv_table.
" 1. Select data
SELECT * FROM scarr INTO TABLE @lt_scarr.
" 2. Create SALV instance
cl_salv_table=>factory(
IMPORTING r_salv_table = lo_alv
CHANGING t_table = lt_scarr ).
" 3. Display
lo_alv->display( ).
Adding a Field Catalog with SALV
To control column headers and behavior, get the columns object and modify it [citation:5]:
DATA: lo_columns TYPE REF TO cl_salv_columns_table,
lo_column TYPE REF TO cl_salv_column_table.
lo_columns = lo_alv->get_columns( ).
lo_column = lo_columns->get_column( 'CARRID' ).
lo_column->set_long_text( 'Airline Code' ).
lo_column->set_short_text( 'Code' ).
lo_column->set_medium_text( 'Airline Code' ).
📦 Method 2: REUSE_ALV_GRID_DISPLAY — The Classic Approach
This is the older, function-module-based approach. You will see it everywhere in existing SAP codebases [citation:4][citation:10].
Basic REUSE_ALV_GRID_DISPLAY example
REPORT z_alv_reuse_demo.
DATA: lt_scarr TYPE TABLE OF scarr,
lt_fcat TYPE slis_t_fieldcat_alv,
ls_fcat TYPE slis_fieldcat_alv,
ls_layout TYPE slis_layout_alv.
" 1. Select data
SELECT * FROM scarr INTO TABLE lt_scarr.
" 2. Build field catalog
ls_fcat-fieldname = 'CARRID'.
ls_fcat-seltext_l = 'Airline Code'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
ls_fcat-fieldname = 'CARRNAME'.
ls_fcat-seltext_l = 'Airline Name'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
" 3. Layout settings
ls_layout-zebra = 'X'. " Zebra stripes
ls_layout-colwidth_optimize = 'X'. " Auto column width
" 4. Display ALV
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fcat
TABLES
t_outtab = lt_scarr.
📋 The Field Catalog — Controlling Columns
The Field Catalog is the most important concept in ALV. It defines how each column behaves: heading, visibility, width, totals, and more [citation:5][citation:12].
Key Field Catalog fields you must know
| Field | Purpose | Example |
|---|---|---|
FIELDNAME | Internal table field name | 'CARRID' |
SELTEXT_L/M/S | Column heading (long/medium/short) | 'Airline Code' |
NO_OUT | Hide this column | 'X' |
DO_SUM | Show total for this column | 'X' |
HOTSPOT | Make column clickable (underlined) | 'X' |
OUTPUTLEN | Column width in characters | 20 |
EMPHASIZE | Color the column | 'C310' |
NO_ZERO | Hide zero values | 'X' |
🎨 Layout Settings — Making It Look Professional
The Layout controls the overall appearance of the ALV grid [citation:10].
| Layout Field | Effect |
|---|---|
ZEBRA | Alternating row colors (easier to read) |
COLWIDTH_OPTIMIZE | Auto-fit column widths to content |
NO_VLINE | Hide vertical grid lines |
NO_ULINE_HS | Hide horizontal grid lines |
BOX_FIELDNAME | Add checkbox for row selection |
EDIT | Make the grid editable |
INFO_FIELDNAME | Color rows based on a field value |
Setting layout in SALV
DATA: lo_layout TYPE REF TO cl_salv_layout.
lo_layout = lo_alv->get_layout( ).
lo_layout->set_zebra( abap_true ).
lo_layout->set_key( 'CARRID' ).
🖱️ Event Handling — Making ALV Interactive
ALV supports event handling. The most common events are:
| Event | When It Fires | Use Case |
|---|---|---|
DOUBLE_CLICK | User double-clicks a row | Navigate to detail screen |
ADDED_FUNCTION | User clicks custom toolbar button | Trigger custom action |
HOTSPOT_CLICK | User clicks a hotspot column | Drill-down on specific field |
TOP_OF_PAGE | Before data is displayed | Add report header/logo |
SALV Event Example — Double-Click Handler [citation:9]
" Define local handler class
CLASS lcl_handler DEFINITION.
PUBLIC SECTION.
METHODS on_double_click
FOR EVENT double_click OF cl_salv_events_table
IMPORTING row column.
ENDCLASS.
CLASS lcl_handler IMPLEMENTATION.
METHOD on_double_click.
READ TABLE lt_scarr INTO ls_scarr INDEX row.
MESSAGE |You clicked: { ls_scarr-carrid }| TYPE 'I'.
ENDMETHOD.
ENDCLASS.
" Register the handler
DATA: lo_events TYPE REF TO cl_salv_events_table,
lo_handler TYPE REF TO lcl_handler.
lo_events = lo_alv->get_event( ).
CREATE OBJECT lo_handler.
SET HANDLER lo_handler->on_double_click FOR lo_events.
⚖️ SALV vs REUSE_ALV — When to Use Which
| Scenario | Recommended Approach |
|---|---|
| New read-only report | SALV (cleaner, faster) |
| Report that needs editing | REUSE_ALV (SALV doesn’t support edit mode) |
| Maintaining legacy code | Whatever the original used |
| Complex custom events | REUSE_ALV or ALV Grid with container |
| S/4HANA backend reports | SALV — modern and supported |
| Fiori-connected data source | SALV — backend report consumed by Fiori |
📝 Chapter Summary
- ALV (ABAP List Viewer) is the standard reporting framework in SAP. It provides sorting, filtering, totals, layouts, and export automatically [citation:5].
- SALV (
CL_SALV_TABLE) is the modern, object-oriented approach. Ideal for read-only reports. Minimal code [citation:8]. - REUSE_ALV_GRID_DISPLAY is the classic Function Module approach. Still used in legacy systems and for editable grids [citation:4].
- Field Catalog controls column behavior: headings, visibility, width, totals [citation:5].
- Layout controls appearance: zebra stripes, grid lines, column width optimization [citation:10].
- Events make ALV interactive: double-click, custom buttons, hotspot clicks [citation:9].
- ALV is still highly relevant in S/4HANA and is the default reporting choice for backend reports [citation:5].
🎤 Interview Questions & Answers
ALV is the #1 interview topic in SAP ABAP. These are the exact questions asked in real interviews [citation:5][citation:12].
ALV (ABAP List Viewer) is a SAP-provided reporting framework used to display internal table data in a standardized, interactive format. It is used because it offers built-in features like sorting, filtering, totals, layouts, and Excel export without manual coding. ALV saves development time and improves report usability [citation:5].
REUSE_ALV* refers to the older function-module-based approach (procedural programming) widely used in classic systems. SALV (Simple ALV) is the object-oriented approach using the class CL_SALV_TABLE. SALV requires minimal and clean code and is ideal for read-only reports. SALV is recommended for quick, modern ALV implementations [citation:5].
The field catalog defines how ALV columns behave, including: column headings, output length, visibility, sorting, formatting, and whether a column is a hotspot. A well-designed field catalog directly improves report clarity and controls what the user sees and interacts with [citation:5].
ALV List is a simpler output format with limited interaction and is mostly used in legacy reports. ALV Grid provides advanced UI features, editable cells, better performance, and greater flexibility. In modern SAP and S/4HANA systems, ALV Grid is preferred [citation:5].
SALV is not suitable when: editable ALV is required, complex custom events are needed, or highly dynamic UI control is required. In such cases, ALV Grid with custom handling (using CL_GUI_ALV_GRID and a container) is a better choice [citation:5].
ALV optimizes data rendering, handles large internal tables efficiently, and reduces custom formatting logic. This makes ALV faster, cleaner, and more scalable than WRITE-based reports [citation:5].
Yes, absolutely. ALV remains the default reporting choice in S/4HANA for: backend reports, Fiori-connected data sources, and large analytical datasets. ALV is not outdated; it has evolved [citation:5].
Interviewers often ask about: ALV Grid vs ALV List, SALV vs REUSE_ALV*, field catalog concepts, performance handling, and real-world ALV use cases. Understanding why and when to use ALV matters more than syntax [citation:5].
🛠 Practice Task for This Chapter
Build both versions of the same report. This is a real interview-level exercise.
- SALV version: Create a report that selects all fields from table
SCARRand displays them usingCL_SALV_TABLE. Add a field catalog to renameCARRIDto “Airline Code”. - REUSE_ALV version: Build the same report using
REUSE_ALV_GRID_DISPLAY. Manually build the field catalog forCARRIDandCARRNAME. Enable zebra stripes. - Add an event: Add a double-click event to the SALV version that displays the selected row’s data in a popup message.
- Compare the code length and readability of both approaches.
Test: Kon Banega Crorepati?
5 questions. ₹1 Crore. Prove you understood ALV Reports. No pressure — restart anytime.
Explore Our Instructor-Led SAP & IT Courses
Self-study works. But if you want guided training, real project practice, and placement support — here are the courses we offer. Book a free demo before you decide.
SAP Courses
Technology & Other Courses
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "ALV Reports in ABAP: Build Your First List Report (2026 Guide)",
"alternativeHeadline": "ABAP Zero to Hero — Chapter 9",
"description": "Learn ALV Reports in ABAP 2026. Master CL_SALV_TABLE, REUSE_ALV_GRID_DISPLAY, Field Catalogs, Layouts, and event handling.",
"image": {
"@type": "ImageObject",
"url": "https://www.elearningsolutions.co.in/images/abap-zero-to-hero-chapter-9.jpg",
"width": 1200,
"height": 630
},
"author": {
"@type": "Person",
"name": "eLearning Solutions",
"url": "https://www.elearningsolutions.co.in/about/"
},
"publisher": {
"@type": "Organization",
"name": "eLearning Solutions",
"url": "https://www.elearningsolutions.co.in/",
"logo": {
"@type": "ImageObject",
"url": "https://www.elearningsolutions.co.in/images/logo.png",
"width": 600,
"height": 60
}
},
"datePublished": "2026-03-05",
"dateModified": "2026-03-05",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://www.elearningsolutions.co.in/abap-zero-to-hero/chapter-09-alv-reports"
},
"articleSection": "Core Classic ABAP",
"keywords": "ALV Reports ABAP, CL_SALV_TABLE, REUSE_ALV_GRID_DISPLAY, ABAP Field Catalog, ABAP ALV Tutorial",
"inLanguage": "en",
"wordCount": 3400,
"timeRequired": "PT20M",
"isPartOf": {
"@type": "CreativeWorkSeries",
"name": "ABAP Zero to Hero",
"url": "https://www.elearningsolutions.co.in/abap-zero-to-hero/"
}
}
</script>
WhatsApp us