---
description: "ALV Reports in SAP Tutorial - ABAP List Viewer:In this tutorial you will learn: Simple Report, Block Report, Hierarchical Reports, Display Variants."
title: ALV Reports in SAP Tutorial &#8211; ABAP List Viewer
image: https://www.guru99.com/images/alv-reports-in-sap-abap.png
---

[Skip to content](#main)

**⚡ Smart Summary**

ALV Reports in SAP, produced by the ABAP List Viewer, deliver column alignment, sorting, filtering, totals, and subtotals without custom coding. This page explains the simple, block, and hierarchical list types, their REUSE function modules, and display variants.

- 📋 **Core Purpose:** The ABAP List Viewer supplies the standard list features through ready made function modules, so they never have to be programmed again.
- 🗂️ **Field Catalog:** REUSE\_ALV\_FIELDCATALOG\_MERGE builds the catalog that describes every output column, and it can also be filled manually.
- 🖥️ **List and Grid:** REUSE\_ALV\_LIST\_DISPLAY prints a classical list, and REUSE\_ALV\_GRID\_DISPLAY shows the same data in a grid control.
- 🧱 **Block Report:** INIT, APPEND, and DISPLAY combine several internal tables into one output made of separate blocks.
- 🌳 **Hierarchical Report:** REUSE\_ALV\_HIERSEQ\_LIST\_DISPLAY links a header table and an item table through the shared key in IS\_KEYINFO.
- 🧰 **Type Pool SLIS:** Every structure, table type, and constant used by the classical ALV is declared in the type pool SLIS.
- 💾 **Display Variants:** A variant stores sorting, filtering, and totalling defaults, and the I\_SAVE parameter decides whether it is user specific or standard.

Read More

![ALV Reports in SAP ABAP](https://www.guru99.com/images/alv-reports-in-sap-abap.png)

## What is ALV in SAP ABAP?

The common desired features of any report are “column alignment”, sorting, filtering, subtotals, totals etc. To implement these from scratch , a lot of coding effort is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).

Each of these reports provide** function modules** which help in producing desired output without much effort. Lets look at them in detail –

The classical ALV offers three list types, and each one has its own set of REUSE function modules:

- **Simple report:** one internal table shown as a list or a grid.
- **Block report:** several internal tables shown one below the other as separate blocks.
- **Hierarchical report:** a header table and an item table linked by a shared key.

## Simple Report

Important function modules in these [report](https://www.guru99.com/all-about-abap-report-programming.html) are –

- Reuse\_alv\_fieldcatalog\_merge
- Reuse\_alv\_list\_display
- Reuse\_alv\_events\_get
- Reuse\_alv\_grid\_display
- Reuse\_alv\_commentary\_write

### REUSE\_ALV\_FIELDCATALOG\_MERGE

This function module is used to populate a field catalog which is essential to display the data in ALV.

If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter (I\_structure\_name) in the REUSE\_ALV\_LIST\_DISPLAY. But in other cases we need to create it.

Note : Fieldcatalog can be filled manually also by filling up all the required details into the internal table

Important parameters in are:

**1. Export:**

- I\_program\_name : report id
- I\_internal\_tabname : the internal output table
- I\_inclname : include or the report name where all the dynamic forms are handled.

**2. Changing**

- ct\_fieldcat : an [internal table](https://www.guru99.com/all-about-sap-internal-tables.html) with the type SLIS\_T\_FIELDCAT\_ALV which is declared in the type pool SLIS.

### REUSE\_ALV\_LIST\_DISPLAY

This is the function module which prints the data.

The important parameters are:

**1. Export:**

- I\_callback\_program : report id
- I\_bypassing\_buffer : ‘X’
- I\_buffer\_active : ‘ ‘
- I\_callback\_pf\_status\_set : routine where a user can set his own pf status or change the functionality of the existing pf status.
- I\_callback\_user\_command : routine where the function codes are handled.
- I\_structure name : name of the dictionary table
- Is\_Layout : structure to set the layout of the report
- It\_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function)
- It\_events : internal table with a list of all possible events of ALV and their corresponding form names.

**2. Tables:**

- a. t\_outtab : internal table with the data to be output

### REUSE\_ALV\_EVENTS\_GET

Returns table of possible events for a a list type

**1. Import:**

**Et\_Events :**The event table is returned with all possible CALLBACK events for the specified list type (column ‘NAME’). For events to be processed by the Callback, their ‘FORM’ field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field ‘FORM’ filled and the entry modified using constants from the type pool SLIS.

**2. Export:**

I\_list\_type: 0 = simple list REUSE\_ALV\_LIST\_DISPLAY

1 = hierarchical-sequential list REUSE\_ALV\_HIERSEQ\_LIST\_DISPLAY

2 = simple block list REUSE\_ALV\_BLOCK\_LIST\_APPEND

3 = hierarchical-sequential block list REUSE\_ALV\_BLOCK\_LIST\_HS\_APPEND

### REUSE\_ALV\_GRID\_DISPLAY

A new function from ABAP4.6 version, to display the results in grid rather than a preview.

Parameters : same as reuse\_alv\_list\_display

> Note: Grid cannot handle high volumes. Functions like sort, scrolling down consumes a lot of resources / time if the volume of data to be displayed is high. There is no clear cut definition such that if the amount of data is X go for list or grid but the developer has to take a call based on his experience. If not sure, then list is the better option

### REUSE\_ALV\_COMMENTARY\_WRITE

This is used in the Top-of-page event to print the headings and other comments for the list.

Important Parameters

- It\_list\_commentary : Internal table with the headings of the type slis\_t\_listheader.

This internal table has three fields:

1. Typ : ‘H’ – header, ‘S’ – selection, ‘A’ – action
2. Key : only when typ is ‘S’.
3. Info : the text to be printed

**Don't Miss:**

- [Introduction to ABAP: Datatypes, Operators & Editor – Tutorial](https://www.guru99.com/introduction-to-abap.html)
- [SAP Process On Value & Process On Help-Request](https://www.guru99.com/process-on-value-help.html)
- [ALE, EDI & IDocs Introducion & Difference: SAP Tutorial](https://www.guru99.com/what-is-edi-ale-and-idoc.html)
- [SAP IDOC Tutorial in ABAP: Step-by-Step Guide](https://www.guru99.com/all-about-idocdefinition-architecture-implementation.html)

## Example: A Simple ALV Grid Report

The program below turns the function modules above into a working report. It reads the flight schedule table SPFLI, builds the field catalog automatically, and displays the result in a grid.

```
REPORT z_alv_demo.

TYPE-POOLS: slis.

DATA: lt_spfli    TYPE STANDARD TABLE OF spfli,
      lt_fieldcat TYPE slis_t_fieldcat_alv,
      ls_layout   TYPE slis_layout_alv.

START-OF-SELECTION.

  * 1. Read the data into the output table
  SELECT * FROM spfli INTO TABLE lt_spfli.

  * 2. Build the field catalog from the dictionary structure
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name     = sy-repid
      i_internal_tabname = 'LT_SPFLI'
      i_structure_name   = 'SPFLI'
    CHANGING
      ct_fieldcat        = lt_fieldcat.

  * 3. Set the layout and display the grid
  ls_layout-zebra             = 'X'.
  ls_layout-colwidth_optimize = 'X'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = sy-repid
      is_layout          = ls_layout
      it_fieldcat        = lt_fieldcat
      i_save             = 'A'
    TABLES
      t_outtab           = lt_spfli.
```

Three parameters carry most of the work. I\_STRUCTURE\_NAME lets the field catalog be derived from the dictionary, so no column is described by hand. IS\_LAYOUT switches on striped rows and optimised column widths. I\_SAVE = ‘A’ allows both user specific and standard display variants to be saved from the finished list.

## Block Report

This looks like a simple report but this report has the features of sorting and filtering only.This report is used if you have to display more than one report on the output. Technically speaking if you have multiple internal table with data to be displayed as separate blocks then we go for block report of ALV.

The important functions used for creating this report are:

- REUSE\_ALV\_BLOCK\_LIST\_INIT
- REUSE\_ALV\_BLOCK\_LIST\_APPEND
- REUSE\_ALV\_BLOCK\_LIST\_DISPLAY

### REUSE\_ALV\_BLOCK\_LIST\_INIT

This function module is used to set the default gui status etc. The parameters are similar to the one used in reuse\_alv\_list\_display or reuse\_alv\_grid\_display

### REUSE\_ALV\_BLOCK\_LIST\_APPEND

This function module adds the data to the block.

Important Parameters

**1.Export :**

- is\_layout : layout settings for block
- it\_fieldcat : field catalog
- I\_tabname : internal table name with all all possible events

**2.Tables :**

- t\_outtab : internal table with output data.

### REUSE\_ALV\_BLOCK\_LIST\_DISPLAY

This function module display the list with data appended by the above function.

Parameters : All the parameters are optional.

## Hierarchical Reports

Hierarchical display is used for displaying data that are related. Like sales order and item details. Here sales order details can be the header data whereas them items in the sales order can be the item data

The function module used for this is

### REUSE\_ALV\_HIERSEQ\_LIST\_DISPLAY

**Export:**

- I\_CALLBACK\_PROGRAM
- I\_CALLBACK\_PF\_STATUS\_SET
- I\_CALLBACK\_USER\_COMMAND
- IS\_LAYOUT
- It\_fieldcat
- It\_events
- I\_tabname\_header : Name of the internal table in the program containing the output data of the highest hierarchy level.
- I\_tabname\_item : Name of the internal table in the program containing the output data of the lowest hierarchy level.
- Is\_keyinfo : This structure contains the header and item table field names which link the two tables (shared key).

**Tables**

- t\_outtab\_header : Header table with data to be output
- t\_outtab\_item : Name of the internal table in the program containing the output data of the lowest hierarchy level.

All the definitions of internal tables, structures and constants are declared in a type-pool called** SLIS.** This internal table can be populated automatically by using REUSE\_ALV\_FIELDCATALOG\_MERGE’.

## Display Variants

- Display variants are used to set the default properties of an alv output like sort criteria, filtering criteria, totaling and subtotaling etc
- Display variants can be user specific and standard (standard variants can be used by any user )
- Kind of display variants that can be saved is controlled by the parameter i\_save that is passed in function modules reuse\_alv\_list\_display / reuse\_alv\_grid\_display
- You can provide an option on the selection screen to select what display variant to be used

The common function modules related to selecting / validating display variants are

1. Reuse\_alv\_variant\_default\_get
2. Reuse\_alv\_variant\_f4
3. Reuse\_alv\_variant\_existence

**💡 Tip:** Pass I\_SAVE = ‘U’ to allow user specific variants only, ‘X’ for standard variants only, and ‘A’ for both. An empty value blocks saving altogether.

Thats all to [ABAP](https://www.guru99.com/introduction-to-abap.html) – ALV programming!

## FAQs

⚡ What is the difference between the REUSE function modules and CL\_GUI\_ALV\_GRID?

The REUSE modules belong to the classical, function based ALV. CL\_GUI\_ALV\_GRID is the object oriented control that is embedded in a custom container on a dynpro, and it offers editable cells and event handling through methods.

➕ How are totals and subtotals produced in an ALV list?

Set DO\_SUM in the field catalog for the column that must be added, and pass a sort table with SUBTOT switched on for the column that groups the rows. No extra calculation code is needed.

🖱️ How is a double click on an ALV row handled?

Pass the name of a form to I\_CALLBACK\_USER\_COMMAND. The form receives the function code and the selected row, so the program can read the record and open a detail list or a transaction.

🤖 Can AI generate an ALV report from a plain description?

Yes. AI assistants in ABAP development tools produce the SELECT, the field catalog, and the call of REUSE\_ALV\_GRID\_DISPLAY from a description of the required columns. The generated SELECT still needs a performance check.

🧠 Do AI analytics replace ALV lists in modern SAP systems?

No. ALV remains the standard output of SAP GUI reports. AI assistants add value on top of it by summarising a long list, spotting outliers, and answering questions about the displayed data in plain language.

#### Summarize this post with:

ChatGPTPerplexityGrokGoogle AI

**Stay Updated on AI** **Get Weekly AI Skills, Trends, Actionable Advice.**

##### Sign up for the newsletter

Subscribe for Free

You have successfully subscribed.  
Please check your inbox.

![AI-Newsletter]() Chosen by over **350,000+** professionals

[Scroll to top](#wrapper)

×

Search for:

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.guru99.com/#organization","name":"Guru99","sameAs":["https://www.facebook.com/Guru99Official","https://twitter.com/guru99com"],"logo":{"@type":"ImageObject","@id":"https://www.guru99.com/#logo","url":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","contentUrl":"https://www.guru99.com/images/guru99-logo-v1-150x59.png","caption":"Guru99","inLanguage":"en-US"}},{"@type":"WebSite","@id":"https://www.guru99.com/#website","url":"https://www.guru99.com","name":"Guru99","publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.guru99.com/images/alv-reports-in-sap-abap.png","url":"https://www.guru99.com/images/alv-reports-in-sap-abap.png","width":"700","height":"250","caption":"ALV Reports in SAP ABAP","inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://www.guru99.com/alv-list-view-programming.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://www.guru99.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://www.guru99.com/abap-tutorial","name":"SAP - ABAP"}},{"@type":"ListItem","position":"3","item":{"@id":"https://www.guru99.com/alv-list-view-programming.html","name":"ALV Reports in SAP Tutorial &#8211; ABAP List Viewer"}}]},{"@type":"WebPage","@id":"https://www.guru99.com/alv-list-view-programming.html#webpage","url":"https://www.guru99.com/alv-list-view-programming.html","name":"ALV Reports in SAP Tutorial &#8211; ABAP List Viewer","dateModified":"2026-10-09T13:50:41+05:30","isPartOf":{"@id":"https://www.guru99.com/#website"},"primaryImageOfPage":{"@id":"https://www.guru99.com/images/alv-reports-in-sap-abap.png"},"inLanguage":"en-US","breadcrumb":{"@id":"https://www.guru99.com/alv-list-view-programming.html#breadcrumb"}},{"@type":"Person","@id":"https://www.guru99.com/author/editorial","name":"Editorial Team","url":"https://www.guru99.com/author/editorial","image":{"@type":"ImageObject","@id":"https://www.guru99.com/images/favicon-new-logo.png","url":"https://www.guru99.com/images/favicon-new-logo.png","caption":"Editorial Team","inLanguage":"en-US"},"sameAs":["https://www.guru99.com/editorial-team"],"worksFor":{"@id":"https://www.guru99.com/#organization"}},{"articleSection":"SAP - ABAP","headline":"ALV Reports in SAP Tutorial &#8211; ABAP List Viewer","description":"ALV Reports in SAP Tutorial - ABAP List Viewer:In this tutorial you will learn: Simple Report, Block Report, Hierarchical Reports, Display Variants.","keywords":"sap-abap, sap","speakable":{"@type":"SpeakableSpecification","cssSelector":[".entry-title",".summary"]},"@type":"Article","author":{"@id":"https://www.guru99.com/author/editorial","name":"Editorial Team"},"dateModified":"2026-10-09T13:50:41+05:30","image":{"@id":"https://www.guru99.com/images/alv-reports-in-sap-abap.png"},"copyrightYear":"2026","name":"ALV Reports in SAP Tutorial &#8211; ABAP List Viewer","subjectOf":[{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the difference between the REUSE function modules and CL_GUI_ALV_GRID?","acceptedAnswer":{"@type":"Answer","text":"The REUSE modules belong to the classical, function based ALV. CL_GUI_ALV_GRID is the object oriented control that is embedded in a custom container on a dynpro, and it offers editable cells and event handling through methods."}},{"@type":"Question","name":"How are totals and subtotals produced in an ALV list?","acceptedAnswer":{"@type":"Answer","text":"Set DO_SUM in the field catalog for the column that must be added, and pass a sort table with SUBTOT switched on for the column that groups the rows. No extra calculation code is needed."}},{"@type":"Question","name":"How is a double click on an ALV row handled?","acceptedAnswer":{"@type":"Answer","text":"Pass the name of a form to I_CALLBACK_USER_COMMAND. The form receives the function code and the selected row, so the program can read the record and open a detail list or a transaction."}},{"@type":"Question","name":"Can AI generate an ALV report from a plain description?","acceptedAnswer":{"@type":"Answer","text":"Yes. AI assistants in ABAP development tools produce the SELECT, the field catalog, and the call of REUSE_ALV_GRID_DISPLAY from a description of the required columns. The generated SELECT still needs a performance check."}},{"@type":"Question","name":"Do AI analytics replace ALV lists in modern SAP systems?","acceptedAnswer":{"@type":"Answer","text":"No. ALV remains the standard output of SAP GUI reports. AI assistants add value on top of it by summarising a long list, spotting outliers, and answering questions about the displayed data in plain language."}}]}],"@id":"https://www.guru99.com/alv-list-view-programming.html#schema-1144276","isPartOf":{"@id":"https://www.guru99.com/alv-list-view-programming.html#webpage"},"publisher":{"@id":"https://www.guru99.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://www.guru99.com/alv-list-view-programming.html#webpage"}}]}
```
