2010 May 31 1:43 PM
Hell all,
I have a requirement where in which I need to download the dynamic internal table to Excel sheet and save the excel sheet in the application server and send the same in emai as attachmentl. All these need to be done in background. The no of columns in the internal table may vary from 40 to 60. Please help me with this.
Thanks & Regards
Hemanth
Hell all,
I have a requirement where in which I need to download the dynamic internal table to Excel sheet and save the excel sheet in the application server and send the same in emai as attachmentl. All these need to be done in background. The no of columns in the internal table may vary from 40 to 60. Please help me with this.
Thanks & Regards
Hemanth
2010 May 31 1:56 PM
Hi,
Best regards,
Leandro Mengue
Hi,
You can create the file in XML format.
Create a XLS (in Excel) with your formats and needs. Save it as XML. Open this file with Nodepad.
Your program have to follow this format.
Best regards,
Leandro Mengue
Example:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>bmengue</Author>
<LastAuthor>bmengue</LastAuthor>
<Created>2010-05-17T15:19:12Z</Created>
<Company>xxxxx</Company>
<Version>11.9999</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>10230</WindowHeight>
<WindowWidth>18075</WindowWidth>
<WindowTopX>240</WindowTopX>
<WindowTopY>105</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
...
<Worksheet ss:Name="Plan1">
<Table ss:ExpandedColumnCount="4" ss:ExpandedRowCount="4" x:FullColumns="1"
x:FullRows="1">
<Row>
<Cell><Data ss:Type="String">A1</Data></Cell>
</Row>
<Row>
<Cell ss:Index="2"><Data ss:Type="String">B2</Data></Cell>
</Row>
<Row>
<Cell ss:Index="3"><Data ss:Type="String">C3</Data></Cell>
</Row>
<Row>
<Cell ss:Index="4" ss:StyleID="s21"><Data ss:Type="String">D4</Data></Cell>
</Row>
</Table>
...
replace A1,B2,C3,D4 by your values for cells A1,B2,C2,D4 ...
2010 May 31 2:24 PM
Hi Hemanth
Actually, as your needs you have to write a program to export internal data manually to an XLS file. You will need work with tags defined in XLS definition
Export process like sample below:
OPEN DATASET myfile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT my_table.
CONCATENATE '<Cell ss:Index="X">' my_table </cell> INTO x_value.
TRANSFER x_value TO myfile.
ENDLOOP.
CLOSE DATASET myfile.After that, you can use FM SO_DOCUMENT_SEND_API1 to send emails and use exported file as attachment.
Kind regards
Edited by: Carlos Machado on May 31, 2010 3:30 PM
2010 Jun 01 7:03 AM
Thanks Carlos. I have a doubt here. So in the '<Cell>'. Do I need to give the Cell numbaer like A1,B1 as in excel??
Regards
Hemanth
2010 Jun 03 1:11 AM
Hi Hemanth
Actually, is necessary to nest <Row> and <Cell> tags, please check as sample below:
<Row ss:Index="3">
<Cell ss:StyleID="s1">
<Data ss:Type="String">Product</Data>
</Cell>
<Cell ss:StyleID="s1">
<Data ss:Type="String">Sold</Data>
</Cell>
<Cell ss:StyleID="s1">
<Data ss:Type="String">Price</Data>
</Cell>
<Cell ss:StyleID="s1">
<Data ss:Type="String">Sum</Data>
</Cell>
</Row>Edited by: Carlos Machado on Jun 3, 2010 2:11 AM
2010 Jun 04 4:21 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |