SALV IDA – Add and Handle Hotspot (Hyperlink)

By | August 22, 2016 | SALV IDA, SALV Tutorial | 10,821 | 0

Lets make the ALV interactive by adding the Hotspot aka Hyperlink into the ALV generated by SALV IDA by using the DISPLAY_OPTIONS for column.



Hotspot or Hyperlink is a key functionality for any ALV, no matter which ALV type you use – SALV Model, SALV IDA or Classical ALV. You now already know how to play with SALV IDA Column properties. In this article, lets take it further by adding a hyper link.

As always, this code lines are based on the template program which is available at SALV IDA Introduction.

Any hotspot functionality would be divided into two parts: Implementing the Hotspot, and Handling the action

SALV IDA Activate Hotspot

To activate the Hotspot, you would need to call the same method FIELD_CATALOG as we used in the SALV IDA Column Settings.

  • Call method FIELD_CATALOG( ) to get the field catalog object
  • Call method DISPLAY_OPTIONS( ) to get the display properties of the column
  • Call method DISPLAY_AS_LINK_TO_ACTION( ) to activate the Hyperlink or Hotspot on the column. Provide the column name for which this is required.

SALV IDA Handle Hotspot

Once the Hotspot is added, we would need to handle it. It wont be handled by itself ;)
To handle the Hotspot,

  • Declare the event Handler for event CELL_ACTION of the interface IF_SALV_GUI_FIELD_DISPLAY_OPT
  • Use statement SET HANDLER to handle this event handler for the DISPLAY_OPTIONS( ) object

Code Lines

Code lines to add and handle the hotspot on SALV IDA:

                    FOR EVENT cell_action OF if_salv_gui_field_display_opt
        IMPORTING ev_field_name
        me->activate_hot_spot( ).
  METHOD activate_hot_spot.
        o_salv_ida->field_catalog( )->display_options(
          )->display_as_link_to_action( 'MSGNR' ).
        SET HANDLER me->handle_hot_spot
          FOR o_salv_ida->field_catalog( )->display_options( ).
      CATCH cx_salv_ida_unknown_name
  METHOD handle_hot_spot.
      BEGIN OF lty_wa.
            INCLUDE TYPE t100.
            INCLUDE TYPE lcl_t100_new_fields=>ty_t100_new_fields.
      END   OF lty_wa.
    DATA: ls_wa  TYPE lty_wa.
          EXPORTING iv_request_type = if_salv_gui_selection_ida=>cs_request_type-all_fields
          IMPORTING es_row          =  ls_wa ).
          iv_text = `Hyper Link for ` && ev_field_name
                    && ` and value ` && ls_wa-msgnr
          is_data = ls_wa ).
      CATCH cx_salv_ida_contract_violation


On the output screen, the hyperlink is displayed:


Once you click on the Hyperlink for the column MSGNR, you would get this small popup. This is generated by the another class CL_SALV_IDA_SHOW_DATA_ROW. The class contains the method DISPLAY to display the data for the single row.


Next Article

SALV IDA – Using a CDS View


Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{273 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 273 articles.

Load comments

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.