Hotspot fields are very widely used in ALV, such fields have the behaviour and style of hyperlinks, which means they are triggering the single-click event of ALV called HOTSPOT_CLICK. It is commonly used to show the details of the clicked object, or to move to a transaction in which the object can be modified.

As you can imagine, setting column as a HOTSPOT is very easy, you need to pass only the ABAP_TRUE (‘X’) value to the field catalog, but this will only change the style of the field (content of the field is underlined) and it will fire the HOTSPOT_CLICK event.

Figure 114 Setting column as hotspot

Once done, you should create handler for the event and notify ALV grid about it. To do so, you need to declare a method (named hotspot_click in my example) with the addition FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID with importing parameters E_ROW_ID, E_COLUMN_ID and ES_ROW_NO


Figure 115 Hotspot_Click event handler definition


After definition, of course you need to prepare implementation of the method. In my example I simply read the clicked cell content and I display a message on the screen. The index of row of clicked cell you’ll find in structure E_ROW_ID in the field INDEX, the column name inside structure E_COLUMN_ID in field FIELDNAME.


Figure 116 Sample implementation of HOTSPOT_CLICK handler


One last thing you need to do, is to register the handler for your grid instance. To do so, you need to use SET HANDLER your_method_name FOR grid_instance_object syntax.


Figure 117 Setting hotspot_click handler for ALV grid


Now, after running your grid,  you can notice that the column marked as hotspot, has now underlined value and on click, the action inside the event handler is triggered.


Figure 118 Departure city as HOTSPOT column


After clicking on the HOTSPOT column, you should be able to see the popup with the clicked row number and clicked value in it.


Figure 119 Popup displayed after the hotspot click