<?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 Dataset from flat file. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732244#M898241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try OPEN DATASET p_file FOR UPDATE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2008 09:41:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-24T09:41:52Z</dc:date>
    <item>
      <title>Delete Dataset from flat file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732243#M898240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I have requirement to delete Data from Dataset for some records , is it possible to do. ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenerio, is I have text file on application server , according to that file , records are getting uploaded in my Ztables. some times due to some errors records are not getting updated in Ztable. since I am clearing the file before close dataset... Text (flat) file gets deleted from Application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;requirement is , I want, if data has been updated in my ztables only those records should get deleted from my Text file of application server,remaining which are having errors or not updated in Ztable should remain in TEXT file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should , I right code for this. any idea ?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 08:57:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732243#M898240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T08:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Dataset from flat file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732244#M898241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try OPEN DATASET p_file FOR UPDATE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 09:41:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732244#M898241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T09:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Dataset from flat file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732245#M898242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi purnima,&lt;/P&gt;&lt;P&gt;compare the records with the primary key..if they match delete that record...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 10:20:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732245#M898242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T10:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Dataset from flat file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732246#M898243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, sudheer &lt;/P&gt;&lt;P&gt;Thanks for reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I wanted code (syntax) to delete the records from Flat file.&lt;/P&gt;&lt;P&gt;e.g. &lt;/P&gt;&lt;P&gt;I have written code in the beginning &lt;/P&gt;&lt;P&gt;ie. &lt;/P&gt;&lt;P&gt;OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    READ DATASET v_file INTO wa_file.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      APPEND wa_file TO ifile.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of my processing : given like this . Which is clearing the Flat file and closing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODIFY Ztable  FROM TABLE  internal tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      CLEAR wa_file.&lt;/P&gt;&lt;P&gt;      CLOSE DATASET v_file.&lt;/P&gt;&lt;P&gt;      OPEN DATASET v_file FOR OUTPUT IN TEXT MODE    ENCODING DEFAULT.&lt;/P&gt;&lt;P&gt;      TRANSFER wa_file TO v_file.&lt;/P&gt;&lt;P&gt;      CLOSE DATASET v_file.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;Now , I don't want to Deleting the whole file.. but if records are not gone properly..should Keep those records in flat  file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what wud be the code for that. ?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 04:34:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732246#M898243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T04:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Dataset from flat file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732247#M898244</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;There is no statement to delete records from an application file. Check the below logic to solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) Assume FILE1 contains the actual data.&lt;/P&gt;&lt;P&gt;(2) Copy the contents of FILE1 to FILE2.&lt;/P&gt;&lt;P&gt;(3) Delete FILE1 from the application server ( optional)&lt;/P&gt;&lt;P&gt;(4) Read the records from FILE2 except those you want to delete&lt;/P&gt;&lt;P&gt;(5) Write these records into FILE1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the file is already opened, SAP triggers an exception of the type CX_SY_FILE_OPEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Raj.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 04:40:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732247#M898244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T04:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Dataset from flat file.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732248#M898245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks everyone,&lt;/P&gt;&lt;P&gt;I have got solution. Not as I  wanted, but My purpose has got solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;purnima&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2008 09:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-dataset-from-flat-file/m-p/3732248#M898245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-28T09:38:15Z</dc:date>
    </item>
  </channel>
</rss>

