Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Downloading Data using GUI_DOWNLOAD

HI All,

I want to download data from 3 internal tables into a single Text file on presentation Server .

I knew about the GUI_download function module with Appending options but my problem is that i want to distinguish 3 types of data present in my 3 internal tables

My 3 internal table contains following type of data

1st Internal table : Production schedule data

2nd Internal Table: Material Master Data

3rd Internal Table: Bom Data

So i want some description between the 3 types of data downloaded to single file

Like:

01 Production Schedule

( Then production Schedule data)

02 Material Master

( Then Material Master Data)

03 Bom data

( Then Bom data)

Please help me out

Thanks

Tags:
Former Member
replied

Hi Gaurav,

what exactly is the problem. I would say that now everything is clear. The code should be similar to this one just do corrections depending on your table names.

In first saving use append = '' in other savings append = 'X'

data: it_comments type table of string.
data: wa_comments type string.

wa_comments = '01 production schedule'.
append wa_comments to it_comments.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = file
FILETYPE = 'ASC'
APPEND = ''
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_comments.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = file
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_tab1.

refresh it_comments.
wa_comments = '02 Material Master'.
append wa_comments to it_comments.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = file
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_comments.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = file
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_tab2.

refresh it_comments.
wa_comments = '03 Bom data'.
append wa_comments to it_comments.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = file
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_comments.

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = file
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = it_tab3.

I hope you can finish your task now.

Regards,

Karol

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question