Académique Documents
Professionnel Documents
Culture Documents
User guide
Version 0.2.0
Hung Hoang (Hoangmanhung@gmail.com)
12/2/2010
ABAP CLASS ZCL_ALV2XLSX
Table of Contents
I. OVERVIEW............................................................................................................................. 2
II. INSTALLATION ..................................................................................................................... 3
III. DOCUMENTS ....................................................................................................................... 3
1. Attributes of the class: ZCL_ALV2XLSX: ........................................................................ 3
2. Methods of the class: ZCL_ALV2XLSX: .......................................................................... 3
2.1 CONSTRUCTOR .......................................................................................................... 3
2.2 INSERT_ROWS............................................................................................................ 4
2.3 WRITE_CELL ............................................................................................................... 4
2.4 WRITE_ROW ................................................................................................................ 4
2.5 WRITE_TABLE ............................................................................................................. 5
2.6 WRITE_TABLE_SLIS ................................................................................................... 5
2.7 WRITE_TABLE_LVC .................................................................................................... 6
2.8 WRITE_TABLE_ALV .................................................................................................... 7
2.9 FORMAT_CELLS.......................................................................................................... 8
2.10 SAVE_DOCUMENT .................................................................................................... 9
2.11 CLOSE_DOCUMENT ................................................................................................. 9
APPENDIX ...............................................................................................................................10
Structure: SOI_FORMAT_ITEM ............................................................................................10
COLOR PALETTE: ................................................................................................................10
FRAME TYPE .......................................................................................................................11
1 December 2010
ABAP CLASS ZCL_ALV2XLSX
I. OVERVIEW
Purpose:
You can use this class to export data on SAP ALV grid to xlsx / xls file format.
Main features:
Compatible with:
2 December 2010
ABAP CLASS ZCL_ALV2XLSX
II. INSTALLATION
This class should be installed into your system by using SAPLINK utility
(http://code.google.com/p/saplink/)
III. DOCUMENTS
1. Attributes of the class: ZCL_ALV2XLSX:
2.1 CONSTRUCTOR
You use this method to create a new document (sheet) in the Office Apps
Could read excel template from local path or from Business Document Service (BDS)
3 December 2010
ABAP CLASS ZCL_ALV2XLSX
2.2 INSERT_ROWS
You use this method to insert a numbers of empty rows into sheet.
2.3 WRITE_CELL
You use this method to insert a value into a sheet cell w/o format.
2.4 WRITE_ROW
You use this method to insert an ABAP work area into a sheet line w/o format.
4 December 2010
ABAP CLASS ZCL_ALV2XLSX
2.5 WRITE_TABLE
You use this method to insert a raw data table into sheet, at a specific position.
2.6 WRITE_TABLE_SLIS
You use this method to insert a data table into sheet with field catalog table (SLIS), sort table (SLIS), filter
table (SLIS) like build an ALV grid.
5 December 2010
ABAP CLASS ZCL_ALV2XLSX
2.7 WRITE_TABLE_LVC
You use this method to insert a data table into sheet with field catalog table (LVC), sort table (LVC), filter
table (LVC) like build an ALV grid.
6 December 2010
ABAP CLASS ZCL_ALV2XLSX
2.8 WRITE_TABLE_ALV
You use this method to insert data got from ALV object (CL_GUI_ALV_GRID) into sheet.
7 December 2010
ABAP CLASS ZCL_ALV2XLSX
2.9 FORMAT_CELLS
You use this method to format sheet cells
8 December 2010
ABAP CLASS ZCL_ALV2XLSX
2.10 SAVE_DOCUMENT
You use this method save document on presentation server
2.11 CLOSE_DOCUMENT
You use this method to close document and release data.
9 December 2010
ABAP CLASS ZCL_ALV2XLSX
APPENDIX
Structure: SOI_FORMAT_ITEM
COLOR PALETTE:
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
25 26 27 28 29 30
31 32 33 34 35 36
37 38 39 40 41 42
43 44 45 46 47 48
9 50 51 52 53 54
55 56 57
10 December 2010
ABAP CLASS ZCL_ALV2XLSX
FRAME TYPE:
0 Left margin
1 Top margin
2 Bottom margin
3 Right margin
4 Horizontal line
5 Vertical line
6 Thinness
7 Thickness
It's mean: (no Thickness) - Thinness - (no Vertical) - (no Horizontal) - Right - Bottom - Top - Left margin
Corresponding with 0-1-0-0-1-1-1-1 (binary) or 79 (decimal). So we set Frame type = 79 to get the result
above.
11 December 2010