cancel
Showing results for 
Search instead for 
Did you mean: 

write table to excel

Former Member
0 Kudos

Hi Folks,

In my application i have large no fields in the internal table (nearly 89 ).

I need to write the table to an excel file ie comma separated.

Is there any simplified way to do that ?

Reagrds,

Abhijeet

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Abhijeet,

Just in case u need more info on dynamic internal tables

please have a look on these great weblogs :

/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table

&

/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap

Hope it'll help u.

Thanks & Regards,

Ankur

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi abhijeet,

if you use a ALV_GRID to display the data you will have a included export option.

So ALV_GRID comes up with this feature. All you need to do is call the function module.

kind regards

Fabian

Former Member
0 Kudos

Hi,

This is a simple example.

REPORT Test.

data: mytable like zbtbas01 occurs 0 with header line.

field-symbols: <fs>.

data: begin of myfile occurs 0,

mystring type string,

end of myfile.

select * from zbtbas01 into corresponding fields of table mytable.

loop at mytable.

do.

ASSIGN COMPONENT sy-index OF STRUCTURE mytable TO <fs>.

if sy-subrc ne 0.

exit.

endif.

if sy-index = 1.

myfile-mystring = <fs>.

else.

concatenate myfile-mystring <fs> into myfile-mystring

separated by ';'.

endif.

enddo.

append myfile. clear myfile.

endloop.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:\file3.txt'

TABLES

DATA_TAB = myfile

EXCEPTIONS

OTHERS = 9.

Svetlin

Former Member
0 Kudos

Hi abhijeet,

See these weblogs these will help you out.

/people/thomas.jung3/blog/2004/08/09/bsp-download-to-excel-in-unicode-format

/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table

/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents

Thanks & Regards,

Ravikiran.

Former Member
0 Kudos

Hi Abhijeet,

Please have a look at following thread.

Regards,

Ankur