<?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 Moving read only flatfile to folder. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872958#M50203</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;I have a problem i hope someone can help me with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am reading a flatfile from a server-library. After the file has been read and the information have been processed, it has to be moved to a backup folder. This is the code im using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONCATENATE p_dirnam '' file_list-name INTO l_fil1.
    CONCATENATE p_dirnam '' c_arkivdir
                               file_list-name INTO l_fil2.
    OPEN DATASET l_fil1 FOR INPUT IN TEXT MODE.
    IF sy-subrc = 0. "should always be OK
      OPEN DATASET l_fil2 FOR OUTPUT IN TEXT MODE.
      IF sy-subrc = 0.
        DO.
          READ DATASET l_fil1 INTO l_rec.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          TRANSFER l_rec TO l_fil2.
        ENDDO.
        CLOSE DATASET l_fil2.
        CLOSE DATASET l_fil1.
* Slet input-fil
        DELETE DATASET l_fil1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the problem is that the file is and has to be read only, and this apparently interferes with the copying. What can i do, is there another way of copying a flatfile i can use??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Liselotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 May 2005 08:02:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-05-24T08:02:33Z</dc:date>
    <item>
      <title>Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872958#M50203</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;I have a problem i hope someone can help me with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am reading a flatfile from a server-library. After the file has been read and the information have been processed, it has to be moved to a backup folder. This is the code im using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CONCATENATE p_dirnam '' file_list-name INTO l_fil1.
    CONCATENATE p_dirnam '' c_arkivdir
                               file_list-name INTO l_fil2.
    OPEN DATASET l_fil1 FOR INPUT IN TEXT MODE.
    IF sy-subrc = 0. "should always be OK
      OPEN DATASET l_fil2 FOR OUTPUT IN TEXT MODE.
      IF sy-subrc = 0.
        DO.
          READ DATASET l_fil1 INTO l_rec.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          TRANSFER l_rec TO l_fil2.
        ENDDO.
        CLOSE DATASET l_fil2.
        CLOSE DATASET l_fil1.
* Slet input-fil
        DELETE DATASET l_fil1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the problem is that the file is and has to be read only, and this apparently interferes with the copying. What can i do, is there another way of copying a flatfile i can use??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Liselotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2005 08:02:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872958#M50203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-24T08:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872959#M50204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liselotte,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it's read-only, then deleting is prohibited. This is also end of 'MOVE', because move is build with copy and delete (from authority point of view).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either you get more rights, or you just can copy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2005 08:20:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872959#M50204</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-05-24T08:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872960#M50205</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;&lt;/P&gt;&lt;P&gt;look at this link:&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="270794"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2005 08:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872960#M50205</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-05-24T08:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872961#M50206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liselotte,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may want to try a "move" OS-command (like "mv" in Unix, or "ren" in VMS), instead of programming the write-and-delete by yourself in ABAP.&lt;/P&gt;&lt;P&gt;In order to do so, you may use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL 'SYSTEM'
  ID 'COMMAND' FIELD l_command
  ID 'TAB'     FIELD lt_outp-*sys*.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 May 2005 08:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872961#M50206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-24T08:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872962#M50207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alvaro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The approach you have suggested, can i use that even if the file is read-only? If yes can you elaborate on how to use it &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;Liselotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2005 06:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872962#M50207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-25T06:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872963#M50208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liselotte,&lt;/P&gt;&lt;P&gt;I'm using Unix as OS for my application server. Here, the command for moving/renaming files is "mv".&lt;/P&gt;&lt;P&gt;If this is your case, you should use something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: l_path_name1(150) TYPE c.
DATA: l_path_name2(150) TYPE c.
DATA: l_command(1000) TYPE c.

DATA: BEGIN OF lt_outp OCCURS 0,
        line(255) TYPE c,
      END OF lt_outp.

CLEAR: lt_outp.
REFRESH: lt_outp.

*** here you should populate the complete paths of the
*** source and the target files

CONCATENATE 'mv' l_path_name1 l_path_name2
  INTO l_command SEPARATED BY space.

CALL 'SYSTEM'
  ID 'COMMAND' FIELD l_command
  ID 'TAB'     FIELD lt_outp-*sys*.

IF NOT lt_outp[] IS INITIAL.
*** then there's been an error in the command
  LOOP AT lt_outp.
*** error processing
  ENDLOOP.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you were using (for example) Windows NT as application server, you should replace "mv" by "ren" at your command definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps. BR,&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2005 07:16:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872963#M50208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-25T07:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872964#M50209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alvaro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use the code you suggested, but nothing happens, what am i doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLEAR: lt_outp.
  REFRESH: lt_outp.

  CONCATENATE 'ren' g_file1 g_file2 INTO l_command SEPARATED BY
  space.

  CALL 'SYSTEM'
    ID 'COMMAND' FIELD l_command
    ID 'TAB'     FIELD lt_outp-*sys*.

  IF NOT lt_outp[] IS INITIAL.
    LOOP AT lt_outp.
      WRITE:/ lt_outp-line.
    ENDLOOP.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks &lt;/P&gt;&lt;P&gt;Liselotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 07:28:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872964#M50209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T07:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872965#M50210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liselotte,&lt;/P&gt;&lt;P&gt;what's the operating system of your application server? (watch it! NOT your presentation server)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 07:33:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872965#M50210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T07:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872966#M50211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alvaro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure, but i have tried using both 'mv' and 'ren'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Liselotte&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 07:40:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872966#M50211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-26T07:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Moving read only flatfile to folder.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872967#M50212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liselotte,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;don't spend your time on several coding solutions - you are facing a authority problem (which you can only solve by coding, when you use operation system bugs).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When your file is read-only, then no matter if you try operation system or sap system commands - you can't delete or move it. That's the fact. If it's required to move this file after processing, then you need more rights to access this file - it's simply that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2005 07:55:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/moving-read-only-flatfile-to-folder/m-p/872967#M50212</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2005-05-26T07:55:35Z</dc:date>
    </item>
  </channel>
</rss>

