<?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: CL_GUI_ALV_GRID check changed data not triggering event handler method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328039#M1395671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did u try to use &lt;/P&gt;&lt;P&gt;SET_REGISTERED_EVENTS method to register the event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD g_grid-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: rajesh khatwa on Nov 6, 2009 6:12 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Nov 2009 16:57:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-06T16:57:39Z</dc:date>
    <item>
      <title>CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328036#M1395668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a method in my class has_data_changed( ) which asks the Grid whether any data has been chnaged so that I can update my delta tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inside the method has_data_changed( ) I am calling&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;l_grid-&amp;gt;check_changed_data( IMPORTING e_valid = l_valid )&lt;/STRONG&gt; and I have got a event handler method in the same class for event data change of GRID . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sometimes the check_changed_data is not triggering the event handler method . I dont know what exactly is the problem .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am setting the handlers also correctly. Could you please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message - Moved to the correct forum&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Nov 6, 2009 11:07 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 16:00:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328036#M1395668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-06T16:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328037#M1395669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please check if u changed system events to application events ...in that case u need to call CL_GUI_CFW=&amp;gt;DISPATCH in the PAI module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 16:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328037#M1395669</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-06T16:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328038#M1395670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked in the constrcutor of ALV_GRID i changed i_appl_events = 'X' to space . Still the event handler is not getting triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more thing I noticed , I have some fields registered for event on_f4 ie &lt;/P&gt;&lt;P&gt;  l_f4-fieldname = 'ID'.&lt;/P&gt;&lt;P&gt;  l_f4-register = 'X'.&lt;/P&gt;&lt;P&gt;  l_f4-GETBEFORE = 'X'.&lt;/P&gt;&lt;P&gt;  l_f4-CHNGEAFTER = 'X'.&lt;/P&gt;&lt;P&gt;  INSERT l_f4 INTO TABLE lt_f4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I go to change mode for this field and press f4 the event handler for  data_changed is getting triggered ,but when i change the data and press save ( where I am calling l_grid-&amp;gt;check_changed_data) the event is not getting triggered.It even does not go inside the std sap code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when I modify a field which is not registered for f4 and press save the event is getting triggered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 16:48:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328038#M1395670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-06T16:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328039#M1395671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did u try to use &lt;/P&gt;&lt;P&gt;SET_REGISTERED_EVENTS method to register the event&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD g_grid-&amp;gt;register_edit_event&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: rajesh khatwa on Nov 6, 2009 6:12 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 16:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328039#M1395671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-06T16:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328040#M1395672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ya I have used that also but still the event inside save method( where I call l_gird-&amp;gt;check_changed_data(  )  is not getting triggered  ), if the last edited field in my grid is a field that is registered for f4 event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Nov 2009 19:58:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328040#M1395672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-07T19:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328041#M1395673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have a look at thread &lt;SPAN __jive_macro_name="thread" id="376060"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and the blog [A Christmas Collection of Useful Classes|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12377] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am almost sure that the problem is due to a "misplacement" (i.e. wrong timing) of the method call CHECK_DATA_CHANGED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Without parts of the coding where one can see the flow of the program it is not possible to give more concrete advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2009 03:51:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328041#M1395673</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-11-09T03:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328042#M1395674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo Uwe,&lt;/P&gt;&lt;P&gt;Thanks  a lot ,But i did not get my reqd answer .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my event handler method on_data_changed I want to update my delta tables &lt;/P&gt;&lt;P&gt;my_new_and_changed_records( which consists of newly added records as well as changed records ) .&lt;/P&gt;&lt;P&gt;and also my_deleted_records(  which consists of deleted records ). ie the user has freedom to do anything in the Grid.Inside on_data_changed i am getting all the updated records , modifed cells . deleted rows in to my local class attributes . Then I am using that to fill my delta tables . I am making sure that only when user presses save I am updating the delta recods( my_new_and_changed_records &lt;/P&gt;&lt;P&gt;and my_deleted_records)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA l_record TYPE t_record.
  DATA l_display_record LIKE LINE OF my_display_records.
  DATA: l_modified_cell TYPE lvc_s_modi.
  FIELD-SYMBOLS : &amp;lt;fs_field_value&amp;gt; TYPE ANY.
 
IF i_data_changed IS BOUND.
    APPEND LINES OF i_data_changed-&amp;gt;mt_mod_cells TO my_modified_cells.
    APPEND LINES OF i_data_changed-&amp;gt;mt_inserted_rows TO my_inserted_rows.
    APPEND LINES OF i_data_changed-&amp;gt;mt_deleted_rows TO my_deleted_rows.
  ENDIF.


