06-09-2005 12:47 PM
Can we have AT LINE-SELECTION in ALV??
I am displaying a some details from MARA using ALV.
Now what I want to do is once we click on any of the line, some details from MAKT table has to be displayed in a saperate window.
I tried using AT LINE-SELECTION but cannot get.
If we cannot use it, is there any better way?
Please guide. Thnx
06-09-2005 12:58 PM
Hi,
at line selection only for interactive reporting.
in case of ALV you can use the HOT spot click option wherein you set the hotspot option in your field catalog for that column.
now we need to register the event when we click on the ALV list. use a local class in your program to define the event for the hotspot click and in the method implementation you can get the details of the clicked row and retrieve the details from MAKT table and display in a pop-up window.
Regards,
Jagath.
06-09-2005 1:02 PM
Hi Sachin,
2 things you need to do.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = g_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = v_fieldcat[]
i_save = g_save
is_variant = gs_variant
it_events = gt_events[]
it_sort = it_sort
Pass thsi entry to call FM
i_callback_user_command = 'USER_COMMAND'
Write Form
FORM user_command
USING command LIKE sy-ucomm
ps_selfield TYPE slis_selfield.
CASE command.
WHEN '&IC1'.
*do rets of coding here.
Endcase.
End user_command.
Rgds,
Mano Sri
06-09-2005 1:03 PM
ps_selfield in teh above example will have field name and value on which you click.
Rgds,
Mano sri
06-09-2005 1:07 PM
Hi,
Check the standard ALV program 'BALVHD01' for further clarification.
Rgds,
06-09-2005 1:09 PM
hi,
Indeed you can try a search on the search forums for HOT SPOT usage in ALV and you will find a lot of forums already been answered on this.
Regards,
Jagath
03-02-2009 7:09 AM
hi ,
if you want to use at line selection in alv , you have to first define teh field in field catalog of alv as HOT-SPOT , SO when you execute your program the cursor changes to hand , so when you click on particular value of the field , you will come to know abt the value by using slis_selfield .
FORM user_command USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM .
WHEN '&IC1'.(this is code for hot spot , when user click on the field this event is triggereed)
IF RS_SELFIELD-FIELDNAME NE 'VBELN'. (Field name will contain the name of field clicked if you have more than one hot spot field).
or RS_SELFIELD-VALUE, ( FIELD VALUE IS CAPTURED HERE AS PER USER CLICK)
YOUR DESIRED LOGIC
.
ENDIF.