Application Development 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: 

To Download a file to XLS(default) format using KD_GET_FILENAME_ON_F4

Former Member
0 Kudos

Hi,

I want to download a file in XLS format.

While using KD_GET_FILENAME_ON_F4 FM .

When i get a pop up window ,i need the default filetype to be shown as XLS file type.

7 REPLIES 7

Former Member
0 Kudos

Hi,

In the exporting parameters pass the value for MASK according to your requirement.

MASK is a normal printout which specifies the files which can be selected.

Structure of MASK: ','<text>','<FILTERGROUP>+'.'

Structure of FILTERGROUP: <filter>';'<filter>*

Example: CALL FUNCTION .. EXPORTING .. MASK = ',.,..' .. generates the file selector mask with the defaults File name: empty, Save as type: .

Regards,

Mrunal

0 Kudos

Can you please elaborate .

i have mentioned mask = '*.XLS'

static = 'X'

Still its not working. Should i give any more option along with this.

0 Kudos

Have you passed program name and dynpro number ?

0 Kudos

I am declaring like this.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

program_name = syst-repid

dynpro_number = syst-dynnr

  • FIELD_NAME = 'rt'

  • static = 'X'

mask = ',.XLS,*.xls'

CHANGING

file_name = lv_filepath

EXCEPTIONS

mask_too_long = 1

OTHERS = 2.

0 Kudos

Give Mask =' ,.XLS,.XLS.' just paste this as it is and check.

the stars did not get printed earlier.

 ',*.XLS,*.XLS.' 

Edited by: Mrunal Shyamkant Patki on Oct 1, 2009 3:33 PM

0 Kudos

The problem is :

Its getting downloaded into a non type format.

if i debug the function module i got to know that TMP_FILE_NAME is not getting appended with the filetype(.xls).

That is the reason i am not able to open the file after it gets downloaded.

So i just manually appended .xls to the TMP_FILE_NAME variable at the end.

But the funtion module should itself append the given file type at the end.

Can you help me with this.

Points will be given.

Former Member
0 Kudos

Hi,,

Use in this way

CALL FUNCTION 'KD_GET_FILENAME_ON_F4' "To populate dialog box for selecting presentation server file

EXPORTING

mask = ',XLS,*.xls,'

CHANGING

file_name = p_fpath.