Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Appending two files

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.