<?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: Delete table entry in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815561#M658394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For deleting entries from a database table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can first select all the entries which satisfy ur condition ( in ur case where plant is 'ROM') from table TAB(dbtable) into itab(internal table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can say something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE itab FROM TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Sep 2007 15:25:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-30T15:25:29Z</dc:date>
    <item>
      <title>Delete table entry</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815560#M658393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a situation. Some of the functional guys created a plant and later deleted it, but didnt delete it across the landscape. So there are records which still has that plant in a couple of tables say MCON and MARC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my functional guy wants me to write a program by which I can delete the record in those tables when plant is 'ROM'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me in this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2007 14:23:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815560#M658393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-30T14:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Delete table entry</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815561#M658394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For deleting entries from a database table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can first select all the entries which satisfy ur condition ( in ur case where plant is 'ROM') from table TAB(dbtable) into itab(internal table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can say something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE itab FROM TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2007 15:25:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815561#M658394</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-30T15:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete table entry</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815562#M658395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
tables: dd03l. "Just for select-options
* tables to check, try M*
select-options:
  s_tabname  for dd03l-tabname.

data:
  lv_tabname type dd03l-tabname,
* table for unique table names
  lt_tabname type sorted table of dd03l-tabname
    with unique key table_line.

start-of-selection.
select tabname 
  into lv_tabname 
  from dd03l
  where tabname in s_tabname
* Most plant fields are called WERKS
  and fieldname = 'WERKS'.
* or try
* and rollname = 'WERKS_D' - find some more for the data element
* sorted table will take an entry only once without muttering
  insert lv_tabname into table lt_tabname.
endselect.
loop at  lt_tabname into lv_tabname.
  delete from (lv_tabname) where WERKS = 'ROM'.
* for test purposes use SELECT COUNT( * )...
if sy-subrc = 0.
  write: / sy-dbcnt, 'records deleted from table', lv_tabname.
endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let it run overnight and see what happens &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2007 16:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-table-entry/m-p/2815562#M658395</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-09-30T16:37:06Z</dc:date>
    </item>
  </channel>
</rss>

