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: 

how to download datas in int table

UmaArjunan
Active Participant
0 Kudos

i have some datas in the internal table

while downloading the datas , using gui download

i need to download it in a specific format either in rtf or csv.

Will it be possible to download the datas present in internal tabl to a specific format given below

for example

postaladdres cocode

data2 data3

blank lines

data4 data5 data6

if so then pls provide some guidelines to work on further

4 REPLIES 4

Former Member
0 Kudos

Yes it is possible using FM GUI_DOWNLOAD.

Please check the FM documentation which contains sample code and also have a look at below thread:

I hope it helps.

Best Regards,

Vibha

Please mark all the helpful answers

Former Member
0 Kudos

Hi,

yes we can download.

try this once...

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = p_file

filetype = 'ASC' " mention file type here

write_field_separator = ' '

TABLES

data_tab = i_table

fieldnames = con_tab.

IF sy-subrc = 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Reward if it useful...

Lakshmi.

Former Member
0 Kudos

Hi,

As others have explained there is a function module which downloads the data in the respective required format.

say you have CSV format, you can mention the same in the function module in the export parameters in file type.

The function module is gui_download.

Now the data will be downloaded in the CSV format.

DATA:WK_FILENAME1 TYPE STRING.

WK_FILENAME1 = W_FILENAME.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = WK_FILENAME1

FILETYPE = 'CSV'

TABLES

DATA_TAB = IT_ZET720

EXCEPTIONS

FILE_WRITE_ERROR = 1

NO_BATCH = 2

GUI_REFUSE_FILETRANSFER = 3

INVALID_TYPE = 4

NO_AUTHORITY = 5

UNKNOWN_ERROR = 6

HEADER_NOT_ALLOWED = 7

SEPARATOR_NOT_ALLOWED = 8

FILESIZE_NOT_ALLOWED = 9

HEADER_TOO_LONG = 10

DP_ERROR_CREATE = 11

DP_ERROR_SEND = 12

DP_ERROR_WRITE = 13

UNKNOWN_DP_ERROR = 14

ACCESS_DENIED = 15

DP_OUT_OF_MEMORY = 16

DISK_FULL = 17

DP_TIMEOUT = 18

FILE_NOT_FOUND = 19

DATAPROVIDER_EXCEPTION = 20

CONTROL_FLUSH_ERROR = 21

OTHERS = 22.

I hope this suffices you.

Kindly reward points, if the solution is achieved.

Thanks,

Abdur.

Edited by: abdur rafique on May 5, 2008 12:31 PM

Edited by: abdur rafique on May 5, 2008 12:32 PM

Former Member
0 Kudos

HI ,

The function modules used to read local files:

Gui_upload – for text files

Text_convert_xls_to_sap for Xls files

Alsm_excel_to_internal_table

Text_convert_csv_to_sap – for csv files

The function modules to create local files :

Gui_download

Sap_convert_to_xls_format

Sap_convert_to_csv_format

Reward if useful

Thanks

Jagadeesh.G