ALV Reports
Master classical and modern ALV reporting with CL_SALV_TABLE, REUSE_ALV_GRID_DISPLAY, field catalogs, layouts, hotspots, events, editable ALV, colors and real project drill-down scenarios.
Overview
Master classical and modern ALV reporting with CL_SALV_TABLE, REUSE_ALV_GRID_DISPLAY, field catalogs, layouts, hotspots, events, editable ALV, colors and real project drill-down scenarios.
Lessons in this topic
- ALV Reports Part 1: ALV Basics with REUSE_ALV_GRID_DISPLAYBuild your first ALV report the classic way: read flight data, build a field catalog with REUSE_ALV_FIELDCATALOG_MERGE or by hand, set a layout and display it with REUSE_ALV_GRID_DISPLAY — and see how the three ALV technologies compare.
- ALV Reports Part 2: Quick ALV with CL_SALV_TABLEUse the SALV object model: cl_salv_table=>factory, functions (toolbar), columns (texts, hiding, optimizing), display settings, aggregations and layout saving — with error handling for CX_SALV_MSG and CX_SALV_NOT_FOUND.
- ALV Reports Part 3: OO ALV with CL_GUI_ALV_GRID and a Custom ContainerBuild the classic OO ALV used in most custom transactions: screen 100 with a custom control, CL_GUI_CUSTOM_CONTAINER, CL_GUI_ALV_GRID, LVC field catalog and layout, set_table_for_first_display, PBO/PAI modules and refresh_table_display.
- ALV Reports Part 4: The Field Catalog in DepthMaster the ALV field catalog: DDIC-based merge vs manual build, the important LVC_S_FCAT fields (texts, output length, key, no_out, tech, do_sum, cfieldname/qfieldname, ref_table/ref_field, edit, hotspot, checkbox), and building a catalog for a local structure.
- ALV Reports Part 5: Layout, Sort, Filter, Totals and VariantsControl how an ALV opens: layout options, default sort with subtotals, pre-set filters, totals-only views, and user layout variants (DISVARIANT, i_save, default variant on the selection screen with F4 help).
- ALV Reports Part 6: Hotspot and Double-Click Drill-DownLet users navigate from ALV rows: hotspot columns and double-click events, the classic user_command callback of REUSE_ALV_GRID_DISPLAY, HOTSPOT_CLICK / DOUBLE_CLICK events of CL_GUI_ALV_GRID, and drill-down to a detail ALV or a standard transaction with SET PARAMETER ID and CALL TRANSACTION.
- ALV Reports Part 7: Colors, Icons and Traffic LightsHighlight what matters in an ALV: column colors (emphasize), row colors (info field), cell colors (LVC_T_SCOL), icons with ICON_* constants, and exception columns (traffic lights) — for REUSE_ALV and CL_GUI_ALV_GRID.
- ALV Reports Part 8: Toolbar Buttons, PF-STATUS and User CommandsAdd your own functions to an ALV: a copied PF-STATUS with i_callback_pf_status_set for REUSE_ALV, the toolbar and user_command events of CL_GUI_ALV_GRID, reading selected rows, and refreshing the grid after an action.
- ALV Reports Part 9: Editable ALV with CL_GUI_ALV_GRIDBuild an editable grid: edit flags in the field catalog, register_edit_event, check_changed_data, the DATA_CHANGED event with ER_DATA_CHANGED for validation, and saving changes safely with locks and a single COMMIT.
- ALV Reports Part 10: Authorization and Sensitive Data in ALV ReportsSecure ALV reports: authorization checks on the selection screen and per row (AUTHORITY-CHECK with organizational levels), hiding or masking sensitive columns, restricting export and layout saving, and protecting drill-down navigation.
Interview questions covered
- ALV export to Excel loses leading zeros. Why?
- How do you build a reusable ALV wrapper?
- Business asks for editable ALV that posts to backend. How do you design it?
- Difference between CL_SALV_TABLE and CL_GUI_ALV_GRID.
- What is a layout variant?
- How do you add a hotspot in CL_SALV_TABLE?
- What is ALV and why is it preferred over WRITE lists?
- What are the main differences between CL_SALV_TABLE and REUSE_ALV_GRID_DISPLAY?
- A logistics cockpit implements delivery blocking directly inside the ALV toolbar event handler, including SELECTs, updates and COMMIT per row. What is wrong and how would you restructure it?
- A finance inquiry report was built with CL_GUI_ALV_GRID, a screen and a container, but it is display-only. Would you rebuild it with CL_SALV_TABLE? What are the trade-offs?
- A finance ALV shows technical field names as headers and amounts converted to text columns, so totals and currency formatting don't work. How do you fix the field catalog?
- A finance ALV opens billing documents with SET PARAMETER and CALL TRANSACTION, but some users get errors and others see documents they should not. How do you make the drill-down robust?
- In a custom transaction with CL_GUI_ALV_GRID, the screen becomes slower on every refresh and eventually hangs. What is the likely cause and fix?
- An editable ALV for approvals updates every displayed row on save, even unchanged ones, and occasionally overwrites another user's change. How do you fix the save logic?
- A reconciliation ALV uses only green and red cell backgrounds to show matches and mismatches. What would you improve?
- A finance ALV report selects data inside the display routine and mixes reconciliation logic with field catalog code. How would you structure it?
- A sales ALV shows one grand total for invoices in USD, EUR and GBP. Why is that wrong and how do you fix it?
- A custom aging ALV hides credit limit fields for some users using no_out, but still selects all customers and all fields. Is this secure? How do you fix it?
- ALV freezes on a 500k row internal table. Options?
How to study ALV Reports
ALV Reports has 10 lessons (2 beginner, 6 intermediate, 2 advanced) with about 102 minutes of reading in total. Start with the lesson that matches your level, then read the real project scenario and common mistakes in each one before moving on. After the lessons, say the 19 interview questions out loud in your own words, then check yourself against the model answer in each question (shown once you open it). Use the 33 mock questions to check recall. Finish with the 1 code lab scenario: read the buggy code first, say what is wrong, and only then open the optimized version.
Mock test questions covered
Try answering each one before you open the mock test; the answer options and scoring are in the Mock Questions tab.
- A reconciliation ALV shows matches only as green and mismatches as red cells. What is the best improvement?
- An ALV lists invoices in USD, EUR and GBP with do_sum on the amount. What makes ALV show separate totals per currency?
- An ALV shows prices in JPY with two decimals. Which field catalog setting fixes this?
- How should an editable ALV decide what to save?
- Which ALV technology is a function module using SLIS types and needs no own screen?
- Which layout field tells CL_GUI_ALV_GRID the name of the column holding traffic light values 1/2/3?
- How do you color a single cell in an LVC-based ALV?
- To add a custom button to a REUSE_ALV_GRID_DISPLAY toolbar while keeping standard functions, you should:
- What is the most efficient way to check company code authorization for 100,000 ALV rows?
- Which measure prevents restricted users from downloading sensitive ALV data to Excel?
- Editable cells require:
- Which event fires when a hotspot is clicked?
- A column with salary data is set to no_out for users without authorization. Is the data protected?
- In a well-structured ALV report, where should the SELECT statements be executed?
- What should a report do before CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN from an ALV hotspot?
Code lab scenarios
- Add drill-down to a stock ALV reportUsers viewing stock overview must jump to MMBE from a material hotspot in the ALV grid.