Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

At selection screen validation doubt

Former Member
0 Likes
737

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?

7 REPLIES 7
Read only

Former Member
0 Likes
715

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.

Read only

0 Likes
715

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.

Read only

0 Likes
715

My sel. screen is:-

parameters : p_path LIKE ibipparms-path.

One more thing..It should accept the file from the presentation server.

Read only

0 Likes
715

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

Read only

0 Likes
715

Hi Hari,

Try using function nodule KD_GET_FILENAME_ON_F4

Thanks

Lakshman

Read only

Former Member
0 Likes
715

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.

Read only

0 Likes
715

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