Skip to Content
author's profile photo Former Member
Former Member

Moving of flat file from the application server after upload.

Hi All,

I am uploading data from a flat file placed on the application server by a BDC program.

After the BDC has created the session i want to transfer the flat file from that folder to another folder on the application server by changing the name of the flatfile.

Can any one suggest the best way of doing this particular scenario?

Thanks in advance.

Regards

Satish Nair.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jun 09, 2005 at 11:51 AM

    First, you need to use the OPEN DATASET command to open a new file, use OPEN DATASET to open the existing file. Use READ DATASET and TRANSFER DATASET to transfer the data from one to the other. Then use DELETE DATASET to delete the old file.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Here is a sample program.

      
      report zrich_0001.
      
      
      
      
      data: d1 type localfile value '/usr/sap/TST/SYS/Data1.txt',
            d2 type localfile value '/usr/sap/TST/SYS/Data2.txt'.
      
      
      data: begin of itab occurs 0,
            rec(20) type c,
            end of itab.
      data: wa(20) type c.
      
      
      start-of-selection.
      
        open dataset d1 for input in text mode.
        if sy-subrc = 0.
          do.
            read dataset d1 into wa.
            if sy-subrc <> 0.
              exit.
            endif.
            itab-rec = wa.
            append itab.
          enddo.
        endif.
        close dataset d1.
      
        open dataset d2 for output in text mode.
        loop at itab.
          transfer itab to d2.
        endloop.
        close dataset d2.
      
      
        delete dataset d1.
      
      

      Regards,

      Rich Heilman

  • Posted on Jun 09, 2005 at 12:28 PM

    Hi,

    Check this link

    http://www.sapdevelopment.co.uk/file/file_updown.htm

    Thanks & Regards,

    Judith.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 10, 2005 at 05:00 PM

    Hi,

    You can try to use one of FM: ARCHIVFILE*

    Krzys

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.