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: 

Copy file (bin or asc) from presentation server to application server.

Former Member
0 Kudos

Hello experts,

I'm new to ABAP and I'm looking to create a program that can copy files from the presentation server to teh application server, the files could be binary or text.

I've seen transaction CG3Y and CG3Z, but those are only availiable in our ec system and I need to create this program in crm.

Thanks for any pointers.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Can you try following steps

To upload a file from presentation server to application

server we have to do the following :

1. upload the file from presentation server in to an

internal table using gui_upload.

2.open dataset

3.loop the internal table

4.use transfer statement to write into application server

Niwaas.

4 REPLIES 4

Former Member
0 Kudos

Can you try following steps

To upload a file from presentation server to application

server we have to do the following :

1. upload the file from presentation server in to an

internal table using gui_upload.

2.open dataset

3.loop the internal table

4.use transfer statement to write into application server

Niwaas.

babu_kilari4
Active Contributor
0 Kudos

Hi Cody,

You can do one thing. Go to SE38 Editor. Type the keyword DATASET and press F1. You will get explanation along with the implementing example.

You can simply copy that and explore further.

In addition to this, there are lot many Wikis written on the same topic. Check the same.

Thanks,

Babu Kilari

kanishakgupta1
Contributor
0 Kudos

Hi Cody,

Use the FM gui_upload to upload the text file to an internal table.

then with the statements open dataset , transfer the internal table data to the file in application server.

regards

kanishak

Former Member
0 Kudos

Hi Cody ,

First by using GUI_UPLOAD or UPLOAD function module , upload the data from

presentation server to internal table .

Then open a file in the Applocation server by by OPEN DATASET .......

If the file does not exissts in the Application server then this statement creates

file there.

After that Loop through the internal table and by TRANSFER statement file up

the file of Application server .

Check this code -


DATA : w_file(8) TYPE c VALUE 'FILE',
           fs_itab(255) TYPE c,
           t_itab LIKE TABLE OF fs_itab.
CALL FUNCTION 'GUI_UPLOAD'   " To upload the presentation server file to internal table
exporting 
.
filename = 'C:\FILE_PATH.TXT'   " Specify the file path
.
tables 
.
data_tab = t_itab.    " Specify the internal table name
.
.
OPEN DATASET w_file1 FOR INPUT IN BINARY MODE. "Open file in application layer
LOOP AT t_itab INTO fs_itab.      " Looping to internal table
  TRANSFER fs_itab TO  w_file1.  " Transfering  to Application server's file
ENDLOOP.

Regards

Pinaki