Application Development 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: 

ALV - hotspot

Former Member
0 Kudos

Dear friends,

Used object oriented abap for the first time in a report and for alv as well.

Objects columns TYPE REF TO cl_salv_columns_table and column TYPE REF TO cl_salv_column_table are used insted of fieldcatalog.

But not able find any property for hotspot. Is this ( column->set_hyperlink_entry( ) ) meant for hotspot ?.

Kindly suggest,

Praveen Lobo

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor

For HOTSPOT you need to get the Columns first and than get the Column property and set the HOTSPOT useing the SET_CELL_TYPE.

Like:


*...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 VBELN column
    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.

Regards,

Naimesh Patel

5 REPLIES 5

naimesh_patel
Active Contributor

For HOTSPOT you need to get the Columns first and than get the Column property and set the HOTSPOT useing the SET_CELL_TYPE.

Like:


*...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 VBELN column
    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.

Regards,

Naimesh Patel

former_member188685
Active Contributor
0 Kudos

using the SET_CELL_TYPE method of the class cl_salv_column_table you can get the hotspot option.

check this sample code...

REPORT  ztest_salv.

DATA: alv TYPE REF TO cl_salv_table.
TYPES: BEGIN OF ty_tab,
         carrid TYPE sflight-carrid,
         connid TYPE sflight-connid,
       END OF ty_tab.
DATA: col_tab TYPE REF TO cl_salv_columns_table,
      col TYPE REF TO cl_salv_column_table.

DATA: col_ref TYPE   salv_t_column_ref,
      wa LIKE LINE OF col_ref.

DATA: it_flight TYPE STANDARD TABLE OF ty_tab.

SELECT carrid connid FROM sflight INTO TABLE it_flight
UP TO 10 ROWS.

cl_salv_table=>factory(
  IMPORTING
    r_salv_table   = alv
  CHANGING
    t_table        = it_flight
       ).
"get all the columns
col_tab = alv->get_columns( ).
col_ref = col_tab->get( ).
"loop each column
LOOP AT col_ref INTO wa.
 "Conditionally set the column type as key or non key
  IF wa-columnname   = 'CARRID'.
    col ?= wa-r_column.
    col->set_key( abap_true ).
    col->SET_CELL_TYPE( 5 ).  "5 is for Hotspot
  ENDIF.
ENDLOOP.


alv->display( ).

0 Kudos

Really help full.
Thanks a lot for info..

Former Member
0 Kudos

hi,

go through these links.. will be helpful for u..

http://sap.ittoolbox.com/code/archives.asp?i=10&d=3411&a=s

regards,

preet

narin_nandivada3
Active Contributor
0 Kudos

Hi Praveen,

Please check this link to know how to set HOTSPOT using SALV class's method SET_CELL_TYPE.

http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://blog.csdn.net/lhx20/archive/2008/08/22...

In the above link search for HOTSPOT.

Go through this link for sample prog

http://www.sapfans.com/forums/viewtopic.php?p=913440&sid=cb3438c8cdca4c20f56871451b45f498

Hope this would help you.

Good luck

Narin