<?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: Editable OOPS ALV Grid - Issue with updated rows in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631012#M26449</link>
    <description>&lt;P&gt;hi&lt;/P&gt;
  &lt;P&gt;first register two events of alv grid class&lt;/P&gt;
  &lt;P&gt;those are MC_EVT_ENTER&lt;BR /&gt; MC_EVT_MODIFIED&lt;/P&gt;
  &lt;P&gt;using method REGISTER_EDIT_EVENT&lt;/P&gt;
  &lt;P&gt;after above you should also handle one more event i.e DATA_CHANGED_FINISHED&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 04:13:28 GMT</pubDate>
    <dc:creator>former_member241258</dc:creator>
    <dc:date>2018-02-14T04:13:28Z</dc:date>
    <item>
      <title>Editable OOPS ALV Grid - Issue with updated rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631010#M26447</link>
      <description>&lt;P&gt;Trying to get into ALV after a long time away...and I have a problem.&lt;/P&gt;
  &lt;P&gt;I have build an editable ALV that works fine. Fields are output as I want them, as well as the ones that I want being editable. It's basically a custom table that I'll save back to the database when I'm done. My problem is that when I hit the save button - my internal table doesn't pick up the changes that I made to the data and I don't know what to save back to the database. Here's where I build the grid...&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  CREATE_AND_INIT_ALV
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM create_and_init_alv CHANGING pt_outtab LIKE gt_outtab[]
                                  pt_fieldcat TYPE lvc_t_fcat
                                  pt_exclude TYPE ui_functions.

  CREATE OBJECT g_custom_container
    EXPORTING
      container_name = g_container.
  CREATE OBJECT g_grid
    EXPORTING
      i_parent = g_custom_container.

* Build fieldcat and set column team
* edit enabled. Assign a handle for the dropdown listbox.
  PERFORM build_fieldcat CHANGING pt_fieldcat.

* Optionally restrict generic functions to 'change only'.
*   (The user shall not be able to add new lines).
  PERFORM exclude_tb_functions CHANGING pt_exclude.

ENDFORM.                               "CREATE_AND_INIT_ALV&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;And this is where I fill the grid&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*      Form  REFRESH_DATA
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      &amp;lt;--P_GT_OUTTAB  text
*----------------------------------------------------------------------*
FORM refresh_data  USING    pa_initial LIKE wa_initial
                   CHANGING pt_outtab LIKE gt_outtab[]
                            pt_fieldcat TYPE lvc_t_fcat
                            pt_exclude TYPE ui_functions.


*Get the data from the database table.  Set the base to compare after
  CLEAR pt_outtab.
  SELECT * FROM ztable INTO TABLE pt_outtab.
  IF sy-subrc NE 0.
  ELSE.
    gt_outtab2 = pt_outtab.
  ENDIF.

  IF pa_initial = '1'.
    g_grid-&amp;gt;register_edit_event( i_event_id = cl_gui_alv_grid=&amp;gt;mc_evt_enter ).
    CALL METHOD g_grid-&amp;gt;set_table_for_first_display
      EXPORTING
        it_toolbar_excluding = pt_exclude
      CHANGING
        it_fieldcatalog      = pt_fieldcat
        it_outtab            = pt_outtab.

* Set editable cells to ready for input initially
    CALL METHOD g_grid-&amp;gt;set_ready_for_input
      EXPORTING
        i_ready_for_input = 1.
  ELSE.
    CALL METHOD g_grid-&amp;gt;refresh_table_display.
  ENDIF.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;So I would expect that I would be able to access updated date in the same table that I sent to the ALV - GT_OUTTAB? Unfortunately, getting the old values in the table instead of new values I edit? So the save doesn't doe anything??&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt; FORM save_total_updates CHANGING pt_outtab LIKE gt_outtab[]
                                pt_outtab2 LIKE gt_outtab[].

  CLEAR gt_modified.

  LOOP AT pt_outtab INTO gs_modified.
  READ TABLE pt_outtab2 WITH KEY resrc = gs_modified-resrc INTO gs_original.
    IF sy-subrc = 0.
      IF gs_modified NE gs_original.
        APPEND gs_modified TO gt_modified.
      ENDIF.
    ENDIF.
  ENDLOOP.

  MODIFY ztable FROM TABLE gt_modified.
  IF sy-subrc = 0.
    MESSAGE 'VALUES SAVED' TYPE 'I'.
  ELSE.
    MESSAGE 'Error Saving Values' TYPE 'I'.
  ENDIF.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Feb 2018 16:46:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631010#M26447</guid>
      <dc:creator>dude95</dc:creator>
      <dc:date>2018-02-13T16:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Editable OOPS ALV Grid - Issue with updated rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631011#M26448</link>
      <description>&lt;P&gt;Use the method G_GRID-&amp;gt;CHECK_CHANGED_DATA( )&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 21:35:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631011#M26448</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2018-02-13T21:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Editable OOPS ALV Grid - Issue with updated rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631012#M26449</link>
      <description>&lt;P&gt;hi&lt;/P&gt;
  &lt;P&gt;first register two events of alv grid class&lt;/P&gt;
  &lt;P&gt;those are MC_EVT_ENTER&lt;BR /&gt; MC_EVT_MODIFIED&lt;/P&gt;
  &lt;P&gt;using method REGISTER_EDIT_EVENT&lt;/P&gt;
  &lt;P&gt;after above you should also handle one more event i.e DATA_CHANGED_FINISHED&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 04:13:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631012#M26449</guid>
      <dc:creator>former_member241258</dc:creator>
      <dc:date>2018-02-14T04:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Editable OOPS ALV Grid - Issue with updated rows</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631013#M26450</link>
      <description>&lt;P&gt;You put me on the right path here. In addition - called the method CL_GUI_ALV_GRID -&amp;gt; CHECK_CHANGED_DATA . this method does Verification of Changes and Triggers Event DATA_CHANGED. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 13:31:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-oops-alv-grid-issue-with-updated-rows/m-p/631013#M26450</guid>
      <dc:creator>dude95</dc:creator>
      <dc:date>2018-02-14T13:31:09Z</dc:date>
    </item>
  </channel>
</rss>

