<?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: Using the event handler data_changed and the related functionalities in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-the-event-handler-data-changed-and-the-related-functionalities/m-p/8315498#M1636839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You can use the the internal table &lt;STRONG&gt;mt_mod_cells&lt;/STRONG&gt; that gives you the cells that have been modified.&lt;/P&gt;&lt;P&gt;Take a look at this code snippet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    method handle_data_changed.
      perform handle_data_changed using er_data_changed.
    endmethod.
 
.....
 
form handle_data_changed using p_data_changed type ref to
                               cl_alv_changed_data_protocol.
 
  data: ls_mod_cell  type lvc_s_modi,
          lv_value_dni type lvc_value.
 
 
  loop at p_data_changed-&amp;gt;mt_mod_cells into ls_mod_cell.
 
    call method p_data_changed-&amp;gt;get_cell_value
      exporting
        i_row_id    = ls_mod_cell-row_id
        i_fieldname = 'FINI_SUST' &amp;lt;== Your field
      importing
        e_value     = lv_value_dni .
 
  endloop.
 
endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically when you modify the fields PRICE and SEATS you can get the modified values by using this technique and then modify the total amount in your internal table accordingly.&lt;/P&gt;&lt;P&gt;After that you should call the method REFRESH_TABLE_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Note that if you are using cl_gui_alv_grid=&amp;gt;mc_evt_enter, the event HANDLE_DATA_CHANGED will only be fired when you hit INTRO after having done the changes in your editable fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Nov 2011 13:26:20 GMT</pubDate>
    <dc:creator>former_member209703</dc:creator>
    <dc:date>2011-11-22T13:26:20Z</dc:date>
    <item>
      <title>Using the event handler data_changed and the related functionalities</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-the-event-handler-data-changed-and-the-related-functionalities/m-p/8315497#M1636838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My program has a grid display using OOPS with two fields editable namely price and seats occupied. If i make a change in either of those two fields, the total payment sum column should get automatically calculated and displayed.  I have made the field editable by using EDIT in field catalog. &lt;/P&gt;&lt;P&gt;I got theoretical notes regarding implementation of event handler, cl_gui_alv_grid=&amp;gt;mc_evt_enter etc. But I didnt understand how to practically implement it in the program. &lt;/P&gt;&lt;P&gt;How to detect change in the two mentioned columns and how to use the edited values to calculate the new amount. Please guide me in this . It would be much appreciated if someone can provide a clear code for a similar case. I am a beginner to the OOPS concepts in ALV. Provide simple solutions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 12:59:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-the-event-handler-data-changed-and-the-related-functionalities/m-p/8315497#M1636838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-22T12:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using the event handler data_changed and the related functionalities</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-the-event-handler-data-changed-and-the-related-functionalities/m-p/8315498#M1636839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You can use the the internal table &lt;STRONG&gt;mt_mod_cells&lt;/STRONG&gt; that gives you the cells that have been modified.&lt;/P&gt;&lt;P&gt;Take a look at this code snippet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    method handle_data_changed.
      perform handle_data_changed using er_data_changed.
    endmethod.
 
.....
 
form handle_data_changed using p_data_changed type ref to
                               cl_alv_changed_data_protocol.
 
  data: ls_mod_cell  type lvc_s_modi,
          lv_value_dni type lvc_value.
 
 
  loop at p_data_changed-&amp;gt;mt_mod_cells into ls_mod_cell.
 
    call method p_data_changed-&amp;gt;get_cell_value
      exporting
        i_row_id    = ls_mod_cell-row_id
        i_fieldname = 'FINI_SUST' &amp;lt;== Your field
      importing
        e_value     = lv_value_dni .
 
  endloop.
 
endform.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically when you modify the fields PRICE and SEATS you can get the modified values by using this technique and then modify the total amount in your internal table accordingly.&lt;/P&gt;&lt;P&gt;After that you should call the method REFRESH_TABLE_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Note that if you are using cl_gui_alv_grid=&amp;gt;mc_evt_enter, the event HANDLE_DATA_CHANGED will only be fired when you hit INTRO after having done the changes in your editable fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 13:26:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-the-event-handler-data-changed-and-the-related-functionalities/m-p/8315498#M1636839</guid>
      <dc:creator>former_member209703</dc:creator>
      <dc:date>2011-11-22T13:26:20Z</dc:date>
    </item>
  </channel>
</rss>

