‎2009 Jul 15 6:27 AM
Hi All,
I am facing a problem in alv.
I have kept hotspot on for only one field and the subroutine is getting called even when I double click any other field.
Th hotspot icon doesnt come on other fiels so ite means the hotspot is disabled for other fields.
I wanted to knw ho to disbale the call of subroutine for non hotspot fields when i dbl clink on them.
As this is giving me dumb as i try to ftech some data based on the selected field value.
Regards,
Waseem
‎2009 Jul 15 6:40 AM
Hi,
The SY-UCOMM value for a double click is '&IC1'. Restrict your portion of the code where you call your transaction (CALL TRANSACTION) not to work for this SY-UCOMM value. That should solve your problem.
Alternatively,
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
" Read only the field that you have clicked instead of reading the entire row of the internal table
" Then call the transaction.
ENDFORM.
‎2009 Jul 15 6:36 AM
Hi,
It would be simple. Follow these steps.
You must have activated the hotspot on a field say XYZ. Now you invoke the subroutine only when the field name is XYZ.
1. To get the field name use GET CURSOR command.
It returns you the name of the field you have choosen.
GET CURSOR is used to uniquely identify the field where your cursor is clicked.
By using this you will be able to save the name of your field in a variable.
2. Use IF or CASE to check the variable value holding the field name is XYZ and then call the subroutine.
Regards,
P Bansal
‎2009 Jul 15 6:36 AM
Hello Waseem,
Enable the hotspot for the paticular field in field catalog.
Then Use the event "hotspot_click" of " cl_gui_alv_grid" class...
CLASS event_class DEFINITION.
PUBLIC SECTION.
METHODS: handle_hotspot_click FOR EVENT hotspot_click OF
cl_gui_alv_grid IMPORTING e_row_id e_column_id es_row_no.
ENDCLASS.
CLASS event_class IMPLEMENTATION.
* HOTSPOT CLICK EVENT IMPLEMENTATION
METHOD handle_hotspot_click.
CLEAR: V_ROW,V_COLUMN,V_ROW_NUM.
V_ROW = E_ROW_ID.
V_COLUMN = E_COLUMN_ID.
V_ROW_NUM = ES_ROW_NO.
* TO UPDATE THE SCREEN FIELDS
PERFORM HANDLE_HOTSPOT_CLICK USING E_ROW_ID E_COLUMN_ID ES_ROW_NO .
ENDMETHOD.
ENDCLASS.
‎2009 Jul 15 6:40 AM
Hi,
The SY-UCOMM value for a double click is '&IC1'. Restrict your portion of the code where you call your transaction (CALL TRANSACTION) not to work for this SY-UCOMM value. That should solve your problem.
Alternatively,
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
" Read only the field that you have clicked instead of reading the entire row of the internal table
" Then call the transaction.
ENDFORM.
‎2009 Jul 15 6:47 AM
Hi,
Thanks for your reply.
I have already implemented it but the value of rs_selfield-sel_tab_field and the rs_selfield-fieldname are blank while
the rs_selfield-value is coming correct.
Regards,
Waseem
‎2009 Jul 15 8:00 AM
Hi the problem is solved i m using tabindex insteda of fieldname and value.
eg. code:
For user_command using p_ucomm type sy-ucomm
p_selfield type slis_selfield.
if not p_selfield-tabindex is initial.
read table itab into wa index p_selfield-tabindex .
<put your logic>
endif.