‎2009 May 26 1:26 PM
Hi All,
how do i validate the path of a file which is in Presentation Server? please let me know the Function Modules/....
thnks,
Poonam
‎2009 May 26 1:32 PM
Hi,
Please make use of this CLASS "CL_GUI_FRONTEND_SERVICES" there you can make use of
the methods
"FILE_EXIST" for checking the file existence
"DIRECTORY_EXIST" for checking the directory existence.
Hope this will help you.
Regards,
Smart Varghese
‎2009 May 26 1:32 PM
Hi,
Please make use of this CLASS "CL_GUI_FRONTEND_SERVICES" there you can make use of
the methods
"FILE_EXIST" for checking the file existence
"DIRECTORY_EXIST" for checking the directory existence.
Hope this will help you.
Regards,
Smart Varghese
‎2009 May 26 2:05 PM
so we need to go for directory check first and then the file exitst right???
‎2009 May 26 1:33 PM
Hi,
simply try an OPEN DATASET <fn> FOR INPUT IN TETX MODE (for the application) or call function GUI_UPLOAD (for the presentation) and check the sy-subrc .
If it's 4, there is an error in filename or path.
I know that is not the best way, but is the quick one (expecially for application server files).
Best Regards
Andrea
‎2009 May 26 2:06 PM
for application im doing the open data set only. but for presentation i dont think so GUI_UPLOAD is an good option.
‎2009 May 26 2:22 PM
HI,
Use this method to check the existence of the file on the presentation server..
CL_GUI_FRONTEND_SERVICES->FILE_EXIST
CALL METHOD cl_gui_frontend_services=>file_exist
EXPORTING
file = l_file
RECEIVING
result = l_result
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.
IF l_result NE on.
CONCATENATE 'File not found:' l_program INTO msgtrc
SEPARATED BY space.
ENDIF.