ERPClimb logoERPClimb
ALV Reports
ABAP Developmentintermediate 11 min read

ALV Reports Part 6: Hotspot and Double-Click Drill-Down

Preview · a free account unlocks the full lesson

Key takeaway

Let 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.

In this lessonShow sections

Visual overview

ALV Reports Part 6: Hotspot and Double-Click Drill-Down — learning sheetFlow: Run the code example (REUSE_ALV version): click a connection number to see its bookings → Double-click a booking to see the customer details; study the commented FB03 pattern for navigation to a standard transaction → Build the OO variant with SET HANDLER (commented part) in your Part 3 report. Key ideas: CLASSIC CALLBACK (REUSE_ALV); OO EVENTS (CL_GUI_ALV_GRID); DRILL-DOWN TARGETS; AUTHORIZATION AND ERRORS. Watch out: Always check authorization (AUTHORITY-CHECK) before CALL TRANSACTION to a standard transaction.ERPClimb.com / ABAP / LESSON 6/10 / LEARNING SHEETALV Reports Part 6: Hotspot and Double-Click Drill-Down1 · HOW IT FLOWS1Run the code example(REUSE_ALV version):click a connection number…2Double-click a booking tosee the customer details;study the commented FB03…3Build the OO variant withSET HANDLER (commentedpart) in your Part 3…2 · KEY IDEAS EXPLAINEDClassic Callback (REUSE_ALV)Field catalog: hotspot = 'X' for the link column.i_callback_user_command = 'USER_COMMAND'.Oo Events (CL_GUI_ALV_GRID)Local class lcl_event_handler with METHODSon_hotspot FOR EVENT hotspot_click OFcl_gui_alv_grid IMPORTING e_row_id e_column_id.METHODS on_double_click FOR EVENT double_click OFcl_gui_alv_grid IMPORTING e_row e_column.Drill-Down TargetsStandard transaction: SET PARAMETER ID 'CAR' FIELD… then CALL TRANSACTION 'XXXX' AND SKIP FIRSTSCREEN. Parameter IDs come from the data element…Detail ALV: select the bookings of the clickedflight and show a second ALV (popup withREUSE_ALV_POPUP_TO_SELECT or a new grid).Authorization And ErrorsCALL TRANSACTION … WITH AUTHORITY-CHECK (7.40 SP…available) or AUTHORITY-CHECK OBJECT 'S_TCODE'before calling.Handle empty detail results with a message.3 · REMEMBER · WATCH OUTRememberHotspot = a column shown as a link; a single click triggers an event.Double click works on any cell.REUSE_ALV_GRID_DISPLAY: pass i_callback_user_command = 'USER_COMMAND'and handle '&IC1' (double click/hotspot) in that FORM.CL_GUI_ALV_GRID: register handler methods FOR EVENT hotspot_click /double_click with SET HANDLER.!Watch outAlways check authorization(AUTHORITY-CHECK) before CALLTRANSACTION to a standardtransaction.4 · IN A REAL PROJECTAn accounts payable report listed invoices, and users copied each document number into FB03 manually — about200 times a day for the team. Adding a hotspot on BELNR with SET PARAMETER ID 'BLN', 'BUK' and 'GJR' and CALLTRANSACTION 'FB03' AND SKIP FIRST SCREEN turned it into one click. In testing, a user without FB03…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 3 built an object-oriented ALV grid; now users want to click a row to see details, which is probably the single most requested ALV feature. A hotspot is a column rendered as a clickable link, where a single click fires an event, while a double-click works on any cell regardless of whether it's a hotspot.

With REUSE_ALV_GRID_DISPLAY, you pass i_callback_user_command = 'USER_COMMAND' and handle the function code '&IC1', which covers both double-click and hotspot clicks, inside that FORM. With CL_GUI_ALV_GRID, you instead register handler methods FOR EVENT hotspot_click and double_click using SET HANDLER. Whichever route you take, always run an AUTHORITY-CHECK before issuing a CALL TRANSACTION to a standard transaction from a drill-down.

In the classic callback approach using REUSE_ALV, mark the link column with hotspot = 'X' in the field catalog, and pass i_callback_user_command = 'USER_COMMAND'. The corresponding form, FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield, receives r_ucomm = '&IC1' for both a double-click and a hotspot click; from there, rs_selfield-tabindex gives you the row index, rs_selfield-fieldname the clicked column, and rs_selfield-value the actual cell value.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.