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: 

function module for filename

Former Member
0 Kudos

hi friends,

can any1 pls tell the name of the FM which asks where to download the file.

i am converting smartform to pdf and using FM convert_otf_2_pdf to convert.i want a pop-up window which will ask me where to store the pdf.

thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Amit ,

Use the FM F4_FILENAME.

Regards

Arun

8 REPLIES 8

Former Member
0 Kudos

Hi Amit ,

Use the FM F4_FILENAME.

Regards

Arun

Former Member
0 Kudos

HI,

DO THE FOLLOWING:

DATA: output_file TYPE string,

PARAMETER: p_ofile TYPE rlgrap-filename DEFAULT 'C:\TEST.PDF.

MOVE p_ofile TO output_file.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = output_file

filetype = 'ASC'

write_field_separator = ' '

TABLES

data_tab = i_output

EXCEPTIONS

file_open_error = 1

file_write_error = 2

OTHERS = 3.

Former Member
0 Kudos

Hi,

FM <b>F4_FILENAME</b>

reward if useful.

Former Member
0 Kudos

Hi

try this

&----


*& Form get_file_name

&----


  • To get the File name

----


  • --->pv_fname File name

----


FORM get_file_name USING pv_fname TYPE rlgrap-filename.

DATA: lwa_files TYPE filetable,

lwa_title TYPE string,

l_file TYPE file_table,

lw_subrc TYPE sy-subrc.

lwa_title = text-099.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = lwa_title

CHANGING

file_table = lwa_files

rc = lw_subrc

EXCEPTIONS

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

OTHERS = 4.

IF sy-subrc = 0.

READ TABLE lwa_files INTO l_file INDEX 1.

IF sy-subrc = 0.

pv_fname = l_file.

ENDIF."IF sy-subrc = 0.

ENDIF."IF sy-subrc = 0.

ENDFORM. " get_file_name

regards

Shiva

Former Member
0 Kudos

guys <b>f4_filename</b> will not help me.

i want a pop-up window which will ask me where to save the file and not where the file is saved.

0 Kudos

Hi ,

Use the method file_save_dialog of the class CL_GUI_FRONTEND_SERVICES.

Regards

Arun

Former Member
0 Kudos

Try using METHOD cl_gui_frontend_services=>file_save_dialog

Former Member
0 Kudos

Hi,

Refer to the following code:

DATA: it_tab TYPE filetable,

wf_subrc TYPE i.

DATA: wf_filter TYPE string,

wf_dir TYPE string,

wf_title TYPE string,

wf_ext TYPE string.

  • if p_ml = 'X'. "Manula Load - PC File

wf_title = text-012. "Window title

wf_ext = text-013. "Extension of the file

wf_filter = text-014. "File Type

wf_dir = wf_pcfile. "Directory

*Adds a GUI-Supported Feature

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = wf_title

default_extension = wf_ext

file_filter = wf_filter

initial_directory = wf_dir

CHANGING

file_table = it_tab

rc = wf_subrc.

LOOP AT it_tab INTO p_p_pc .

ENDLOOP.

Hope this helps.

Reward if helpful.

Regards,

Sipra