01-04-2008 2:04 AM
Hi friends,
I would like to use GUI_UPLOAD to upload a flat file data into an internal table but I want to make sure that the flat file is not open before using GUI_UPLOAD. So how can i check whether a flat file is currently open or not??
Thanks in advance.
01-04-2008 6:02 PM
Hi Harshu,
I guess that will be taken care by the EXCEPTION FILE_OPEN_ERROR of that FM,
No need to write any separate code for that
I will checkout if there is any FM available to check if any file is open or not
01-04-2008 4:39 PM
01-04-2008 5:51 PM
close the flat file when u run the application . wether it is excel file or text whatever it is
01-04-2008 6:02 PM
Hi Harshu,
I guess that will be taken care by the EXCEPTION FILE_OPEN_ERROR of that FM,
No need to write any separate code for that
I will checkout if there is any FM available to check if any file is open or not
01-07-2008 6:59 AM
Hi,
If flat file is .txt file then GUI_Upload won't give any Exception,
IF it .XL file the GUI_Upload throw an eror it it open.
Regards,
Srinivas M
01-07-2008 5:29 PM
Hi,
If you want to use it online then you cna use the parameter CONFIRM_OVERWRITE in FM GUI_DOWNLOAD
Regards,
sasi
01-09-2008 12:01 PM
Hi,
Try to include this in your code and see if it helps.
Make necessary changes to names as applicable in your case.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'D:\.TXT'
FILETYPE = 'DAT'
TABLES
DATA_TAB = I_FILE1
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
OTHERS = 8.
IF SY-SUBRC NE 0.
CASE SY-SUBRC.
WHEN 1.
WRITE: / 'Conversion error. Data not read ....'.
WHEN 2.
WRITE: / 'file_open_error. Data not read ....'.
WHEN 3.
WRITE: / 'file_read_error. Data not read ....'.
WHEN 4.
WRITE: / 'invalid_table_width. Data not read ....'.
WHEN 5.
WRITE: / 'invalid_type. data not read ....'.
WHEN 6.
WRITE: / ' no_batch '.
WHEN 7.
WRITE: / 'unknown_error'.
WHEN OTHERS.
WRITE: / 'Error reading data. read data may not be good ...'
Reward points if useful
Regards,
Bhavin P Shah