if my_save_flag eq 'X'.  
LOOP AT my_modified_cells INTO l_modified_cell
                        WHERE value IS NOT INITIAL
                        AND error NE 'X'.
* Mae sure that it is not Inserted rows whihc is handled separately
    READ TABLE my_inserted_rows WITH KEY row_id = l_modified_cell-row_id TRANSPORTING NO FIELDS.

    IF sy-subrc NE 0.

      READ TABLE my_display_records  INDEX l_modified_cell-row_id INTO l_display_record.

      IF l_display_record IS NOT INITIAL.

        ASSIGN COMPONENT l_modified_cell-fieldname OF   STRUCTURE l_display_record TO &amp;lt;fs_field_value&amp;gt;.

        &amp;lt;fs_field_value&amp;gt; = l_modified_cell-value.

        MOVE-CORRESPONDING l_display_record TO l_record.

        READ TABLE my_new_and_changed_records WITH KEY id = l_record-id
                                                       valid_from = l_record-valid_from
                                                       valid_to = l_record-valid_to
                 TRANSPORTING NO FIELDS.

        IF sy-subrc EQ 0.
          MODIFY my_new_and_changed_records FROM l_record INDEX sy-tabix.
        ELSE.
          APPEND l_record TO my_new_and_changed_records.
        ENDIF.

      ENDIF.

    ENDIF.

    CLEAR: l_display_record,
            l_record.


  ENDLOOP.
************************Modification Operation ends*********************

**************************Insert operation*********************************

LOOP AT my_inserted_rows INTO l_inserted_row.

      READ TABLE my_deleted_rows WITH KEY row_id = l_inserted_row-row_id
      TRANSPORTING NO FIELDS.

      IF sy-subrc NE 0.

        IF i_data_changed IS BOUND.

          l_record = get_cell_values( i_row_id = l_inserted_row-row_id
                                   i_data_changed = i_data_changed ).

        ELSE.

          READ TABLE my_display_records  INDEX l_inserted_row-row_id INTO l_display_record.

          MOVE-CORRESPONDING l_display_record TO l_record.

        ENDIF.

        IF l_record IS NOT INITIAL.

          APPEND l_record TO my_new_and_changed_records.

        ENDIF.

      ENDIF.

    ENDLOOP.
*************End of Insert operation*****************
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now here I have two problems &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 I am explicitly calling on_data_change event handler method in my save bcs l_grid-&amp;gt;check_changed_data is not working fine . &lt;/P&gt;&lt;P&gt;Is htere any way to find l_grid-&amp;gt;check_changed_data  is triggered or not &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 I am having a problem with the combination of deelted rows and inserted rows . If the user deletes &lt;/P&gt;&lt;P&gt;the first row in my_display_records and then inserts a new one . He presses save , then both the row ids in my_inserted_row as well as my_deleted_row are  one. How to differentiate b/w/ this two what the user did first?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2009 10:26:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328042#M1395674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-09T10:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328043#M1395675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Arshad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my opinion your approach is much too complicated. Instead of trying to collect all the changes during the editing process by the user I would recommend a much simpler way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Before displaying your ALV list store a PBO image of your data&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
  gt_outtab            TYPE ty_t_outtab,
  gt_outtab_pbo    TYPE ty_t_outtab.
...

gt_outtab_pbo = gt_outtab.
...
CALL METHOD go_grid-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY(...). 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. When the user pushes the SAVE button compare the PAI vs PBO data, e.g.:&lt;/P&gt;&lt;P&gt;[Comparing Two Internal Tables - A Generic Approach|http://wiki.sdn.sap.com/wiki/display/Snippets/Comparing&lt;EM&gt;Two&lt;/EM&gt;Internal&lt;EM&gt;Tables&lt;/EM&gt;-&lt;EM&gt;A&lt;/EM&gt;Generic+Approach]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Update the PBO data after saving the data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
gt_outtab_pbo = gt_outtab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Nov 2009 15:09:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328043#M1395675</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-11-09T15:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: CL_GUI_ALV_GRID check changed data not triggering event handler method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328044#M1395676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the coding only to see that this compare method does not work for global structures and global table types with line type structures .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not displaying the table as such in the grid , I am showing a global structure with different fields ( compared to the global table ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*It is catching the exception name_tab error inside &lt;/P&gt;&lt;P&gt;FM CHANGEDOCUMENT_PREPARE_TABLES*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have to write back the display records in PBO and PAI to the table records and do the compare I suppose : (&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Nov 2009 21:23:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-gui-alv-grid-check-changed-data-not-triggering-event-handler-method/m-p/6328044#M1395676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-11T21:23:53Z</dc:date>
    </item>
  </channel>
</rss>

