Application Development and Automation 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: 
Read only

File transfer

Former Member
0 Likes
760

Hi,

Can anyone guide me for the usage of CL_GUI_FRONTEND_SERVICES=>FILE_COPY to move a file from one folder to another.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
640

hi check this...

report zrich_0002 .

parameters: source type localfile,

destin type localfile.

at selection-screen on value-request for source.

call function 'KD_GET_FILENAME_ON_F4'

exporting

static = 'X'

changing

file_name = source.

at selection-screen on value-request for destin.

call function 'KD_GET_FILENAME_ON_F4'

exporting

static = 'X'

changing

file_name = destin.

start-of-selection.

data: xsource type string.

data: xdestin type string.

xsource = source.

xdestin = destin.

call method cl_gui_frontend_services=>file_copy

exporting

source = xsource

destination = xdestin

OVERWRITE = SPACE

exceptions

cntl_error = 1

error_no_gui = 2

wrong_parameter = 3

disk_full = 4

access_denied = 5

file_not_found = 6

destination_exists = 7

unknown_error = 8

path_not_found = 9

disk_write_protect = 10

drive_not_ready = 11

others = 12.

[/code]

regards,

venkat.

4 REPLIES 4
Read only

Former Member
0 Likes
640

Check reply in your other thread and kindly do not open duplicate threads with the same query.

Read only

Former Member
0 Likes
641

hi check this...

report zrich_0002 .

parameters: source type localfile,

destin type localfile.

at selection-screen on value-request for source.

call function 'KD_GET_FILENAME_ON_F4'

exporting

static = 'X'

changing

file_name = source.

at selection-screen on value-request for destin.

call function 'KD_GET_FILENAME_ON_F4'

exporting

static = 'X'

changing

file_name = destin.

start-of-selection.

data: xsource type string.

data: xdestin type string.

xsource = source.

xdestin = destin.

call method cl_gui_frontend_services=>file_copy

exporting

source = xsource

destination = xdestin

OVERWRITE = SPACE

exceptions

cntl_error = 1

error_no_gui = 2

wrong_parameter = 3

disk_full = 4

access_denied = 5

file_not_found = 6

destination_exists = 7

unknown_error = 8

path_not_found = 9

disk_write_protect = 10

drive_not_ready = 11

others = 12.

[/code]

regards,

venkat.

Read only

Former Member
0 Likes
640

hi,

Check out the below code


data: lv_str1 type string.
data: lv_str2 type string.
 
 
parameters: p_file type localfile default 'C:\temp\bd.doc'.
 
data: g_new type localfile value 'c:\temp\bd2222.doc'.
 
start-of-selection.
 
move p_file to lv_str1.
move g_new to lv_str2.
 
call method cl_gui_frontend_services=>file_copy
  exporting
    source               = lv_str1
    destination          = lv_str2.
        .
if sy-subrc  0.
endif. 

Regards,

Santosh

Read only

Former Member
0 Likes
640

Ooops, i least expected anyone to reply after my earlier post mentioning this as a duplicate thread