<?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/2790975#M651121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radhika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can go through the document given below. See if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Controlling Data Changes:&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As we can now make our ALV Grid editable we may require controlling input data. The ALV Grid has events &amp;lt;i&amp;gt;&amp;#147;data_changed&amp;#148;&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;&amp;#147;data_changed_finished&amp;#148;&amp;lt;/i&amp;gt;. The former method is triggered just after the change at an editable field is perceived. Here you can make checks for the input. And the second event is triggered after the change is committed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select the way how the control perceives data changes by using the method &amp;lt;i&amp;gt;&amp;#147;register_edit_event&amp;#148;&amp;lt;/i&amp;gt;. You have two choices:&lt;/P&gt;&lt;P&gt;i. After return key is pressed: To select this way, to the parameter &amp;lt;i&amp;gt;&amp;#147;i_event_id&amp;#148;&amp;lt;/i&amp;gt; pass &amp;lt;i&amp;gt;&amp;#147;cl_gui_alv_grid=&amp;gt;mc_evt_enter&amp;#148;.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;ii. After the field is modified and the cursor is moved to another field: For this, pass&amp;lt;i&amp;gt; &amp;#147;cl_gui_alv_grid=&amp;gt;mc_evt_modifies&amp;#148;&amp;lt;/i&amp;gt; to the same parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make events controlling data changes be triggered, you must select either way by calling this method. Otherwise, these events will not be triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To control field data changes, ALV Grid uses an instance of the class &amp;lt;i&amp;gt;&amp;#147;CL_ALV_CHANGED_DATA_PROTOCOL&amp;#148;&amp;lt;/i&amp;gt; and passes this via the event &amp;lt;i&amp;gt;&amp;#147;data_changed&amp;#148;.&amp;lt;/i&amp;gt; Using methods of this class, you can get and modify cell values and produce error messages. Here are some of those methods:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;get_cell_value&amp;lt;/i&amp;gt; -&amp;gt; Gets the cell value. You pass the address of the cell to the interface.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;modify_cell&amp;lt;/i&amp;gt; -&amp;gt; Modifies the cell value addressed via parameters.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;add_protocol_entry&amp;lt;/i&amp;gt; -&amp;gt; Add a log entry. You make use of standard message interface with message type, message id, etc&amp;#133;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;protocol_is_visible&amp;lt;/i&amp;gt; -&amp;gt; Make the error table visible or not.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;refresh_protocol&amp;lt;/i&amp;gt; -&amp;gt; Refreshing log entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the reference of the instance, you can reach information about modifications. These useful attribute tables are:&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_MOD_CELLS&amp;lt;/i&amp;gt; -&amp;gt; Contains addresses of modified cells with &amp;#147;&amp;lt;i&amp;gt;row_id&amp;lt;/i&amp;gt;&amp;#148;s and &amp;#147;&amp;lt;i&amp;gt;fieldname&amp;lt;/i&amp;gt;&amp;#148;s.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MP_MOD_ROWS&amp;lt;/i&amp;gt; -&amp;gt; Contains modified rows. Its type is generic.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_GOOD_CELLS&amp;lt;/i&amp;gt; -&amp;gt; Contains cells having proper values&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_DELETED_ROWS&amp;lt;/i&amp;gt; -&amp;gt; Contains rows deleted from the list&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_INSERTED_ROWS&amp;lt;/i&amp;gt; -&amp;gt; Contains rows inserted to the list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Utilizing these methods and attributes you can check and give proper message and also modify the cell content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Example :&lt;/P&gt;&lt;P&gt;Code  &amp;#150; Checking the input together with a non-input value, adding a log and modifying the cell content&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;FORM handle_data_changed USING ir_data_changed&lt;/P&gt;&lt;P&gt;TYPE REF TO cl_alv_changed_data_protocol.&lt;/P&gt;&lt;P&gt;DATA : ls_mod_cell TYPE lvc_s_modi ,&lt;/P&gt;&lt;P&gt;lv_value TYPE lvc_value .&lt;/P&gt;&lt;P&gt;SORT ir_data_changed-&amp;gt;mt_mod_cells BY row_id .&lt;/P&gt;&lt;P&gt;LOOP AT ir_data_changed-&amp;gt;mt_mod_cells&lt;/P&gt;&lt;P&gt;INTO ls_mod_cell&lt;/P&gt;&lt;P&gt;WHERE fieldname = 'SEATSMAX' .&lt;/P&gt;&lt;P&gt;CALL METHOD ir_data_changed-&amp;gt;get_cell_value&lt;/P&gt;&lt;P&gt;EXPORTING i_row_id = ls_mod_cell-row_id&lt;/P&gt;&lt;P&gt;i_fieldname = 'CARRID'&lt;/P&gt;&lt;P&gt;IMPORTING e_value = lv_value .&lt;/P&gt;&lt;P&gt;IF lv_value = 'THY' AND ls_mod_cell-value &amp;gt; '500' .&lt;/P&gt;&lt;P&gt;CALL METHOD ir_data_changed-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_msgid = 'SU'&lt;/P&gt;&lt;P&gt;i_msgno = '000'&lt;/P&gt;&lt;P&gt;i_msgty = 'E'&lt;/P&gt;&lt;P&gt;i_msgv1 = 'This number can not exceed 500 for '&lt;/P&gt;&lt;P&gt;i_msgv2 = lv_value&lt;/P&gt;&lt;P&gt;i_msgv3 = 'The value is et to ''500'''&lt;/P&gt;&lt;P&gt;i_fieldname = ls_mod_cell-fieldname&lt;/P&gt;&lt;P&gt;i_row_id = ls_mod_cell-row_id .&lt;/P&gt;&lt;P&gt;CALL METHOD ir_data_changed-&amp;gt;modify_cell&lt;/P&gt;&lt;P&gt;EXPORTING i_row_id = ls_mod_cell-row_id&lt;/P&gt;&lt;P&gt;i_fieldname = ls_mod_cell-fieldname&lt;/P&gt;&lt;P&gt;i_value = '500' .&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDLOOP .&lt;/P&gt;&lt;P&gt;ENDFORM  "&amp;lt;i&amp;gt;handledatachanged&amp;lt;/i&amp;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;Reward Points if this is helpful to u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2007 06:07:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-12T06:07:53Z</dc:date>
    <item>
      <title>Alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790973#M651119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created one alv in oops. now when the user enter into change mode and selects one record in displayed alv and clicks on 'deleted row(-)' icon of alv, these record is getting deleted.&lt;/P&gt;&lt;P&gt;my requirement is to capture the deleted record and display deleted records in other alv. how can i achieve this thru 'delete row' icon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;same way i have to capture newly inserted records thru 'append row'  option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly help me. very urgent... points are for sure for all helpfull answers.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Radhika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 04:55:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790973#M651119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T04:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790974#M651120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Premraj,&lt;/P&gt;&lt;P&gt;If your using the ALV standard User Interface, then try with this method to get the modified data from the output screen "check_changed_data"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 05:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790974#M651120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T05:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790975#M651121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Radhika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can go through the document given below. See if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Controlling Data Changes:&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As we can now make our ALV Grid editable we may require controlling input data. The ALV Grid has events &amp;lt;i&amp;gt;&amp;#147;data_changed&amp;#148;&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;&amp;#147;data_changed_finished&amp;#148;&amp;lt;/i&amp;gt;. The former method is triggered just after the change at an editable field is perceived. Here you can make checks for the input. And the second event is triggered after the change is committed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select the way how the control perceives data changes by using the method &amp;lt;i&amp;gt;&amp;#147;register_edit_event&amp;#148;&amp;lt;/i&amp;gt;. You have two choices:&lt;/P&gt;&lt;P&gt;i. After return key is pressed: To select this way, to the parameter &amp;lt;i&amp;gt;&amp;#147;i_event_id&amp;#148;&amp;lt;/i&amp;gt; pass &amp;lt;i&amp;gt;&amp;#147;cl_gui_alv_grid=&amp;gt;mc_evt_enter&amp;#148;.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;ii. After the field is modified and the cursor is moved to another field: For this, pass&amp;lt;i&amp;gt; &amp;#147;cl_gui_alv_grid=&amp;gt;mc_evt_modifies&amp;#148;&amp;lt;/i&amp;gt; to the same parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make events controlling data changes be triggered, you must select either way by calling this method. Otherwise, these events will not be triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To control field data changes, ALV Grid uses an instance of the class &amp;lt;i&amp;gt;&amp;#147;CL_ALV_CHANGED_DATA_PROTOCOL&amp;#148;&amp;lt;/i&amp;gt; and passes this via the event &amp;lt;i&amp;gt;&amp;#147;data_changed&amp;#148;.&amp;lt;/i&amp;gt; Using methods of this class, you can get and modify cell values and produce error messages. Here are some of those methods:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;get_cell_value&amp;lt;/i&amp;gt; -&amp;gt; Gets the cell value. You pass the address of the cell to the interface.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;modify_cell&amp;lt;/i&amp;gt; -&amp;gt; Modifies the cell value addressed via parameters.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;add_protocol_entry&amp;lt;/i&amp;gt; -&amp;gt; Add a log entry. You make use of standard message interface with message type, message id, etc&amp;#133;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;protocol_is_visible&amp;lt;/i&amp;gt; -&amp;gt; Make the error table visible or not.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;refresh_protocol&amp;lt;/i&amp;gt; -&amp;gt; Refreshing log entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the reference of the instance, you can reach information about modifications. These useful attribute tables are:&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_MOD_CELLS&amp;lt;/i&amp;gt; -&amp;gt; Contains addresses of modified cells with &amp;#147;&amp;lt;i&amp;gt;row_id&amp;lt;/i&amp;gt;&amp;#148;s and &amp;#147;&amp;lt;i&amp;gt;fieldname&amp;lt;/i&amp;gt;&amp;#148;s.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MP_MOD_ROWS&amp;lt;/i&amp;gt; -&amp;gt; Contains modified rows. Its type is generic.&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_GOOD_CELLS&amp;lt;/i&amp;gt; -&amp;gt; Contains cells having proper values&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_DELETED_ROWS&amp;lt;/i&amp;gt; -&amp;gt; Contains rows deleted from the list&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;MT_INSERTED_ROWS&amp;lt;/i&amp;gt; -&amp;gt; Contains rows inserted to the list&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Utilizing these methods and attributes you can check and give proper message and also modify the cell content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Example :&lt;/P&gt;&lt;P&gt;Code  &amp;#150; Checking the input together with a non-input value, adding a log and modifying the cell content&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;FORM handle_data_changed USING ir_data_changed&lt;/P&gt;&lt;P&gt;TYPE REF TO cl_alv_changed_data_protocol.&lt;/P&gt;&lt;P&gt;DATA : ls_mod_cell TYPE lvc_s_modi ,&lt;/P&gt;&lt;P&gt;lv_value TYPE lvc_value .&lt;/P&gt;&lt;P&gt;SORT ir_data_changed-&amp;gt;mt_mod_cells BY row_id .&lt;/P&gt;&lt;P&gt;LOOP AT ir_data_changed-&amp;gt;mt_mod_cells&lt;/P&gt;&lt;P&gt;INTO ls_mod_cell&lt;/P&gt;&lt;P&gt;WHERE fieldname = 'SEATSMAX' .&lt;/P&gt;&lt;P&gt;CALL METHOD ir_data_changed-&amp;gt;get_cell_value&lt;/P&gt;&lt;P&gt;EXPORTING i_row_id = ls_mod_cell-row_id&lt;/P&gt;&lt;P&gt;i_fieldname = 'CARRID'&lt;/P&gt;&lt;P&gt;IMPORTING e_value = lv_value .&lt;/P&gt;&lt;P&gt;IF lv_value = 'THY' AND ls_mod_cell-value &amp;gt; '500' .&lt;/P&gt;&lt;P&gt;CALL METHOD ir_data_changed-&amp;gt;add_protocol_entry&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_msgid = 'SU'&lt;/P&gt;&lt;P&gt;i_msgno = '000'&lt;/P&gt;&lt;P&gt;i_msgty = 'E'&lt;/P&gt;&lt;P&gt;i_msgv1 = 'This number can not exceed 500 for '&lt;/P&gt;&lt;P&gt;i_msgv2 = lv_value&lt;/P&gt;&lt;P&gt;i_msgv3 = 'The value is et to ''500'''&lt;/P&gt;&lt;P&gt;i_fieldname = ls_mod_cell-fieldname&lt;/P&gt;&lt;P&gt;i_row_id = ls_mod_cell-row_id .&lt;/P&gt;&lt;P&gt;CALL METHOD ir_data_changed-&amp;gt;modify_cell&lt;/P&gt;&lt;P&gt;EXPORTING i_row_id = ls_mod_cell-row_id&lt;/P&gt;&lt;P&gt;i_fieldname = ls_mod_cell-fieldname&lt;/P&gt;&lt;P&gt;i_value = '500' .&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDLOOP .&lt;/P&gt;&lt;P&gt;ENDFORM  "&amp;lt;i&amp;gt;handledatachanged&amp;lt;/i&amp;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;Reward Points if this is helpful to u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 06:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790975#M651121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T06:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790976#M651122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhanu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u plz give me some sample program where data changes are captured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Radhika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 10:58:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790976#M651122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T10:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790977#M651123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;a href="http://www.erpgenie.com/sap/abap/controls/alvgrid.htm"&amp;gt;refer this&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2007 11:03:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790977#M651123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-12T11:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790978#M651124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Radhika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did u get it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2007 09:19:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2790978#M651124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-13T09:19:10Z</dc:date>
    </item>
  </channel>
</rss>

