cancel
Showing results for 
Search instead for 
Did you mean: 

Populating data into multiple work sheets in an Excel File

Former Member
0 Kudos

Hi all,

I am using the following method to download an excel sheet.

CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

EXPORTING

text = v_string

IMPORTING

buffer = v_xstring.

cl_wd_runtime_services=>attach_file_to_response( i_filename = 'EXCEL.XLS'

i_content = v_xstring

i_mime_type = 'EXCEL' ).

Now the 'Sheet1' gets populated with the data.

I also want to populate the 'Sheet2' in this excel file.

Can anyone explain how to achieve this?

Or is there any other way to create this excel sheet in order achieve my result.

Thanks in advance.

Regards,

Mohamed Aslam

Accepted Solutions (0)

Answers (3)

Answers (3)

_IvanFemia_
Active Contributor
0 Kudos

Hi,

try to use this new library

[abap2xlsx - Generate your professional Excel spreadsheet from ABAP|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20046] [original link is broken] [original link is broken] [original link is broken];

Regards,

Ivan

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Can anyone explain how to achieve this?

I assume you are currently using a text tab delimited or simliar file format. You can't have multiple work sheets in this format. That's a limitation of the format, not a Web Dynpro related limitation. My suggestion would be switching to the Excel XML format. It is certainly more difficult to build the XML format, but it can be done. You will find the XML format has far less restrictions on Excel features. You can mock up a spreadsheet with the features you want and do a save as XML from Excel and study the resulting file in a text editor.

The XML format is still text based, so at its simpliest form you can concatenate a string together, however you might find that using the iXML library or an XSLT makes the creation of the XML format easier.

Former Member
0 Kudos

HI Mohamed,

I hope this interface will help you I_OI_SPREADSHEET , Methods like ADD SHEET , SET_RANGES_DATA are present in this interface , i dint experienced this scenario in real time .. now i am trying you scenario let see ...

Regards

Chinnaiya P

Edited by: chinnaiya pandiyan on Jul 9, 2010 5:05 PM