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

Block Grid ALV

Former Member
0 Likes
914

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
809

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.   

5 REPLIES 5
Read only

Former Member
0 Likes
809

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

Read only

Former Member
0 Likes
809

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.

Read only

Former Member
0 Likes
810

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.   

Read only

0 Likes
809

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

Read only

0 Likes
809

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.