<?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: Trigger ALV handle_data_change event for unit test in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-alv-handle-data-change-event-for-unit-test/m-p/739519#M35269</link>
    <description>&lt;P&gt;Got it on my own.&lt;BR /&gt;It was quiet simple&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;    ls_delta_cells-row_id    = sy-tabix.
    ls_delta_cells-fieldname = lv_fieldname.
    ls_delta_cells-value     = lv_value.
    APPEND ls_delta_cells TO lt_delta_cells.


    go_alv_grid-&amp;gt;set_delta_cells(
      EXPORTING
   it_delta_cells = lt_delta_cells
    i_modified     = abap_true
    ).
    go_alv_grid-&amp;gt;check_changed_data(  IMPORTING e_valid = lv_valid ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;That triggers data_changed&lt;/P&gt;</description>
    <pubDate>Mon, 03 Sep 2018 14:10:25 GMT</pubDate>
    <dc:creator>Marian_Zeis</dc:creator>
    <dc:date>2018-09-03T14:10:25Z</dc:date>
    <item>
      <title>Trigger ALV handle_data_change event for unit test</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-alv-handle-data-change-event-for-unit-test/m-p/739518#M35268</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;i try to test my ALV OO with a unit test.&lt;BR /&gt;So basiclly i try following:&lt;/P&gt;
  &lt;P&gt;Setup ALV&lt;BR /&gt;Load Data in ALV&lt;BR /&gt;Change Data (eg. just one cell) in ALV&lt;BR /&gt;Trigger handle_data_changed&lt;BR /&gt;Check if everything worked fine&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;So far i´ve tried with something like that:&lt;BR /&gt;&lt;A href="https://blogs.sap.com/2013/08/13/trigger-alv-datachange-event-manual/"&gt;https://blogs.sap.com/2013/08/13/trigger-alv-datachange-event-manual/&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;I know is supposed to be changed in the Frontend, but i guess is somehow possible just by code.&lt;/P&gt;
  &lt;P&gt;My code for the unit test method is:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;    f_cut-&amp;gt;setup_alv( ).
    f_cut-&amp;gt;tickets-&amp;gt;lt_ticketlist = me-&amp;gt;create_ticketlist( ).
    f_cut-&amp;gt;tickets-&amp;gt;go_alv_grid-&amp;gt;refresh_table_display( ).
    READ TABLE f_cut-&amp;gt;tickets-&amp;gt;lt_ticketlist ASSIGNING &amp;lt;ls_ticketlist&amp;gt; WITH KEY object_id = '4000010502'.
    &amp;lt;ls_ticketlist&amp;gt;-pos = 2.
    DATA: it_pos TYPE lvc_t_pos.
    DATA: is_pos TYPE LVC_S_POS.
    is_pos-fieldname = 'POS'.is_pos-row_id = 6.
    APPEND is_pos to it_pos.
    f_cut-&amp;gt;tickets-&amp;gt;go_alv_grid-&amp;gt;change_data_from_inside( it_cells = it_pos ).
    f_cut-&amp;gt;tickets-&amp;gt;go_alv_grid-&amp;gt;if_cached_prop~set_prop(
    EXPORTING
      PROPNAME = 'GridModified'
      PROPVALUE = '1').
    f_cut-&amp;gt;tickets-&amp;gt;go_alv_grid-&amp;gt;check_changed_data( ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 07:06:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-alv-handle-data-change-event-for-unit-test/m-p/739518#M35268</guid>
      <dc:creator>Marian_Zeis</dc:creator>
      <dc:date>2018-09-03T07:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger ALV handle_data_change event for unit test</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-alv-handle-data-change-event-for-unit-test/m-p/739519#M35269</link>
      <description>&lt;P&gt;Got it on my own.&lt;BR /&gt;It was quiet simple&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;    ls_delta_cells-row_id    = sy-tabix.
    ls_delta_cells-fieldname = lv_fieldname.
    ls_delta_cells-value     = lv_value.
    APPEND ls_delta_cells TO lt_delta_cells.


    go_alv_grid-&amp;gt;set_delta_cells(
      EXPORTING
   it_delta_cells = lt_delta_cells
    i_modified     = abap_true
    ).
    go_alv_grid-&amp;gt;check_changed_data(  IMPORTING e_valid = lv_valid ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;That triggers data_changed&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 14:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/trigger-alv-handle-data-change-event-for-unit-test/m-p/739519#M35269</guid>
      <dc:creator>Marian_Zeis</dc:creator>
      <dc:date>2018-09-03T14:10:25Z</dc:date>
    </item>
  </channel>
</rss>

