<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626249#M603477</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for this in &amp;lt;b&amp;gt;oops ALV&amp;lt;/b&amp;gt;  you have to use EVENTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the &amp;lt;b&amp;gt;fallowing EVENTS and there usage is given.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;button_click&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Query a click on a pushbutton in the ALV Grid Control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;double_click&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Query a double-click on a cell of the ALV Grid control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;hotspot_click&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Query a hotspot click on columns defined for this purpose in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;onDrag&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Collect information when elements of the ALV Grid Control are dragged&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;toolbar&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Change, delete or add GUI elements in the toolbar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General Scheme for the Event Handler Class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample code to illustrate a general scheme for  local class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLASS lcl_event_handler DEFINITION .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;PUBLIC SECTION .&lt;/P&gt;&lt;P&gt;METHODS:&lt;/P&gt;&lt;P&gt;*--To add new functional buttons to the ALV toolbar&lt;/P&gt;&lt;P&gt;handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_object e_interactive ,&lt;/P&gt;&lt;P&gt;*--To implement user commands&lt;/P&gt;&lt;P&gt;handle_user_command&lt;/P&gt;&lt;P&gt;FOR EVENT user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_ucomm ,&lt;/P&gt;&lt;P&gt;*--Hotspot click control&lt;/P&gt;&lt;P&gt;handle_hotspot_click&lt;/P&gt;&lt;P&gt;FOR EVENT hotspot_click OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_row_id e_column_id es_row_no ,&lt;/P&gt;&lt;P&gt;*--Double-click control&lt;/P&gt;&lt;P&gt;handle_double_click&lt;/P&gt;&lt;P&gt;FOR EVENT double_click OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_row e_column ,&lt;/P&gt;&lt;P&gt;*--To be triggered before user commands&lt;/P&gt;&lt;P&gt;handle_before_user_command&lt;/P&gt;&lt;P&gt;FOR EVENT before_user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_ucomm ,&lt;/P&gt;&lt;P&gt;*--To be triggered after user commands&lt;/P&gt;&lt;P&gt;handle_after_user_command&lt;/P&gt;&lt;P&gt;FOR EVENT context_menu_request OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_object&lt;/P&gt;&lt;P&gt;*--Controlling data changes when ALV Grid is editable&lt;/P&gt;&lt;P&gt;handle_data_changed&lt;/P&gt;&lt;P&gt;FOR EVENT data_changed OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING er_data_changed ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--To be triggered after data changing is finished&lt;/P&gt;&lt;P&gt;handle_data_changed_finished&lt;/P&gt;&lt;P&gt;FOR EVENT data_changed_finished OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_modified ,&lt;/P&gt;&lt;P&gt;*--To control menu buttons&lt;/P&gt;&lt;P&gt;handle_menu_button&lt;/P&gt;&lt;P&gt;FOR EVENT menu_button OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_oject e_ucomm ,&lt;/P&gt;&lt;P&gt;*--To control button clicks&lt;/P&gt;&lt;P&gt;handle_button_click&lt;/P&gt;&lt;P&gt;FOR EVENT button_click OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_oject e_ucomm .&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLASS lcl_event_handler IMPLEMENTATION .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;*--Handle Toolbar&lt;/P&gt;&lt;P&gt;METHOD handle_toolbar.&lt;/P&gt;&lt;P&gt;PERFORM handle_toolbar USING e_object e_interactive .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Hotspot Click&lt;/P&gt;&lt;P&gt;METHOD handle_hotspot_click .&lt;/P&gt;&lt;P&gt;PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Double Click&lt;/P&gt;&lt;P&gt;METHOD handle_double_click .&lt;/P&gt;&lt;P&gt;PERFORM handle_double_click USING e_row e_column es_row_no .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle User Command&lt;/P&gt;&lt;P&gt;METHOD handle_user_command .&lt;/P&gt;&lt;P&gt;PERFORM handle_user_command USING e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;*--Handle After User Command&lt;/P&gt;&lt;P&gt;METHOD handle_context_menu_request .&lt;/P&gt;&lt;P&gt;PERFORM handle_context_menu_request USING e_object .&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;*--Handle Before User Command&lt;/P&gt;&lt;P&gt;METHOD handle_before_user_command .&lt;/P&gt;&lt;P&gt;PERFORM handle_before_user_command USING e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Data Changed&lt;/P&gt;&lt;P&gt;METHOD handle_data_changed .&lt;/P&gt;&lt;P&gt;PERFORM handle_data_changed USING er_data_changed .&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;*--Handle Data Changed Finished&lt;/P&gt;&lt;P&gt;METHOD handle_data_changed_finished .&lt;/P&gt;&lt;P&gt;PERFORM handle_data_changed_finished USING e_modified .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Menu Buttons&lt;/P&gt;&lt;P&gt;METHOD handle_menu_button .&lt;/P&gt;&lt;P&gt;PERFORM handle_menu_button USING e_object e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Button Click&lt;/P&gt;&lt;P&gt;METHOD handle_button_click .&lt;/P&gt;&lt;P&gt;PERFORM handle_button_click USING e_object e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;ENDCLASS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Creating event handler instance and registering handler methods&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gr_event_handler TYPE REF TO lcl_event_handler .&lt;/P&gt;&lt;P&gt;.. ..&lt;/P&gt;&lt;P&gt;*--Creating an instance for the event handler&lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_event_handler .&lt;/P&gt;&lt;P&gt;*--Registering handler methods to handle ALV Grid events&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_user_command FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_toolbar FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_menu_button FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_double_click FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_hotspot_click FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_button_click FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_before_user_command&lt;/P&gt;&lt;P&gt;FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_context_menu_request&lt;/P&gt;&lt;P&gt;FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_data_changed FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_data_changed_finished&lt;/P&gt;&lt;P&gt;FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Hotspot Clicking&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;From field catalog field definitions, we know that we can make some columns to respond to single clicks as hotspots by setting the value for the field &amp;#147;HOTSPOT&amp;#148; to &amp;#145;X&amp;#146; while generating the field catalog. After clicking, the event &amp;#147;hotspot_click&amp;#148; is triggered. This event has three parameters in its interface. The parameter &amp;#147;e_row_id&amp;#148; is obsolete. Other two parameters are &amp;#147;es_row_no&amp;#148; which is of type &amp;#147;LVC_S_ROID&amp;#148; and passes information about the row index at &amp;#147;es_row_no-row_id&amp;#148;, and &amp;#147;e_column_id&amp;#148; of type &amp;#147;LVC_S_COL&amp;#148; which returns the column fieldname at &amp;#147;e_column_id-fieldname&amp;#148;. Utilizing these parameters you know where the user clicked and trigger your action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM handle_hotspot_click USING i_row_id TYPE lvc_s_row&lt;/P&gt;&lt;P&gt;i_column_id TYPE lvc_s_col&lt;/P&gt;&lt;P&gt;is_row_no TYPE lvc_s_roid.&lt;/P&gt;&lt;P&gt;READ TABLE gt_list INDEX is_row_no-row_id .&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0 AND i_column_id-fieldname = 'SEATSOCC' .&lt;/P&gt;&lt;P&gt;CALL SCREEN 200 . "Details about passenger-seat matching&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDFORM .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in complete give u r mail id i will send useful material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward all helpful replies&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2007 17:50:51 GMT</pubDate>
    <dc:creator>suredarreddy_pulimamidi</dc:creator>
    <dc:date>2007-08-13T17:50:51Z</dc:date>
    <item>
      <title>ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626246#M603474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a grid display for displaying data.Now when i click a particular line i need to get a gist i.e the data of that particular line displayed in a vertical manner (like in the database). wat do i have to use to pul it up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kavitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2007 03:49:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626246#M603474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-06T03:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626247#M603475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if u r using the following FM to display ALV grid. &lt;/P&gt;&lt;P&gt;'REUSE_ALV_GRID_DISPLAY'    &lt;/P&gt;&lt;P&gt;Exporting&lt;/P&gt;&lt;P&gt;Remove emporting parameter comment line for the below field and assign  field which was newly created as below  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:  W_CALLBACK_UCOMM  TYPE SLIS_FORMNAME VALUE 'USER_COMMANDS',&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign to th FM as per below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I_CALLBACK_USER_COMMAND     = W_CALLBACK_UCOMM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dyanmically it call the routine as shown below. so need to create it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM USER_COMMANDS USING R_UCOMM LIKE SY-UCOMM&lt;/P&gt;&lt;P&gt;                 RS_SELFIELD TYPE SLIS_SELFIELD.""#EC CALLED&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF RS_SELFIELD-TABINDEX IS INITIAL.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt; ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CASE R_UCOMM.&lt;/P&gt;&lt;P&gt;ENDCASE&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;U need to write logic in case and endcase  for wat u want to display. whether it is box or new screen wat ever. As per u r requirment. if u want to pop up display lot fm are there. Pls find from se 37&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2007 04:30:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626247#M603475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-06T04:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626248#M603476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' Or grid display&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_CALLBACK_PROGRAM = GT_REPID&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND' " FORM NAME&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;IT_FIELDCAT = GT_FIELDCAT&lt;/P&gt;&lt;P&gt;.....................................&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;T_OUTTAB = ITAB&lt;/P&gt;&lt;P&gt;........................... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM&lt;/P&gt;&lt;P&gt;RS_SELFIELD TYPE SLIS_SELFIELD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE R_UCOMM.&lt;/P&gt;&lt;P&gt;When '&amp;amp;IC1'. " here your double occurs&lt;/P&gt;&lt;P&gt;if rs_selfield-fieldname = '&amp;lt;your field name&amp;gt;'   " give the field name which you want to double click.&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;Write your code here..&lt;/P&gt;&lt;P&gt;I.e write your select statements retrieve data into internal table and use&lt;/P&gt;&lt;P&gt;"REUSE_ALV_POPUP_TO_SELECT" to show the details in a small window..&lt;/P&gt;&lt;P&gt;or you can REUSE_ALV_GRID_DISPLAY again for second line items&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if rs_selfield-fieldname = '&amp;lt;your field name&amp;gt;'   " give another field name which you want to double click.&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;Write your code here..&lt;/P&gt;&lt;P&gt;I.e write your select statements retrieve data into internal table and use&lt;/P&gt;&lt;P&gt;"REUSE_ALV_POPUP_TO_SELECT" to show the details in a small window..&lt;/P&gt;&lt;P&gt;or you can REUSE_ALV_GRID_DISPLAY again for second line items&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewards if useful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2007 05:35:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626248#M603476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-06T05:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626249#M603477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for this in &amp;lt;b&amp;gt;oops ALV&amp;lt;/b&amp;gt;  you have to use EVENTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the &amp;lt;b&amp;gt;fallowing EVENTS and there usage is given.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;button_click&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Query a click on a pushbutton in the ALV Grid Control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;double_click&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Query a double-click on a cell of the ALV Grid control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;hotspot_click&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Query a hotspot click on columns defined for this purpose in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;onDrag&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Collect information when elements of the ALV Grid Control are dragged&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;toolbar&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Change, delete or add GUI elements in the toolbar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General Scheme for the Event Handler Class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample code to illustrate a general scheme for  local class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLASS lcl_event_handler DEFINITION .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;PUBLIC SECTION .&lt;/P&gt;&lt;P&gt;METHODS:&lt;/P&gt;&lt;P&gt;*--To add new functional buttons to the ALV toolbar&lt;/P&gt;&lt;P&gt;handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_object e_interactive ,&lt;/P&gt;&lt;P&gt;*--To implement user commands&lt;/P&gt;&lt;P&gt;handle_user_command&lt;/P&gt;&lt;P&gt;FOR EVENT user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_ucomm ,&lt;/P&gt;&lt;P&gt;*--Hotspot click control&lt;/P&gt;&lt;P&gt;handle_hotspot_click&lt;/P&gt;&lt;P&gt;FOR EVENT hotspot_click OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_row_id e_column_id es_row_no ,&lt;/P&gt;&lt;P&gt;*--Double-click control&lt;/P&gt;&lt;P&gt;handle_double_click&lt;/P&gt;&lt;P&gt;FOR EVENT double_click OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_row e_column ,&lt;/P&gt;&lt;P&gt;*--To be triggered before user commands&lt;/P&gt;&lt;P&gt;handle_before_user_command&lt;/P&gt;&lt;P&gt;FOR EVENT before_user_command OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_ucomm ,&lt;/P&gt;&lt;P&gt;*--To be triggered after user commands&lt;/P&gt;&lt;P&gt;handle_after_user_command&lt;/P&gt;&lt;P&gt;FOR EVENT context_menu_request OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_object&lt;/P&gt;&lt;P&gt;*--Controlling data changes when ALV Grid is editable&lt;/P&gt;&lt;P&gt;handle_data_changed&lt;/P&gt;&lt;P&gt;FOR EVENT data_changed OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING er_data_changed ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--To be triggered after data changing is finished&lt;/P&gt;&lt;P&gt;handle_data_changed_finished&lt;/P&gt;&lt;P&gt;FOR EVENT data_changed_finished OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_modified ,&lt;/P&gt;&lt;P&gt;*--To control menu buttons&lt;/P&gt;&lt;P&gt;handle_menu_button&lt;/P&gt;&lt;P&gt;FOR EVENT menu_button OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_oject e_ucomm ,&lt;/P&gt;&lt;P&gt;*--To control button clicks&lt;/P&gt;&lt;P&gt;handle_button_click&lt;/P&gt;&lt;P&gt;FOR EVENT button_click OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;IMPORTING e_oject e_ucomm .&lt;/P&gt;&lt;P&gt;PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLASS lcl_event_handler IMPLEMENTATION .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;*--Handle Toolbar&lt;/P&gt;&lt;P&gt;METHOD handle_toolbar.&lt;/P&gt;&lt;P&gt;PERFORM handle_toolbar USING e_object e_interactive .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Hotspot Click&lt;/P&gt;&lt;P&gt;METHOD handle_hotspot_click .&lt;/P&gt;&lt;P&gt;PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Double Click&lt;/P&gt;&lt;P&gt;METHOD handle_double_click .&lt;/P&gt;&lt;P&gt;PERFORM handle_double_click USING e_row e_column es_row_no .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle User Command&lt;/P&gt;&lt;P&gt;METHOD handle_user_command .&lt;/P&gt;&lt;P&gt;PERFORM handle_user_command USING e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;*--Handle After User Command&lt;/P&gt;&lt;P&gt;METHOD handle_context_menu_request .&lt;/P&gt;&lt;P&gt;PERFORM handle_context_menu_request USING e_object .&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;*--Handle Before User Command&lt;/P&gt;&lt;P&gt;METHOD handle_before_user_command .&lt;/P&gt;&lt;P&gt;PERFORM handle_before_user_command USING e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Data Changed&lt;/P&gt;&lt;P&gt;METHOD handle_data_changed .&lt;/P&gt;&lt;P&gt;PERFORM handle_data_changed USING er_data_changed .&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;*--Handle Data Changed Finished&lt;/P&gt;&lt;P&gt;METHOD handle_data_changed_finished .&lt;/P&gt;&lt;P&gt;PERFORM handle_data_changed_finished USING e_modified .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Menu Buttons&lt;/P&gt;&lt;P&gt;METHOD handle_menu_button .&lt;/P&gt;&lt;P&gt;PERFORM handle_menu_button USING e_object e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;*--Handle Button Click&lt;/P&gt;&lt;P&gt;METHOD handle_button_click .&lt;/P&gt;&lt;P&gt;PERFORM handle_button_click USING e_object e_ucomm .&lt;/P&gt;&lt;P&gt;ENDMETHOD .&lt;/P&gt;&lt;P&gt;ENDCLASS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Creating event handler instance and registering handler methods&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gr_event_handler TYPE REF TO lcl_event_handler .&lt;/P&gt;&lt;P&gt;.. ..&lt;/P&gt;&lt;P&gt;*--Creating an instance for the event handler&lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_event_handler .&lt;/P&gt;&lt;P&gt;*--Registering handler methods to handle ALV Grid events&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_user_command FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_toolbar FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_menu_button FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_double_click FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_hotspot_click FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_button_click FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_before_user_command&lt;/P&gt;&lt;P&gt;FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_context_menu_request&lt;/P&gt;&lt;P&gt;FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_data_changed FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;SET HANDLER gr_event_handler-&amp;gt;handle_data_changed_finished&lt;/P&gt;&lt;P&gt;FOR gr_alvgrid .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Hotspot Clicking&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;From field catalog field definitions, we know that we can make some columns to respond to single clicks as hotspots by setting the value for the field &amp;#147;HOTSPOT&amp;#148; to &amp;#145;X&amp;#146; while generating the field catalog. After clicking, the event &amp;#147;hotspot_click&amp;#148; is triggered. This event has three parameters in its interface. The parameter &amp;#147;e_row_id&amp;#148; is obsolete. Other two parameters are &amp;#147;es_row_no&amp;#148; which is of type &amp;#147;LVC_S_ROID&amp;#148; and passes information about the row index at &amp;#147;es_row_no-row_id&amp;#148;, and &amp;#147;e_column_id&amp;#148; of type &amp;#147;LVC_S_COL&amp;#148; which returns the column fieldname at &amp;#147;e_column_id-fieldname&amp;#148;. Utilizing these parameters you know where the user clicked and trigger your action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM handle_hotspot_click USING i_row_id TYPE lvc_s_row&lt;/P&gt;&lt;P&gt;i_column_id TYPE lvc_s_col&lt;/P&gt;&lt;P&gt;is_row_no TYPE lvc_s_roid.&lt;/P&gt;&lt;P&gt;READ TABLE gt_list INDEX is_row_no-row_id .&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0 AND i_column_id-fieldname = 'SEATSOCC' .&lt;/P&gt;&lt;P&gt;CALL SCREEN 200 . "Details about passenger-seat matching&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDFORM .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in complete give u r mail id i will send useful material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward all helpful replies&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2007 17:50:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2626249#M603477</guid>
      <dc:creator>suredarreddy_pulimamidi</dc:creator>
      <dc:date>2007-08-13T17:50:51Z</dc:date>
    </item>
  </channel>
</rss>

