‎2009 Apr 13 9:51 AM
Hi Friends,
I have to give F4 help option for file path parameter. Is there any way that in F4 help I can make the file type as by default excel format so that the user can always export data to an excel sheet.
Thanks in Advance,
Meenu.
‎2009 Apr 13 10:29 AM
The FM : 'KD_GET_FILENAME_ON_F4' is not taking the filename as by default excel format.
If we specify the filename.XLS then only it is working. My requirement is to take it by deafult into excel format.
‎2009 Apr 13 9:53 AM
you can use the below class
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = lf_file
filetype = 'EXCL'
IMPORTING
filelength = lf_filelength
CHANGING
data_tab = lt_datatab
EXCEPTIONS
OTHERS = 1.
‎2009 Apr 13 9:54 AM
hi do like this..
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
I_SERVER = '?'
I_PATH =
filemask = '*.xls'
FILEOPERATION = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
o_path = filename
ABEND_FLAG =
EXCEPTIONS
rfc_error = 1
error_with_gui = 2
OTHERS = 3.
‎2009 Apr 13 9:55 AM
‎2009 Apr 13 9:56 AM
Hi,
Check this method CL_GUI_FRONTEND_SERVICES->FILE_OPEN_DIALOG
CL_GUI_FRONTEND_SERVICES->FILE_SAVE_DIALOG
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = 'Select archivo'
default_extension = 'xls'
file_filter = '*.xls'
CHANGING
filename = filename
path = path
fullpath = fullpath.
IF sy-subrc EQ 0.
p_file = fullpath.
ENDIF.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
initial_directory = directory
file_filter = '*.xml' " EC-NOTEXT
multiselection = ' '
CHANGING
file_table = filetable
rc = rc.
IF rc = 1.
READ TABLE filetable INDEX 1 INTO line.
filename = line-filename.
ENDIF.
‎2009 Apr 13 9:59 AM
Hi,
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SY-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = file_name
CHANGING
FILE_NAME = FILE_NAME
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope it helps!!
Regards,
Pavan
‎2009 Apr 13 10:00 AM
Hi,
Use FM CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = <Field-Name>
STATIC = 'X'
MASK = '*.XLS, *.xls'
CHANGING
FILE_NAME = P_INPUT
EXCEPTIONS
MASK_TOO_LONG = 1
* OTHERS = 2
‎2009 Apr 13 10:13 AM
I have used the FM :WS_FILENAME_GET for F4 help and GUI_DOWNLOAD to export data. I ahve to give user the option to specify file name and path. So while specifying the file name itself i want to make the file type option as excel format.
‎2009 Apr 13 10:14 AM
hi
hope it will help u
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PFNAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
STATIC = 'X'
CHANGING
FILE_NAME = PFNAME.
~linganna
‎2009 Apr 13 10:28 AM
Hi Meenu,
Try this
create parameter as below
PARAMETERS:fname LIKE rlgrap-filename DEFAULT ''.
then call the following function in your program
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
FIELD_NAME = FNAME
IMPORTING
file_name = fname.
then pass the value "fname' where required.
Regards.
Amol
‎2009 Apr 13 10:29 AM
The FM : 'KD_GET_FILENAME_ON_F4' is not taking the filename as by default excel format.
If we specify the filename.XLS then only it is working. My requirement is to take it by deafult into excel format.
‎2009 Apr 13 10:39 AM
HI,
Check these Method's
CL_GUI_FRONTEND_SERVICES->FILE_OPEN_DIALOG
CL_GUI_FRONTEND_SERVICES->FILE_SAVE_DIALOG
You can pass the extension while calling these methods and When you see the Pop-Up the File type selected will be the one you passed to these methods.
Please check my above post ..