<?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: Saving Data from ALV. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903420#M376861</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the data already exists the UPDATE the data base tabel based on the current entries in ur ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF not INSERT the record into ur table from output Grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Feb 2007 09:09:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-27T09:09:14Z</dc:date>
    <item>
      <title>Saving Data from ALV.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903416#M376857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an issue regarding saving data from alv to data base table. &lt;/P&gt;&lt;P&gt;The problem is like this. I have an internal table consist of 10 column from three diferent tables.one primary key is there.&lt;/P&gt;&lt;P&gt;now i have displayed it in alv grid. there is a column of quantity. i made some changes in quantity of some rows. now i want to save it into the database table from which that quantity field fetched. &lt;/P&gt;&lt;P&gt;i used first check_changed_data method. if the flag is set it means data is changed. &lt;/P&gt;&lt;P&gt;wat shud i do to save that quantity column into data base.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks In advance.&lt;/P&gt;&lt;P&gt;varu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 09:01:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903416#M376857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T09:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data from ALV.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903417#M376858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the GET_CHANGED_DATA method to get the cahnged data.&lt;/P&gt;&lt;P&gt;Once you have the data in the internal table, you can move it to an internal table which has the same structure as the Z table and then use UPDATE/ MODIFY/ INSERT statements to update the table.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 09:07:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903417#M376858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T09:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data from ALV.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903418#M376859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;To modify database or ztable from the ALV grid,you need to do the following:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---You have to modify the field Catalog fields (fields that you want to make editable).Set the field &amp;lt;b&amp;gt;EDIT as 'X'&amp;lt;/b&amp;gt;.For example if you want to make the field below editable:&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ls_fcat-edit = 'X'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---Call the method below before you call the set_table_for_first_display.&lt;/P&gt;&lt;P&gt;CALL METHOD ALV_GRID_INSTANCE-&amp;gt;&amp;lt;b&amp;gt;set_ready_for_input&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_ready_for_input = 0. ( For Display ) and ('1' for Edit )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this put the set_table_for_first_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Now if the ALV data has changed,and you want to change the database or ztable,then in your pf status give a function code for SAVE button in the GUI.&lt;/P&gt;&lt;P&gt;In the PAI of the screen,in user command module write the following:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'SAVE'.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;call method gr_alvgrid-&amp;gt;check_changed_data&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;importing e_valid = l_valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if l_valid = 'X'.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;MODIFY spfli FROM TABLE itab_spfli.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;(l_valid is a flag.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DATA:l_valid type c.&lt;/P&gt;&lt;P&gt;If you want to check if the user has entered any value on the grid, use the Method : CALL METHOD gr_alvgrid-&amp;gt;check_changed_data.&lt;/P&gt;&lt;P&gt;This method returns a flag l_valid which can be checked to see if the data on the ALV grid has been changed or not.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Beejal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Reward if this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 09:08:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903418#M376859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T09:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data from ALV.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903419#M376860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use update command as below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; UPDATE &amp;lt;ZTABLE&amp;gt; SET QTY = QTY&lt;/P&gt;&lt;P&gt;                            WHERE &amp;lt;CONDITION&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 09:09:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903419#M376860</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T09:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data from ALV.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903420#M376861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the data already exists the UPDATE the data base tabel based on the current entries in ur ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF not INSERT the record into ur table from output Grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 09:09:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/saving-data-from-alv/m-p/1903420#M376861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-27T09:09:14Z</dc:date>
    </item>
  </channel>
</rss>

