<?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: Not able to update database? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080162#M1356758</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;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;gt; MOVE-CORRESPONDING ZSTRUC_CM TO I_TAB.                                                                            not working&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; UPDATE ZTEST_CM FROM ZSTRUC_CM.                                                                                not working&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of the move statement you need to use the append work area to internal table statement. you need to have the same structure for the work area and the internal tbale.&lt;/P&gt;&lt;P&gt;Then use the modify data base table from internal table statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ansari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Sep 2009 08:15:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-09T08:15:29Z</dc:date>
    <item>
      <title>Not able to update database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080160#M1356756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gururs,&lt;/P&gt;&lt;P&gt;  i have created a structure which contains data from mara and makt tables. now i want to data of this structure to my own created database table starting with 'z'. program is done in module screen, where user enters data. so when user hits save button, it select data from mara and makt and save it in 'z' database. now data is coming in strcure not passing it to database.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  for that i have used following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : i_tab type ztest_cm(standard table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'SAVE'.                                                                                status in program&lt;/P&gt;&lt;P&gt;  PERFORM UPDATE_DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM MAKT INTO CORRESPONDING FIELDS OF ZSTRUC_CM(structure)                    working&lt;/P&gt;&lt;P&gt;WHERE MATNR = ZSTRUC_CM-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE MEINS FROM MARA INTO CORRESPONDING FIELDS OF ZSTRUC_CM                            working&lt;/P&gt;&lt;P&gt;WHERE MATNR = ZSTRUC_CM-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING ZSTRUC_CM TO I_TAB.                                                                            not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE ZTEST_CM FROM ZSTRUC_CM.                                                                                not working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 08:10:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080160#M1356756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-09T08:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080161#M1356757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;update statement work if the entries already exist in z table, otherwise it wont work, use Insert ot Modify statement..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 08:14:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080161#M1356757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-09T08:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080162#M1356758</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;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;gt; MOVE-CORRESPONDING ZSTRUC_CM TO I_TAB.                                                                            not working&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; UPDATE ZTEST_CM FROM ZSTRUC_CM.                                                                                not working&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of the move statement you need to use the append work area to internal table statement. you need to have the same structure for the work area and the internal tbale.&lt;/P&gt;&lt;P&gt;Then use the modify data base table from internal table statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ansari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 08:15:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080162#M1356758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-09T08:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080163#M1356759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODIFY  ZTEST_CM  FROM TABLE ZSTRUC_CM.&lt;/P&gt;&lt;P&gt;  COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always use modify as it take cares to check which records already exists in table based on primary fields and updates only the ones not present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always while updating in Z tables or any transaparent tables, you have to use COMMIT WORK as it commits your data to the data base level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please search the forum before asking these questions;you will get your solution .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 08:40:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080163#M1356759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-09T08:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to update database?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080164#M1356760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New entry into database table should be through INSERT statement.&lt;/P&gt;&lt;P&gt;If you want to modify the record which is already present in a atbale, then use MODIFY or UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And try checking Sy-subrc after each database statements so that you will know the type of error based on the value returned by sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sripal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Sep 2009 09:52:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-update-database/m-p/6080164#M1356760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-09T09:52:44Z</dc:date>
    </item>
  </channel>
</rss>

