11-30-2007 2:27 PM
I found I can not upload an excel file if it is opening(using) at same time. My questions are:
(1)How can I still upload an excel file even it is opening at same time? Or
(2)How to check the file which is opening(using) or not and give a pop-up message?
Thanks
11-30-2007 2:29 PM
1. I think it is not possible to upload the file while it is open.
2. You can use the same FM. If your FM gives you the error message.. give the information message sayaing "Close if file is open"
If you are using the FM GUI_UPLOAD then the exception ACCESS_DENIED will be triggered when file is open.
Regards,
Naimesh Patel
11-30-2007 2:29 PM
1. I think it is not possible to upload the file while it is open.
2. You can use the same FM. If your FM gives you the error message.. give the information message sayaing "Close if file is open"
If you are using the FM GUI_UPLOAD then the exception ACCESS_DENIED will be triggered when file is open.
Regards,
Naimesh Patel
11-30-2007 2:29 PM
Hi Michael,
(1) NO you can't.
(2) Yes you can check testing sy-subrc of "OPEN DATASET" or "GUI_UPLOAD"
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = x_file
has_field_separator = '#'
filetype = l_filetype
TABLES
data_tab = file_y
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
Hope this helps,
Erwan
11-30-2007 2:30 PM
Hi
The fm should raise an exception if it can't open the file, so u can check the sy-subrc value in order to make a decision or show a message to the user.
Max