<?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: copy file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546356#M248386</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;Thank you very much for your replies.&lt;/P&gt;&lt;P&gt;Points are given.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Sep 2006 16:08:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-07T16:08:21Z</dc:date>
    <item>
      <title>copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546348#M248378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I want to move or copy a file in a directory to another directory in the Application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any body tell me how can we do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 14:41:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546348#M248378</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T14:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546349#M248379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ravi,&lt;/P&gt;&lt;P&gt; Check FM '/SAPDMC/LSM_F4_FRONTEND_FILE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out this thread too&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="447011"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Santosh Kumar P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 14:44:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546349#M248379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T14:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546350#M248380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ravi,&lt;/P&gt;&lt;P&gt; Check out this too..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="431681"&gt;&lt;/A&gt;&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;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 14:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546350#M248380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T14:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546351#M248381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could create an external command in SM69 and call it with function SXPG_COMMAND_EXECUTE.  For example, you could create an external command for mv.  You would then pass the source and destination in the parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 14:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546351#M248381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T14:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546352#M248382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Read the file to be written using Read dataset statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET INFILE FOR Input .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use one more dataset statement with different file name for writing the file to other location on application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now loop through the file open in step1 and transfer it to the file opened in step2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 14:47:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546352#M248382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T14:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546353#M248383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading the file into a program and writing it out works, but it involves unneccessary processing especially for large files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OS provides commands for file processing and SAP provides the ability to execute these commands.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 14:54:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546353#M248383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T14:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546354#M248384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample that I did a while back,  All you need to do is change the directory folder if you want to move to another directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

Parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt',
            d2 type localfile default '/usr/sap/TST/SYS/Data2.txt'.

data: itab type string.
data: wa type string.


start-of-selection.

* Read file
  open dataset d1 for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset d1 into wa.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
      append wa to itab.
    enddo.
  endif.
  close dataset d1.


* Copy to new file
  open dataset d2 for output in text mode.
  loop at itab into wa.
    transfer wa to d2.
  endloop.
  close dataset d2.

* Delete the first
  delete dataset d1.

&lt;/CODE&gt;&lt;/PRE&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, 07 Sep 2006 14:55:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546354#M248384</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-09-07T14:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546355#M248385</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;Open a dataset and write the file into it and close it. Then you can read this file by opening reading the dataset in read mode and closing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 15:03:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546355#M248385</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T15:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: copy file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546356#M248386</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;Thank you very much for your replies.&lt;/P&gt;&lt;P&gt;Points are given.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2006 16:08:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/copy-file/m-p/1546356#M248386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-07T16:08:21Z</dc:date>
    </item>
  </channel>
</rss>

