2006 Dec 01 4:47 AM
Hi all,
I have a requirement that i want to save a file the file name will the same as the file which i am trying to download. But i want to save the file where ever I want to.. So i want to capture the Directory path which the client want to store. Means i want to get the path of the Directory. How can i do that.
Thanx in advance
Murthy
Message was edited by:
Ramana Murthy
2006 Dec 01 5:00 AM
HI Ramana
Are you referring to Presentation Server.
In that case, below code can help you to extract the directory name:
Check this code:
DATA: DIR TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
EXPORTING
WINDOW_TITLE = 'Select Folder'
INITIAL_FOLDER = 'C:'
CHANGING
SELECTED_FOLDER = DIR
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4.Now that you have the directory, you can add the filename and save to the location.
Kind Regards
Eswar
Hi all,
I have a requirement that i want to save a file the file name will the same as the file which i am trying to download. But i want to save the file where ever I want to.. So i want to capture the Directory path which the client want to store. Means i want to get the path of the Directory. How can i do that.
Thanx in advance
Murthy
Message was edited by:
Ramana Murthy
2006 Dec 01 4:50 AM
Hi Murthy,
Please check the following transaction codes.
CG3Z - Upload a file to a application server from presentation server.
CG3Y - Download a file from application server to presentation server.
Regards,
Ferry Lianto
2006 Dec 01 4:59 AM
Hi Ferry,
I did all this things. Those TCodes are correct i am using them only but i am using custom Tcodes. When i trying to select the path In the output i am not able to display in the field. Is there any other way
Murthy
2006 Dec 01 5:00 AM
HI Ramana
Are you referring to Presentation Server.
In that case, below code can help you to extract the directory name:
Check this code:
DATA: DIR TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
EXPORTING
WINDOW_TITLE = 'Select Folder'
INITIAL_FOLDER = 'C:'
CHANGING
SELECTED_FOLDER = DIR
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4.Now that you have the directory, you can add the filename and save to the location.
Kind Regards
Eswar
2006 Dec 01 5:14 AM
Hi Muthy,
Please use the following the methods of CL_GUI_FRONTEND_SERVICES.
DIRECTORY_BROWSE
DIRECTORY_CREATE
DIRECTORY_DELETE
DIRECTORY_EXIST
DIRECTORY_GET_CURRENT
DIRECTORY_LIST_FILES
DIRECTORY_SET_CURRENT
GET_WINDOWS_DIRECTORY
GET_TEMP_DIRECTORY
Regards,
Ferry Lianto