Lesson 4 of 5
Working with ALV lists
8 min
Many SAP GUI reports display their results in an ALV list (SAP List Viewer). Once you know ALV, you can work confidently in hundreds of reports, because they all share the same toolbar. ALV is the SAP GUI cousin of the Fiori list report from sap-fnd-103.
Selection screens first
Most reports start with a selection screen, where you restrict what the report reads: plant, material, date range, company code. Then you choose Execute (F8). For example, MB52 (warehouse stocks of material) asks for material, plant and storage location; Contoso’s Chicago warehouse lead enters plant 1720 and executes.
A good habit is to read the selection screen fully before executing. Many reports have more options than their first screen shows: expand hidden blocks, check the default values, and look for a field for the layout to use. Running a report with too broad a selection can take a long time and produce a list too large to check. Running it with too narrow a selection can make you miss the very documents you were meant to see.
The ALV toolbar
| Function | What it does | Typical use |
|---|---|---|
| Sort ascending / descending | Orders the rows by the selected column | Largest stock values first |
| Set filter | Shows only rows meeting a condition | Only storage location 172A |
| Total (Σ) | Adds up a numeric column | Total stock value for the plant |
| Subtotals | Totals per group after sorting by a column | Value per storage location |
| Change layout | Choose, order and size columns | Hide columns you do not need |
| Select / save layout | Store and reuse column, sort, filter and total settings | A standard layout for monthly checks |
| Export | Save the list to a spreadsheet or local file | Supporting evidence or analysis |
ALV functions common to most SAP GUI reports
Layouts
A layout (once called a display variant) stores how the list looks: which columns, their order and width, sort order, filters, totals and subtotals. When you save a layout you can usually choose whether it is user-specific (only you see it) or available to all users, and whether it is your default, loaded automatically when the report runs. Whether you may save shared layouts depends on your authorizations.
Selection variants
A layout controls the output. A selection variant controls the input: it saves the values on the selection screen. Fill in the fields, then choose Goto → Variants → Save as Variant (or the save icon) and give it a name and description. Next time, use Get Variant to load it. Variants can also use dynamic date calculations, so "current month" stays current.
| Aspect | Selection variant | ALV layout |
|---|---|---|
| Controls | What data the report reads | How the result list looks |
| Saved from | The selection screen | The ALV result list |
| Contoso example | Plant 1720, storage locations, current month | Columns material, storage location, value; subtotal per storage location |
| Why it helps testing | Every tester reads the same data set | Every tester checks the same columns and totals |
Used together, a selection variant and a layout turn a report into a repeatable check. A test step can say: "Run MB52 with variant UAT_1720 and layout /UAT_STOCK; confirm the total value for storage location 172A." Anyone can repeat it and should get the same answer from the same data.
A worked example
- Start
MB52, enter material CMC-ALT-100, plant1720, and execute with F8. - In the result list, select the storage location column and sort ascending.
- Select the stock value column and choose Total, then Subtotals to see value per storage location.
- Choose Save Layout, name it for the test (for example /UAT_STOCK), and decide whether it is user-specific or shared.
- Go back to the selection screen and save the selection as variant UAT_1720 with a clear description.
What would you do?
Contoso’s inventory controller asks three testers to confirm stock values for plant 1720 after a valuation change. Each tester gets a different total. What is the most likely cause, and fix?
- Reports start with a selection screen; Execute is F8.
- ALV toolbar: sort, filter, total, subtotal, change layout, save layout, export.
- A selection variant saves input values; a layout saves how results look.
- Shared variants and layouts make report checks repeatable test evidence.
Check your understanding · not graded
Lesson check
1. What does an ALV layout store?
2. Where is a selection variant saved from?
3. Which key executes a report from its selection screen?