By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Just pass the list index and one internal table into which it will download the report. The strucure of the itab will be Data: begin of itab occurs 0, line(300), end of itab. after this just use 'ws_download' function and pass this itab. The total online report will get downloaded into the flat file. The function module 'LIST_TO_ASCI' should use at the end of report, that is after writing each and every statement in the report. small example is as follows. REPORT ZDOWNLOAD_REP . tables: mara. DATA: BEGIN OF ITAB occurs 0, MATNR TYPE MARA-MATNR, MTART TYPE MARA-MTART, MBRSH TYPE MARA-MBRSH, MATKL TYPE MARA-MATKL, END OF ITAB. data: begin of itab1 occurs 0, line(300), end of itab1. start-of-selection. select * from mara into corresponding fields of table itab. loop at itab. WRITE:/ ITAB-matnr, itab-mtart, itab-mbrsh,itab-matkl. endloop. CALL FUNCTION 'LIST_TO_ASCI' EXPORTING LIST_INDEX = 0 TABLES LISTASCI = itab1. CALL FUNCTION 'WS_DOWNLOAD' EXPORTING FILENAME = 'C:report.txt' FILETYPE = 'ASC' TABLES DATA_TAB = itab1. This will work in all the versions of SAP.