2010 Nov 10 12:27 PM
I am using the method "file_get_size" to identify the size of the file. Though the file contains details its returning the value as -1. It doesnt show the correct size. Could you please let me know the reason for it and how to correct it? The code is given below
data: filesize type i.
CLASS cl_gui_frontend_services DEFINITION LOAD.
call method cl_gui_frontend_services=>file_get_size
exporting
file_name = "File name"
importing
file_size = filesize
exceptions
others = 1.
call method cl_gui_cfw=>flush.
2010 Nov 10 1:11 PM
Hi ,
Just check the signature of the method FILE_GET_SIZE
FILE_SIZE TYPE I File Size, -1 if an Error Occurred.
I am using the method "file_get_size" to identify the size of the file. Though the file contains details its returning the value as -1. It doesnt show the correct size. Could you please let me know the reason for it and how to correct it? The code is given below
data: filesize type i.
CLASS cl_gui_frontend_services DEFINITION LOAD.
call method cl_gui_frontend_services=>file_get_size
exporting
file_name = "File name"
importing
file_size = filesize
exceptions
others = 1.
call method cl_gui_cfw=>flush.
2010 Nov 10 12:33 PM
Hi,
You mapped all errors to OTHERS with sysubrc = 1.
Try using the whole lot of exceptions to better identify the problem
EXCEPTIONS
file_get_size_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others
Best regards,
Guillaume
2010 Nov 10 12:50 PM
Hi,
I used the exceptions specified by you. Actually am getting the value as "-1". what does it specifies?
2010 Nov 10 12:55 PM
Your file is named "File name"? No path?
And i bet an exception was raised...
-
Please hug me!
2010 Nov 10 1:00 PM
2010 Nov 10 1:01 PM
2010 Nov 10 1:07 PM
And while you're at it: check the contents of SY-MSGNO and so on.
-
Please hug me!
2010 Nov 10 1:11 PM
Hi ,
Just check the signature of the method FILE_GET_SIZE
FILE_SIZE TYPE I File Size, -1 if an Error Occurred.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |