<?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 file in Appln server in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144092#M115601</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;delete dataset filename&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Feb 2006 08:03:44 GMT</pubDate>
    <dc:creator>hymavathi_oruganti</dc:creator>
    <dc:date>2006-02-02T08:03:44Z</dc:date>
    <item>
      <title>delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144091#M115600</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;Iam using following FM to retrive files in Aplln server.&lt;/P&gt;&lt;P&gt;OCS_GET_FILE_INFO.&lt;/P&gt;&lt;P&gt;Now my requirement if the length of file is 0 then i should delete the file.And Iam also submitting these files to another program for batchinput.&lt;/P&gt;&lt;P&gt;Kndly help me.&lt;/P&gt;&lt;P&gt;My code :&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'OCS_GET_FILE_INFO'
       EXPORTING
            dir_name                  = p_path
            file_name                 = gv_filter
       TABLES
            dir_list                  = gt_files
       EXCEPTIONS
            no_authority              = 1
            activity_unknown          = 2
            not_a_directory           = 3
            no_media_in_drive         = 4
            too_many_errors           = 5
            too_many_files            = 6
            bracket_error_in_filename = 7
            no_such_parameter         = 8
            OTHERS                    = 9.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    SORT gt_files BY name.
    REFRESH gr_name.
    CLEAR   gr_name.
    gr_name-sign   = 'I'.
    gr_name-option = 'CP'.
    gr_name-low    = p_file.
    APPEND  gr_name.
      
    LOOP AT gt_files WHERE type &amp;lt;&amp;gt; 'directory file'
                       AND name in  gr_name.                      
      IF p_withp = 'X'.
        CONCATENATE p_path gt_files-name INTO gv_file.
      ELSE.
        gv_file = gt_files-name.
      ENDIF.
      REFRESH gt_params.
      CLEAR   gt_params.
      gt_params-selname = p_sfile.
      gt_params-kind    = 'P'.
      gt_params-low     = gv_file.
      APPEND gt_params.
      IF NOT p_spath IS INITIAL.
        CLEAR   gt_params.
        gt_params-selname = p_spath.
        gt_params-kind    = 'P'.
        gt_params-low     = p_path.
        APPEND gt_params.
      ENDIF.
      IF p_repid = 'Y_WM_EINLAGERN_PRODUKTION'.
        SUBMIT (p_repid) USING SELECTION-SET p_varid
                          WITH p_filn = p_path
                          WITH p_fil1 = gv_file
                    AND RETURN.
      ELSE.
        SUBMIT (p_repid) USING SELECTION-SET p_varid
                          WITH SELECTION-TABLE gt_params
                    AND RETURN.
      ENDIF.
    ENDLOOP.
In gt_files i have all the files.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2006 08:01:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144091#M115600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-02T08:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144092#M115601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;delete dataset filename&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2006 08:03:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144092#M115601</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-02-02T08:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144093#M115602</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 treid with that but its not workong&lt;/P&gt;&lt;P&gt;loop at gt_files where len eq 0.&lt;/P&gt;&lt;P&gt;    delete dataset gt_files-name.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;and iam getting return code 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sai Chand Pullepu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2006 08:04:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144093#M115602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-02T08:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144094#M115603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for delete dataset to work, the important point is the file should be of character type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;convert the file to character type and try deleting&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2006 08:18:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144094#M115603</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-02-02T08:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144095#M115604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;gt_files-name is character type only.&lt;/P&gt;&lt;P&gt;But the gt_files contain the following structure&lt;/P&gt;&lt;P&gt;NAME&lt;/P&gt;&lt;P&gt;TYPE&lt;/P&gt;&lt;P&gt;LEN&lt;/P&gt;&lt;P&gt;OWNER&lt;/P&gt;&lt;P&gt;MTIME&lt;/P&gt;&lt;P&gt;ACC_MODE&lt;/P&gt;&lt;P&gt;MOD_DATE&lt;/P&gt;&lt;P&gt;MOD_TIME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2006 08:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144095#M115604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-02T08:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144096#M115605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;convert all the fields to character type and try&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2006 08:30:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144096#M115605</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-02-02T08:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: delete file in Appln server</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144097#M115606</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;Thanks for spending ur time.&lt;/P&gt;&lt;P&gt;anyway i solved with the following code.&lt;/P&gt;&lt;P&gt;Thanks anyway.&lt;/P&gt;&lt;P&gt; LOOP AT gt_files WHERE type &amp;lt;&amp;gt; 'directory file'&lt;/P&gt;&lt;P&gt;                     AND   len EQ 0.&lt;/P&gt;&lt;P&gt;      CONCATENATE p_path gt_files-name INTO test.&lt;/P&gt;&lt;P&gt;      CONDENSE test NO-GAPS.&lt;/P&gt;&lt;P&gt;      OPEN DATASET test.&lt;/P&gt;&lt;P&gt;      IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;        DELETE DATASET test.&lt;/P&gt;&lt;P&gt;        IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;          MESSAGE i000(0) WITH 'file deleted'.&lt;/P&gt;&lt;P&gt;        ENDIF.&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, 02 Feb 2006 08:34:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-file-in-appln-server/m-p/1144097#M115606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-02T08:34:25Z</dc:date>
    </item>
  </channel>
</rss>

