<?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 record from Datapackage in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261256#M147710</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ABAP there is not single statement to do that.  You can do that if you were deleting all records that are in the internal table, but not the other way around.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to get all the records of the database that you want to delete into an internal table, then you can do the statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE ZTABLE FROM TABLE itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement deletes all of the records from the database table ZTABLE where the record matches in the ITAB internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Mar 2006 21:36:41 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-03-09T21:36:41Z</dc:date>
    <item>
      <title>delete record from Datapackage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261254#M147708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello all experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One simple question.&lt;/P&gt;&lt;P&gt;I have an internal table and one ODS/InfoCube datapackage.&lt;/P&gt;&lt;P&gt;which statement should I use to let datapackage only keep the records in that internal table, delete all others?&lt;/P&gt;&lt;P&gt;Appreciate it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2006 21:29:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261254#M147708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-09T21:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: delete record from Datapackage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261255#M147709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pls find attached code of fm to delete data from ODS in BW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RSDRI_ODSO_DELETE_RFC'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    I_ODSOBJECT                   = 'ZTXHDCNT'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    I_T_RANGE                     = i_range&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    DATA_TARGET_NOT_ODS           = 1&lt;/P&gt;&lt;P&gt;    ODS_TYPE_NOT_TRANSACTIONAL    = 2&lt;/P&gt;&lt;P&gt;    CONFLICTING_DELETION_CRITERIA = 3&lt;/P&gt;&lt;P&gt;    DELETE_FAILED                 = 4&lt;/P&gt;&lt;P&gt;    INTERNAL_ERROR                = 5&lt;/P&gt;&lt;P&gt;    OTHERS                        = 6.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;  write: / 'success'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can populate range of desired data to be deleted and it will delete data from ODS which satisfies the criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you case you need to compare data with internal table. So i suggest you following solution -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at datapackage.&lt;/P&gt;&lt;P&gt;  read Internal table and check if record exist.&lt;/P&gt;&lt;P&gt;  if does not exist, delete record from datapackage.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2006 21:34:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261255#M147709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-09T21:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: delete record from Datapackage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261256#M147710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ABAP there is not single statement to do that.  You can do that if you were deleting all records that are in the internal table, but not the other way around.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to get all the records of the database that you want to delete into an internal table, then you can do the statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE ZTABLE FROM TABLE itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This statement deletes all of the records from the database table ZTABLE where the record matches in the ITAB internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2006 21:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261256#M147710</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-03-09T21:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: delete record from Datapackage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261257#M147711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linda,&lt;/P&gt;&lt;P&gt;Loop at datapackage.&lt;/P&gt;&lt;P&gt;read Internal table and check if record exist.&lt;/P&gt;&lt;P&gt;if does not exist, delete record from datapackage.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT &amp;lt;DATAPAC NAME&amp;gt;.&lt;/P&gt;&lt;P&gt;  READ TABLE ITAB &amp;lt;WHERE CONDITION&amp;gt;.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;   CONTINUE.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;   DELETE ITAB.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2006 21:40:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261257#M147711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-09T21:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: delete record from Datapackage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261258#M147712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points awarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linda&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2006 21:52:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-record-from-datapackage/m-p/1261258#M147712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-09T21:52:33Z</dc:date>
    </item>
  </channel>
</rss>

