<?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 Refresh? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320883#M1637296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcin, I tried setting I_APPL_EVENTS while creating grid2, but it did not refresh my other grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm calling method register_edit_event of cl_gui_alv_grid and it has only the event id as input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2011 11:30:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-18T11:30:05Z</dc:date>
    <item>
      <title>ALV Refresh?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320881#M1637294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have gone through some of the ealier threads on ALV refresh issue, but they don't exactly solve my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I have developed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Design:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Created a custom container in screen 100. &lt;/P&gt;&lt;P&gt;2. With this custom container as a parent, created a splitter container of 2 rows.&lt;/P&gt;&lt;P&gt;3. Splitter container row1 is used to create ALV grid1&lt;/P&gt;&lt;P&gt;4. Splitter container rwo2 is used to created ALV grid 2, which is editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When user changes some field values in Grid 2, the data in Grid 1 has to be changed as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this I had registered event cl_gui_alv_grid=&amp;gt;mc_evt_enter for Grid2 and in the handler method, I'm modifying the contents of internal table displayed in Grid1.  Then I'm calling method grid1-&amp;gt;refresh_table_display. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't seem to be refreshing the data in Grid1 although the data is changed in the underlying internal table.&lt;/P&gt;&lt;P&gt;There are some derived columns in Grid2 that are getting updated alright when the data changes after I call grid2-&amp;gt;refresh_table_display, but Grid1 is completely unresponsive.&lt;/P&gt;&lt;P&gt;I have tried calling Grid1-&amp;gt;check_data_changed before refresh, but no effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is Grid1 not getting refreshed?&lt;/P&gt;&lt;P&gt;Can you pls help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Arthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 07:28:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320881#M1637294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-18T07:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320882#M1637295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ALV refresh creates lots of confusions for many developers. Quick check if triggering an &lt;STRONG&gt;application event&lt;/STRONG&gt; solves the issue. You can register events as the one mentioned with two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) while creating ALV set &lt;EM&gt;I_APPL_EVENTS = 'X'&lt;/EM&gt; parameter&lt;/P&gt;&lt;P&gt;2) while registering event (method SET_REGISTERED_EVENTS) pass your events setting flag &lt;EM&gt;APPL_EVENT&lt;/EM&gt; of structure &lt;EM&gt;CNTL_SIMPLE_EVENT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will cause dialog step to be executed once event is triggered, which will likely refresh your data on screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 08:50:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320882#M1637295</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2011-11-18T08:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320883#M1637296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcin, I tried setting I_APPL_EVENTS while creating grid2, but it did not refresh my other grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm calling method register_edit_event of cl_gui_alv_grid and it has only the event id as input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 11:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320883#M1637296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-18T11:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320884#M1637297</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;After you set I_APPL_EVENTS , event will trigger pai . In the PAI create a module refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And create a global variable gv_modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside the alv data changed event set &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gv_modified = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will trigger pai and by the help of variable your code block will update data and alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE refresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK gv_modified = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change Table....&lt;/P&gt;&lt;P&gt;Refresh ALV's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" Clear Variable&lt;/P&gt;&lt;P&gt;gv_modifided = ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 11:44:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320884#M1637297</guid>
      <dc:creator>huseyindereli</dc:creator>
      <dc:date>2011-11-18T11:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Refresh?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320885#M1637298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Hüseyin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried doing CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code( lv_fcode ) in the handler method as well to trigger PAI.&lt;/P&gt;&lt;P&gt;What I found was that this triggered the PBO (?!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Marcin and you mentioned, I_APPL_EVENTS is triggering a PAI but before the handler method executes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the sequence seems to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Change data in Grid2&lt;/P&gt;&lt;P&gt;2. If I_APPL_EVENTS is set, PAI is triggered.&lt;/P&gt;&lt;P&gt;3. Handler method for event data_changed is triggered. &lt;/P&gt;&lt;P&gt;4. If Method cl_gui_cfw=&amp;gt;set_new_ok_code( lv_fcode ) is called inside the above handler method, the PBO of the screen is triggered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have later found that a grid2-&amp;gt;refresh_table_display in the handler method works fine. I identified my mistake: I hadn't refreshed the data for the grid. I had been changing the main internal table from which this data is derived. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I have learnt something new today. &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 12:39:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-refresh/m-p/8320885#M1637298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-18T12:39:30Z</dc:date>
    </item>
  </channel>
</rss>

