‎2008 May 05 10:58 AM
Hi,
Can anyone guide me for the usage of CL_GUI_FRONTEND_SERVICES=>FILE_COPY to move a file from one folder to another.
‎2008 May 05 11:25 AM
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.
‎2008 May 05 11:12 AM
Check reply in your other thread and kindly do not open duplicate threads with the same query.
‎2008 May 05 11:25 AM
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.
‎2008 May 05 11:28 AM
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
‎2008 May 05 11:31 AM
Ooops, i least expected anyone to reply after my earlier post mentioning this as a duplicate thread