ā2013 Oct 07 1:26 PM
Hi,
I would like to have input file name as ABC_date.csv ....This name will be default and user just have to choose the path to store this file. I have created default file name as ABC_20130907.CSV but for this when I click on F4 then I have to first copy this name and have to put it as File Name in navigation window. Can it be possible that when we click on F4 button and this default file name would appear in that window ? ...Otherwise please suggest any possible way.
Thanks.
ā2013 Oct 07 1:41 PM
Hi,
u can pass the defalult filename in the FM file_save_dialog
CALL METHOD cl_gui_frontend_services=>file_save_dialog "File Save Dialog PopUp
EXPORTING
window_title = 'title' "WINDOW TITLE
default_extension = ''
default_file_name = 'filename' " SET THE DEFAULT FILE NAME HERE
initial_directory = 'C:\Users\Applexus\Desktop' "DEFAULT LOCATION FOR POPUP
CHANGING
filename = lv_filename
path = lv_drivepath
fullpath = lv_filepath
user_action = lv_result.
.
Hope this Helps
Sivaganesh
ā2013 Oct 07 1:55 PM
Hi ,
There is one workaround I know in which in the AT_SELECTION SCREEN ON F4 routine You can replace the entire string after the Last "\" with your default file name
.
So irrespective what user selects it would be the default file that would be selected.
Regards,
Gaurang
ā2013 Oct 07 2:04 PM
Hi,
This can be done but it's not proper solution. Can we only select path through F4 ?....Actually it is not going ahead untill we give file name.
Thanks.
ā2013 Oct 07 4:52 PM
Hi ,
if you just want the default name of file abc_date.csv then you can use class suggested by shivaganesh or if you want the file to abc_date.csv to be irrespective of the selected you can suggest the option suggested by me.
Request you to please explain us the requirement in detail
Regards and Thanks,
Gaurang
ā2013 Oct 08 8:25 AM
Hi,
I understood what you are suggesting. Can we select only path through F4 help??....So that user will select only path and i can be able to append file name ahead of that.
Thanks.
ā2013 Oct 08 9:36 AM
Hi,
I guess what you are saying is user should only be only able to select the path and by default
the user would be storing a default file name.
I am not aware of any such option will let you know once I come know about it.
But the workaround I suggested can be used as an alternative.
Regards,
Gaurang
ā2013 Oct 08 8:49 AM
hi
let the user first select the path or directory where he needs to place the file using F4 and then concatenate your filename to the path selected by the user .
sample code is mentioned in the below link.
http://scn.sap.com/thread/841804
BR
Venkat
ā2013 Oct 08 9:11 AM
Use Following Code.
PARAMETERS: P_FILE TYPE LOCALFILE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
DATA: File_Path_Str TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
EXPORTING
WINDOW_TITLE = 'Your Folder'
CHANGING
SELECTED_FOLDER = File_Path_Str
EXCEPTIONS
CNTL_ERROR = 1.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.
After this concatenate File_Path_Str to P_FILE. Also you can concatenate variables to the same as per your wish.
Regards,
Sandeep.