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: 

Downloading Data using GUI_DOWNLOAD

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

karol_seman
Active Participant
0 Kudos

Hi Gaurav,

from your posting I don't know which type of output file are you filling.

But let's guess it is simple text file.

Just create one new internal table of type string into which pull your comments and then again with addition option put this data into file.

Regards,

Karol

7 REPLIES 7

Former Member
0 Kudos

Before downloading the tables insert the descriptions as 1st record in the tables.

karol_seman
Active Participant
0 Kudos

Hi Gaurav,

from your posting I don't know which type of output file are you filling.

But let's guess it is simple text file.

Just create one new internal table of type string into which pull your comments and then again with addition option put this data into file.

Regards,

Karol

0 Kudos

Thanks for your reply

I got your idea of making a new internal table having "Identifier" and " Description"

But how can i add these 2 values into the text file

Means how to add

01 production schedule

then data of 1 internal table

02 Material Master

then data of 2nd internal table

03 Bom data

Then data of 3rd internal table

Please reply me

Thanks

0 Kudos

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 Kudos

Hi karol

Thanks for your help

I have implemented your code

and it works

Thanks

Thanks all of you

Former Member
0 Kudos

hi Gaurav,

Try in this manner.

Take one final Internal table which having String as an field in it.

Then pass First internal table to Final internal Table, After that pass the Description. Similarly you pass the second internal table data and third internal table data. I hope this will solve ur problem.....

0 Kudos

Thanks for your reply

But can u plz give me the code how to do it

thanks