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: 

Passing column headers in cl_gui_frontend_services=>gui_download

Former Member
0 Kudos
570

How to pass the coulumn headers in in the internal table while down loading it to a excel file by using method cl_gui_frontend_services=>gui_download

7 REPLIES 7

Vinod_Chandran
Active Contributor
0 Kudos
103

Hi Srini,

I think you have to have the header as the first line of the internal table.

Thanks

Vinod

0 Kudos
103

Vinod,

I thought about that .But I am not able to locate some code sample. Can you pl?

0 Kudos
103

For having the header in the same internal table, all the fields must have type C. Fill the fields with the header text and insert at index 1.

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

filename = Your file name

filetype = 'TXT'

CHANGING

data_tab = i_data

EXCEPTIONS

file_write_error = 1

no_batch = 2

....

....

Pls also refer the following

Thanks

Vinod

0 Kudos
103

Thanks Vinod.

But the requirement is to have the field description length more than the internal table field size.

I found another way of solving this.

I called the same method twice .In the first call pass a internal table only with filed descriptions and in the second call with another table with values (this call is in the append mode).

Please let me know if any other way of doing this work around.

0 Kudos
103

what you can do is first download a itab which only holds one record with just headings.

then again download another itab with data to the same file location in <b>append mode</b> . (import parameter append = 'X' )

This is how i have handled this issue.

Regards

Raja

0 Kudos
103

I think this is fine.

Former Member
0 Kudos
103

Hi,

For column headers define a table with all the field names type c value 'field name'.

Define another table of type output table.

Then pass the fieldnames into this output table and then populate the values in the output table to the new output table.

Now this table contains all the dats with header as the index 1.

I did like this. U can try this out.

Thanks & Regards,

Judith.