<?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: save the data in the grid using oops in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537002#M1427356</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 a solution for your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call funciton Register_edit_event before calling function Refresh_table_display.Sample code is given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--event to detect if data gets edited&lt;/P&gt;&lt;P&gt;  CALL METHOD OBJ_ALV-&amp;gt;REGISTER_EDIT_EVENT&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_EVENT_ID = CL_GUI_ALV_GRID=&amp;gt;MC_EVT_MODIFIED&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      ERROR      = 1&lt;/P&gt;&lt;P&gt;      OTHERS     = 2.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also capture ENTER button user command i.e. 'OK'.Sample code is given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--when alv is edited and ENTER button is clicked then data ill be saved in internal table and edited data will be displayed on alv&lt;/P&gt;&lt;P&gt;  IF OK_CODE = 'OK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--metohd to detect if data was changed in oops alv&lt;/P&gt;&lt;P&gt;    CALL METHOD OBJ_ALV-&amp;gt;CHECK_CHANGED_DATA&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       E_VALID   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CHANGING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       C_REFRESH = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever you will edit fields of alv and press ENTER key then edited data will be displayed in alv and it will be modified in internal table too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will resolve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Khushboo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Dec 2009 06:57:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-23T06:57:48Z</dc:date>
    <item>
      <title>save the data in the grid using oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537000#M1427354</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 am displaying a alv grid list in the output screen where some fields are editable using g_grid-&amp;gt;set_table_for_first_display(oops).&lt;/P&gt;&lt;P&gt;I have even kept a push button in the application tool bar to save the changed fields.&lt;/P&gt;&lt;P&gt;All I have to do is take the data of changed &amp;amp; unchanged fields from the GRID and update some custom tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I am facing is I am not able to capture the changed data in the output internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help me!&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 06:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537000#M1427354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-23T06:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: save the data in the grid using oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537001#M1427355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;write to update ur custom table in the HANDLE USER COMMAND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;METHOD handle_user_command.&lt;/P&gt;&lt;P&gt;    CASE e_ucomm.&lt;/P&gt;&lt;P&gt;      WHEN save.&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;update table wth the values entered&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;           ENDCASE.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 06:47:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537001#M1427355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-23T06:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: save the data in the grid using oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537002#M1427356</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 a solution for your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call funciton Register_edit_event before calling function Refresh_table_display.Sample code is given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--event to detect if data gets edited&lt;/P&gt;&lt;P&gt;  CALL METHOD OBJ_ALV-&amp;gt;REGISTER_EDIT_EVENT&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      I_EVENT_ID = CL_GUI_ALV_GRID=&amp;gt;MC_EVT_MODIFIED&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      ERROR      = 1&lt;/P&gt;&lt;P&gt;      OTHERS     = 2.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also capture ENTER button user command i.e. 'OK'.Sample code is given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--when alv is edited and ENTER button is clicked then data ill be saved in internal table and edited data will be displayed on alv&lt;/P&gt;&lt;P&gt;  IF OK_CODE = 'OK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--metohd to detect if data was changed in oops alv&lt;/P&gt;&lt;P&gt;    CALL METHOD OBJ_ALV-&amp;gt;CHECK_CHANGED_DATA&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       E_VALID   =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CHANGING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       C_REFRESH = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever you will edit fields of alv and press ENTER key then edited data will be displayed in alv and it will be modified in internal table too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will resolve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Khushboo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 06:57:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537002#M1427356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-23T06:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: save the data in the grid using oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537003#M1427357</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;Can u pls send me the entire sample code pls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 07:24:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537003#M1427357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-23T07:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: save the data in the grid using oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537004#M1427358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This is a part of a code which just shows to display and use a method to modify internal table after edited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD MY_ALV2-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY
  EXPORTING
    IS_LAYOUT                     = WA_LAY
      CHANGING
        IT_OUTTAB                     = IT_DISP2
        IT_FIELDCATALOG               = IT_FIELDCAT2
        IT_SORT                       = IT_SORT
  EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR                 = 2
    TOO_MANY_LINES                = 3
    OTHERS                        = 4
            .
    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    CALL METHOD MY_ALV2-&amp;gt;REGISTER_EDIT_EVENT
      EXPORTING
        I_EVENT_ID = CL_GUI_ALV_GRID=&amp;gt;MC_EVT_MODIFIED
      EXCEPTIONS
        ERROR      = 1
        OTHERS     = 2.
    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in field catalogue, you have to use ref_field and ref_table fields&lt;/P&gt;&lt;P&gt;for ex.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT2-REF_FIELD = 'NETPR'.&lt;/P&gt;&lt;P&gt;  WA_FIELDCAT2-REF_TABLE = 'EKPO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2009 07:39:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/save-the-data-in-the-grid-using-oops/m-p/6537004#M1427358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-23T07:39:25Z</dc:date>
    </item>
  </channel>
</rss>

