<?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: Handler data_changed in ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819341#M1314629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In that case in your handler method call sender-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;So that the changed data is passed to teh grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2009 09:10:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-18T09:10:05Z</dc:date>
    <item>
      <title>Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819336#M1314624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the handler Data_changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the table "er_data_changed" is filled when a field is modified in the alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when the F4 for a field is used, then the "er_data_changed" is getting refreshed i.e, the other old  modified value are lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not want the old modification to be lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nishanth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 07:58:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819336#M1314624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T07:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819337#M1314625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Call the method CHECK_CHANGED_DATA in PAI.&lt;/P&gt;&lt;P&gt;Incase you want to handle the F4 event then create the handler method as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS handle_f4&lt;/P&gt;&lt;P&gt;    FOR EVENT onf4 OF cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;    IMPORTING e_fieldname&lt;/P&gt;&lt;P&gt;              e_fieldvalue&lt;/P&gt;&lt;P&gt;              es_row_no&lt;/P&gt;&lt;P&gt;              er_event_data&lt;/P&gt;&lt;P&gt;              et_bad_cells&lt;/P&gt;&lt;P&gt;              e_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 08:13:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819337#M1314625</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T08:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819338#M1314626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ankur, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to understand when to use "check_changed_data" and how does it help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kunal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 08:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819338#M1314626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T08:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819339#M1314627</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;The method Check_changed_data can be called while saving the contents of the modified ALV.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL METHOD g_grid-&amp;gt;check_changed_data
    IMPORTING
      e_valid = l_valid.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mansi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 08:30:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819339#M1314627</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T08:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819340#M1314628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ankur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well the problem is, I am not saving the contents of the ALV to the database  until the enter key is pressed. So until then i would like to have all modified data in er_data_changed-&amp;gt;mt_good_cells.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As of now, when i change the first data using F4, the change is recorded in er_data_changed-&amp;gt;mt_good_cells, but as i go on and modify secong record using F4, the first change is deleted and the new change is only recorded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully u have  a better picture of my problem now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;kunal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 08:37:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819340#M1314628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T08:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819341#M1314629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In that case in your handler method call sender-&amp;gt;REFRESH_TABLE_DISPLAY.&lt;/P&gt;&lt;P&gt;So that the changed data is passed to teh grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 09:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819341#M1314629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T09:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819342#M1314630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ankur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the same. But No success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kunal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 09:45:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819342#M1314630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T09:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819343#M1314631</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;Refer to the below code snippet:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
**Class Definition
CLASS: lcl_event_receiver DEFINITION DEFERRED.

SET HANDLER v_event_receiver-&amp;gt;handle_item_changed FOR v_ref_grid.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS lcl_event_receiver DEFINITION.
  METHODS : 
      handle_item_changed FOR EVENT data_changed_finished
                      OF cl_gui_alv_grid
                      IMPORTING e_modified et_good_cells.
ENDCLASS.                    "lcl_event_receiver DEFINITION

CLASS  lcl_event_receiver IMPLEMENTATION.
*--- modifying updated data in internal table
  METHOD handle_item_changed.
    PERFORM modify_table USING e_modified
                               et_good_cells.

  ENDMETHOD.                    "handle_item_changed
ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this perform you can use code like:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM modify_table  USING e_modified
                         et_good_cells TYPE lvc_t_modi.

  DATA: ls_good1 TYPE lvc_s_modi.

  READ TABLE et_good_cells INDEX 1 INTO ls_good1.
  IF sy-subrc = 0.
    CASE ls_good1-fieldname.
*--- When Material
      WHEN 'MATNR'. "&amp;lt;--field name
        READ TABLE it_zmm_spice_conv INTO wa_zmm_spice_conv
          INDEX ls_good1-row_id.
        IF sy-subrc = 0.
          wa_zmm_spice_conv-matnr = ls_good1-value.
          MODIFY it_zmm_spice_conv  FROM wa_zmm_spice_conv
            INDEX ls_good1-row_id TRANSPORTING matnr.
        ENDIF.
    ENDCASE.
  ENDIF.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly code for other fields (columns) as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 10:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819343#M1314631</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-06-18T10:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Handler data_changed in ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819344#M1314632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in that case u need to play with values like this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Registering Fields for F4 function.&lt;/P&gt;&lt;P&gt;  refresh: gt_f4a.&lt;/P&gt;&lt;P&gt;  gt_f4_wa-fieldname  = 'BELNR'.&lt;/P&gt;&lt;P&gt;  gt_f4_wa-register   = 'X'.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  *gt_f4_wa-getbefore  = 'X'.*
  *gt_f4_wa-chngeafter = 'X'.*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;--&amp;gt; Based on these values , your container get refreshed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more info , please check its documentations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 10:15:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handler-data-changed-in-alv/m-p/5819344#M1314632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-18T10:15:27Z</dc:date>
    </item>
  </channel>
</rss>

