Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HOTSPOT INTERACTIVE ALV

deepikak1
Explorer
0 Kudos
783

how to make hotspot on key field in interactive alv using oo abap?

5 REPLIES 5

akmal1216
Employee
Employee
0 Kudos
725

Hello,

Get the column and column property, after that you can set HOTSPOT using SET_CELL_TYPE.

    " Columns tables for the HotSpot
    DATA: LO_COLS_TAB TYPE REF TO CL_SALV_COLUMNS_TABLE,
          LO_COL_TAB  TYPE REF TO CL_SALV_COLUMN_TABLE.

    " get Columns object
    LO_COLS_TAB = O_ALV->GET_COLUMNS( ).

    " Get column for example VBELN
    TRY.
        LO_COL_TAB ?= LO_COLS_TAB->GET_COLUMN( 'VBELN' ).
      CATCH CX_SALV_NOT_FOUND.
    ENDTRY.

*   Set the HotSpot for VBELN Column
    TRY.
        CALL METHOD LO_COL_TAB->SET_CELL_TYPE
          EXPORTING
            VALUE = IF_SALV_C_CELL_TYPE=>HOTSPOT.
        .
      CATCH CX_SALV_DATA_ERROR .
    ENDTRY.

0 Kudos
725

If use key field it goes on dump and for other fields it works ...

FredericGirod
Active Contributor
0 Kudos
725

Check for examples provided by SAP : SALV_DEMO_TABLE_EVENTS

Sandra_Rossi
Active Contributor
0 Kudos
725

I guess you mean CL_GUI_ALV_GRID?

Sandra_Rossi
Active Contributor
0 Kudos
725

What is your issue?

If you use CL_GUI_ALV_GRID, no issue with this code: abap - How to trigger code when the user clicks an ALV hotspot field? - Stack Overflow

if I replace

    ( fieldname = 'BOOKID' ref_table = 'SBOOK' ref_field = 'BOOKID' hotspot = 'X' ) ).

by

    ( fieldname = 'BOOKID' ref_table = 'SBOOK' ref_field = 'BOOKID' hotspot = 'X' key = 'X' ) ).