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: 
Read only

HOTSPOT INTERACTIVE ALV

deepikak1
Explorer
0 Likes
1,754

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

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

5 REPLIES 5
Read only

akmal1216
Active Participant
0 Likes
1,696

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.
Read only

0 Likes
1,696

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

Read only

FredericGirod
Active Contributor
0 Likes
1,696

Check for examples provided by SAP : SALV_DEMO_TABLE_EVENTS

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,696

I guess you mean CL_GUI_ALV_GRID?

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,696

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' ) ).