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 as .txt including header,itab footer with specific path

Former Member
0 Kudos

i have a specifix path like C://asd , an internal table itab, and a footer and header. I tried to use GUI_DOWNLOAD but, i can only send an internal table to this function.

I need to download these things .txt like this format

The account 21324.2342 (Header)

123 1231 123 1234 123 1234 123 1234 (itab[1])

321 4321 321 4321 321 4321 321 4321 (itab[2])

123 1231 123 1234 123 1234 123 1234 (itab[3])

321 4321 321 4321 321 4321 321 4321 (itab[4])

123 1231 123 1234 123 1234 123 1234 (itab[5])

321 4321 321 4321 321 4321 321 4321 (itab[6])

Sum is 123412 (Footer)

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ,

In function module GUI_DOWNLOAD there is a parameter called as append.

Cal this FM for 3 times,

1: For Header with append not used.

2: For Internal table with append as 'X'.

3: for Footer with append as 'X'.

In all the call keep the file name same .

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename

filetype = 'ASC'

CHANGING

data_tab = gt_header

EXCEPTIONS

OTHERS = 1.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename

filetype = 'ASC'

append = c_x

CHANGING

data_tab = p_gt_line

EXCEPTIONS

OTHERS = 1.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename

filetype = 'ASC'

append = c_x

CHANGING

data_tab = gt_control

EXCEPTIONS

OTHERS = 1.

Regards,

Ganesh.

Edited by: Ganesh Lathi on Dec 21, 2011 8:08 AM

3 REPLIES 3

former_member777515
Participant
0 Kudos

You need to create another internal table which contains only 1 field (possibly a string or a type c length 1000), then filled this table with the 'header', 'content', 'footer' and do a gui_download on this internal table.

former_member210621
Participant
0 Kudos

Hi,

when you are using function module GUI_DOUNLOAD, there is one parameter callled fieldnames....there you can mention an internal table containing information about header like column name, column value. Crete that internal table first and then pass that internal table in that function module so that you will be able to see header in the downloaded file

Former Member
0 Kudos

Hi ,

In function module GUI_DOWNLOAD there is a parameter called as append.

Cal this FM for 3 times,

1: For Header with append not used.

2: For Internal table with append as 'X'.

3: for Footer with append as 'X'.

In all the call keep the file name same .

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename

filetype = 'ASC'

CHANGING

data_tab = gt_header

EXCEPTIONS

OTHERS = 1.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename

filetype = 'ASC'

append = c_x

CHANGING

data_tab = p_gt_line

EXCEPTIONS

OTHERS = 1.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = lv_filename

filetype = 'ASC'

append = c_x

CHANGING

data_tab = gt_control

EXCEPTIONS

OTHERS = 1.

Regards,

Ganesh.

Edited by: Ganesh Lathi on Dec 21, 2011 8:08 AM