2006 Jun 19 7:19 PM
Hi,
In METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE =
RECEIVING
RESULT = . <-- May I know what is this result stand for and what kind of parameter should I pass in? Thanks!
Anyi
2006 Jun 19 7:25 PM
Result is of type ABAP_BOOL which is TYPE C length 1. It takes two values, space and 'X'.
Hi,
In METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE =
RECEIVING
RESULT = . <-- May I know what is this result stand for and what kind of parameter should I pass in? Thanks!
Anyi
2006 Jun 19 7:21 PM
HI ANYI,
RESULT:IS THE RETURN CODE FOR THE BUTTON U HAVE CLICKED
FOR EX: '1' MIGHT BE THE RETURN CODE FOR 'YES'.
DECLARE RESULT AS
DATA: V_RES TYPE i.
METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE =
RECEIVING
RESULT = V_RES.
Message was edited by: Priya
2006 Jun 19 7:24 PM
So in this case, the file in exporting is the name of the file to be checked, is that correct?
Thanks,
Anyi
2006 Jun 19 7:25 PM
hi Zhu,
Check this out
data: file_name type string.
data: <b>result type abap_bool.</b>
data: rc type i.
file_name = txt_work_file.
call method cl_gui_frontend_services=>file_exist
exporting
file = file_name
receiving
result = result
exceptions
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
others = 4.
2006 Jun 19 7:23 PM
This is a RECEIVING parameter. You do not enter anything. SAP will fill this field for you. It is the confirmation of whether or not the file exists in the specific path provided in your FILE parameter.
2006 Jun 19 7:23 PM
This is a RECIEVING parameter, and you can use a TYPE ABAP_BOOL variable here. It will be "X" if the file exists, blank if not.
type-pools: abap.
data: result type abap_bool.
data: filename type string.
filename = 'C:test.xls'.
call method cl_gui_frontend_services=>file_exist
exporting
file = filename
receiving
result = result .
if result = 'X'.
write:/ 'Yep, file is there'.
else.
write:/ 'Nop, file isnt there'.
endif.
Regards,
Rich Heilman
2006 Jun 19 7:25 PM
Result is of type ABAP_BOOL which is TYPE C length 1. It takes two values, space and 'X'.
2006 Jun 19 7:25 PM