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 from server to local PC

Former Member
0 Kudos

Hello,

I need copy a file from server to my local pc.

how can i do it?

thanks very much

3 REPLIES 3

Former Member
0 Kudos

Hi,

You can directly download the file from server to desktop using the transaction CG3Y.

Regards,

Santhosh.

Former Member
0 Kudos

Thank you Santhosh,

but i need do it in XI machine and don't exist the transaction CG3Y

other idea?

0 Kudos

Hi, U can do this by the report.

DATA: BEGIN OF itab OCCURS 0,

text(1520) TYPE c,

END OF itab.

DATA: w_rec like line if itab.

  • File name on the server p_filenm.

OPEN DATASET p_filenm FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc = 0.

LOOP AT itab.

MOVE itab TO w_rec.

TRANSFER w_rec TO p_filenm LENGTH w_length.

ENDLOOP.

CLOSE DATASET p_filenm.

CONCATENATE 'C:' '\' p_filenm INTO fname1.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = fname1

TABLES

data_tab = itab

fieldnames = p_fieldnames

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9.

Hope this will help u

Thanks and Regards,

KC