Skip to Content
avatar image
Former Member

Appending two files

Hi,

I'm trying to write an ABAP program that asks for 2 text files (A.txt and B.txt) from the user. These two files will come from the frontend (Windows C:\Temp folder). I'm planning to append the two files together into a third text file (C.txt) and save it back to the C:\Temp folder on the frontend. Can someone point me in the right direction for this?

Any help is appreciated. Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 17, 2008 at 08:51 PM

    You can run FM GUI_UPLOAD twice to upload the files. Then in the program combine them and finally use GUI_DOWNLOAD to write the file to the PC.

    Rob

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 08:50 PM

    Hi,

    Store First File Data into itab1

    Store Second file data into itab2.

    Append records of itab2 to itab1.

    Download the Contect of itab1 to presentation server.....

    Note: It is assumed that both files has got same structure

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 09:10 PM

    Thanks to both of you. What you suggested worked!

    I called GUI_UPLOAD twice, appended the contents of the itabs to a third itab and used GUI_DOWNLOAD to save it back to the frontend.

    Thanks again.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 18, 2008 at 05:11 AM

    Hello,

    For first intertable tab1 you use GUI_UPLOAD FM.

    second internal table tab2 you use same GUI_UPLOAD.

    Then create the Third structure with all the fields or TAB1 and TAB2. then move all the records to Third internal table TAB3.

    Add comment
    10|10000 characters needed characters exceeded