‎2005 Nov 23 7:41 AM
i hav At selection screen like this:-
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
TABLES : tfdir.
DATA : prg_name LIKE sy-repid,
dynp_numb LIKE sy-dynnr,
field_name LIKE dynpread-fieldname.
SELECT SINGLE * FROM tfdir WHERE funcname = 'F4_FILENAME'.
IF sy-subrc EQ 0.
prg_name = sy-repid.
dynp_numb = sy-dynnr.
field_name = 'p_path'.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = prg_name
dynpro_number = dynp_numb
field_name = field_name
IMPORTING
file_name = p_path.
ENDIF.
IF sy-subrc NE 0.
MESSAGE i000(zmsg).
ENDIF.
This fm is getting file name.
But I need only files with format " *.CSV " in this criteria.
How should I do this?
‎2005 Nov 23 7:49 AM
Hi Hari,
just run this
report zanid_test.
tables rlgrap.
data: it_tab type filetable,
gd_subrc type i.
selection-screen begin of block m with frame.
select-options so_fpath for rlgrap-filename.
selection-screen end of block m.
at selection-screen on value-request for so_fpath-low.
REFRESH: it_tab.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'Select File'
DEFAULT_FILENAME = '*.csv'
MULTISELECTION = 'X'
CHANGING
FILE_TABLE = it_tab
RC = gd_subrc.
loop at it_tab into so_fpath-low.
so_fpath-sign = 'I'.
so_fpath-option = 'EQ'.
append so_fpath.
endloop.
‎2005 Nov 23 7:54 AM
this code is also accepting anyother format other than " CSV ".
It should not allow if any other format is taken in the selection-screen.
It should only accept CSV format in sel. screen.
moreover..This field is a parameter not select-options.
‎2005 Nov 23 7:56 AM
My sel. screen is:-
parameters : p_path LIKE ibipparms-path.
One more thing..It should accept the file from the presentation server.
‎2005 Nov 23 8:02 AM
Hi Hari,
Once you read the file using F4_Filename, use function module SPLIT_FILENAME to check whether the file extension is CSV.
Thanks
Lakshman
‎2005 Nov 23 8:14 AM
Hi Hari,
Try using function nodule KD_GET_FILENAME_ON_F4
Thanks
Lakshman
‎2005 Nov 23 8:06 AM
HiHari,
Instead of f4_filename, use F4_DXFILENAME_4_DYNP where there is an option of specifying the filetype.
Hope this would solve your problem.
Allot points for valuable answers.
Warm Regards,
Vinod.
‎2005 Nov 23 8:48 AM
Hi..vinod,
can u send me a test coding using this func. module
F4_DXFILENAME_4_DYNP .
I think it seem work using this fm because i need to get the file frm presentation server.
thanx again.
waiting for your reply