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: 

FM for Download

Former Member
0 Kudos

Hi guys,

I have a requirement wherein i need to download data from my internal table in a file on the desktop of the user who is running it Atuomatically, the user will not provide any filepath. Can any one inform me about the Function Module for the same.

Thanks and regards,

Riya

5 REPLIES 5

Former Member
0 Kudos

Hi,

You can use GUI_DOWNLOAD function module and describe a default path in that.

Regards,

Pankaj

Former Member
0 Kudos

Download internal table to presentation server file(PC)

DATA: ld_filename TYPE string,

Pre version 4.7 declaration e_file like rlgrap-filename.

DATA: begin of it_datatab occurs 0,

row(500) type c,

end of it_datatab.

call function 'GUI_DOWNLOAD'

exporting

filename = ld_filename

filetype = 'ASC'

tables

data_tab = it_datatab[]

exceptions

file_open_error = 1

file_write_error = 2

others = 3.

Download internal table to presentation server file(PC)

Separating fields/columns by a tab

DATA: ld_filename TYPE string,

Pre version 4.7 declaration e_file like rlgrap-filename.

DATA: begin of it_datatab occurs 0,

col1(50) type c,

col2(50) type c,

col3(50) type c,

etc....

end of it_datatab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = ld_filename

filetype = 'ASC'

APPEND = 'X'

write_field_separator = 'X'

CONFIRM_OVERWRITE = 'X'

TABLES

data_tab = it_datatab[]

EXCEPTIONS

file_open_error = 1

file_write_error = 2

OTHERS = 3.

Former Member
0 Kudos

Hi,

GUI_DOWNLOAD or WS_DOWNLOAD will suffice your need.

Put the path in the program it self.

PS : WS_DOWNLOAD is not recommeneded as it is obsolete.

Regards,

Lalit Kabra

0 Kudos

Hi All,

My requirement is :

The internal table that i am talkin about is an Error Log Table and whenever Any User runs the pgm whatevr entries are there in the internal table i.e The Entire Error Log should be copied automatically in a file on his/her desktop.

I would not be able to hardcode the path.. or provide the filepath in the program.

Thanks,

Riya.

0 Kudos

You need to use a hardcoded file path that will always exist on a PC.

😧

C:/temp

C:

etc.