<?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 ALV issue: method DATA_CHANGED called twice in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784892#M338081</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;I have implemented my own F4 for my ALV and now I get a problem since my DATA_CHANGED method is called BEFORE I change the cell content AND AFTER and this causes problems in my logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a demo program in SLIS ("BCALV_EDIT_03") but they use the default F4 that comes from the DDIC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another issue is that their MT_GOOD_CELLS always have the last cell that was changed, while my MT_GOOD_CELLS have all the cell I changed from previous visits to DATA_CHNAGED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example I change the value of FieldA and I visit the MY_DATA_CHANGED method and MT_GOOD_CELLS have 1 record with data on FieldA.&lt;/P&gt;&lt;P&gt;Than I change FieldB and when I visit MY_DATA_CHANGED method  the MT_GOOD_CELLS have 2 record: 1 with data on FieldA and 1 with data on FieldB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;ayal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Dec 2006 14:58:22 GMT</pubDate>
    <dc:creator>yes_sapteam</dc:creator>
    <dc:date>2006-12-17T14:58:22Z</dc:date>
    <item>
      <title>ALV issue: method DATA_CHANGED called twice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784892#M338081</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;I have implemented my own F4 for my ALV and now I get a problem since my DATA_CHANGED method is called BEFORE I change the cell content AND AFTER and this causes problems in my logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a demo program in SLIS ("BCALV_EDIT_03") but they use the default F4 that comes from the DDIC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another issue is that their MT_GOOD_CELLS always have the last cell that was changed, while my MT_GOOD_CELLS have all the cell I changed from previous visits to DATA_CHNAGED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example I change the value of FieldA and I visit the MY_DATA_CHANGED method and MT_GOOD_CELLS have 1 record with data on FieldA.&lt;/P&gt;&lt;P&gt;Than I change FieldB and when I visit MY_DATA_CHANGED method  the MT_GOOD_CELLS have 2 record: 1 with data on FieldA and 1 with data on FieldB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;ayal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Dec 2006 14:58:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784892#M338081</guid>
      <dc:creator>yes_sapteam</dc:creator>
      <dc:date>2006-12-17T14:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: ALV issue: method DATA_CHANGED called twice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784893#M338082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ayal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample report &amp;lt;b&amp;gt;BCALV_TEST_GRID_F4_HELP&amp;lt;/b&amp;gt; explains most of the F4 help options in ALV lists. You can choose to check values before and after the F4 event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your event handler method for event DATA_CHANGED should be triggered only AFTER calling the F4 help then I guess you should have the following coding in your method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* We are in the F4 event
  IF ( e_onf4 = 'X' ).
 
*   Event: after the F4 help value has been selected
    IF ( e_onf4_after = 'X' ).
*    valide values selected by F4 help
     ...
   ELSE.
     RETURN.  " leave method my_data_changed
   ENDIF.

  ENDIF.&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>Sun, 17 Dec 2006 20:03:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784893#M338082</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-12-17T20:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: ALV issue: method DATA_CHANGED called twice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784894#M338083</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;Thanx for the reply but my problem is that if I compare my program behaviour to the demo program "BCALV_EDIT_03" I see that their DATA_CHANGED method is only visited when the Enter is pressed and &amp;lt;i&amp;gt;only after&amp;lt;/i&amp;gt; a value was changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I copied this demo program code to the letter and still my method is visited twice !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some Java experiance and I don't understand why this event should ever be called twice. I think that there should be an event of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;before_data_changed&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; and another &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;after_data_changed&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;, but that's me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another issue I have is that my &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;mt_good_cells&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; have all the fields I touched while it should only have the last field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx&lt;/P&gt;&lt;P&gt;ayal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 19:40:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue-method-data-changed-called-twice/m-p/1784894#M338083</guid>
      <dc:creator>yes_sapteam</dc:creator>
      <dc:date>2006-12-18T19:40:08Z</dc:date>
    </item>
  </channel>
</rss>

