ALV Report – call transaction using Hot spot
Hotspots are special areas of an output list. If the user clicks once onto a hotspot field, an event is triggered. This article ALV Report – call transaction using Hot spot shows how it can be done.
For inserting the Hotspots in the ALV, we need to follow following steps in ALV:
1. In the fieldcatalog you will have to write the hotspot as shown below:
wa_fieldcat-hotspot = ‘X’.
APPEND wa_fieldcat TO it_fieldcat.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
i_callback_program = sy-repid
i_callback_user_command = ‘USER_COMMAND’“—-> this is important
- i_callback_pf_status_set = ‘PFSTATUS’
it_fieldcat = it_fieldcat
is_layout = it_layout
- it_event_exit = it_eventexit
- i_screen_start_column = 10
- i_screen_start_line = 20
- i_screen_end_column = 70
- i_screen_end_line = 45
i_grid_title = ‘Customer-Order Details’
t_outtab = it_data.
2. Then we have to catch this User Command as follows :
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: alv_vbeln TYPE vbeln,
mess_text(30) TYPE c,
txt_vbeln(10) TYPE c.
*User clicks a Order No. in ALV it passed to the following transaction.
READ TABLE it_data INDEX rs_selfield-tabindex INTO wa_data.
alv_vbeln = wa_data-vbeln..
IF sy-subrc = 0.
CLEAR: mess_text, txt_vbeln.
WITH pr_vbeln = alv_vbeln AND RETURN. “put your call transaction logic here
Other related tutorial can be – ALV generation using Object Oriented way can also be done in 3 steps – ABAP Program for Creating an ALV Grid in 3 lines.