<?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: Data Deletion From Database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631453#M874707</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kavitha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no function module for this&lt;/P&gt;&lt;P&gt;because it FM cannot determine about the varipous table in R3.&lt;/P&gt;&lt;P&gt;So use Delete command for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Apr 2008 10:00:31 GMT</pubDate>
    <dc:creator>manubhutani</dc:creator>
    <dc:date>2008-04-03T10:00:31Z</dc:date>
    <item>
      <title>Data Deletion From Database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631451#M874705</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 need to create a program to delete old data's from database tables through a program. the criteria is the input for the program is to be any  table name and date . is this requirementt possible. is there any function module catering to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;kavitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 01:55:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631451#M874705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T01:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Data Deletion From Database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631452#M874706</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;This can be done using Dynamic open SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following Code Excerpts in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tabname type tabname,&lt;/P&gt;&lt;P&gt;          dref type ref to data,&lt;/P&gt;&lt;P&gt;          &amp;lt;wa&amp;gt; type any.&lt;/P&gt;&lt;P&gt;Field-symbols: &amp;lt;itab&amp;gt; type any table.&lt;/P&gt;&lt;P&gt;**This creates your generic dynamic internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE data dref type (tabname).&lt;/P&gt;&lt;P&gt;assign dref-&amp;gt;* to &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt; **Now you can use any of the DML statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE | UPDATE | INSERT | MODIFY&lt;/P&gt;&lt;P&gt;(dbtab) FROM wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, records to be deleted or updated&lt;/P&gt;&lt;P&gt;can be selected by a WHERE clause with a static&lt;/P&gt;&lt;P&gt;logical condition, as in:&lt;/P&gt;&lt;P&gt;DELETE | UPDATE (dbtab) WHERE&lt;/P&gt;&lt;P&gt;logical_condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**This logical condition can satisfy your requiremnt for date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when u write your program just keep in mind two things,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Be aware of the following pitfall when&lt;/P&gt;&lt;P&gt;specifying a dynamic WHERE clause with&lt;/P&gt;&lt;P&gt;an UPDATE or DELETE statement: if the&lt;/P&gt;&lt;P&gt;WHERE clause is empty, it will be interpreted&lt;/P&gt;&lt;P&gt;as the Boolean value TRUE with the result&lt;/P&gt;&lt;P&gt;that all records on the database get updated&lt;/P&gt;&lt;P&gt;or deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In ABAP Release 4.6 and earlier, a dynamic table&lt;/P&gt;&lt;P&gt;name has to be specified in uppercase. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Handle the exceptions properly .&lt;/P&gt;&lt;P&gt;This DELETE statment should work fine if you are the only person accessing the table. But if their are more then 1 users accessing the table, then table locking concept needs to be implemented so that discrepancies can be avoided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check this.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Khushboo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 09:02:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631452#M874706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T09:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data Deletion From Database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631453#M874707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kavitha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no function module for this&lt;/P&gt;&lt;P&gt;because it FM cannot determine about the varipous table in R3.&lt;/P&gt;&lt;P&gt;So use Delete command for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 10:00:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-deletion-from-database-table/m-p/3631453#M874707</guid>
      <dc:creator>manubhutani</dc:creator>
      <dc:date>2008-04-03T10:00:31Z</dc:date>
    </item>
  </channel>
</rss>

