cancel
Showing results for 
Search instead for 
Did you mean: 

Export to multiple worsheets in an excel file

Former Member
0 Kudos

Hi all,

I just wanted to export to multiple worksheets in the same excel file based on certain categories.

I was wondering if it can be done or not.

Also I am not using ALV.

Can anyone think of a way how to achieve it?

Thanks and Regards

Avinash

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The simplier text based formats (Text Tab Delimited and Comma Separated Files) which have been discussed frequently in this forum won't be able to support multiple worksheets unfortunetely. That is simply a limitation of the text formats and Excel - not an ability from the ABAP side.

You will have to look into the Excel XML format. There have been different schemas used between Excel 2003 and 2007. From the ABAP side, this really isn't a Web Dynpro question - just core ABAP development. You can build an XML file in ABAP using concatenate statements, the iXML parser, or with an XSLT. I have done this before the best way to learn about the XML format needed is to create an Excel document that matches your structure and use the Save As XML function in Excel. I will warn you that the Excel XML format is rather complicated and will take some time to study and implement. I sure hope your requirement of multiple sheets (as opposed to a simplier approach of multiple Excel files) is worth the considerable effort that it will take to implement.

Former Member
0 Kudos

Thanks for the prompt reply.

Coming back to the problem: Should I actually code and create an XML string that contains multiple Worksheet nodes or are there any FM's available that would just take some (more than one internal table) as input and club them to give a single string with multible worksheet nodes.

It seems this is what I have to do.

And secondly is it only limited to this or am I missing something here.

Thanks and Regards

Avinash

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I don't know of any such function modules. The closes thing I can think of is the XSLT that was written for ALV to export in the Excel XML format - but it doesn't support multiple worksheets. You still might be able to use that as a starting point.

Former Member
0 Kudos

Thanks for the clarifications Thomas.

I will try the approach and see if it yields the desired results.

Regards

Avinash

Answers (0)