Documente Academic
Documente Profesional
Documente Cultură
Online ABAP Report Excel with multiple Tabs The Development Soap Box
Highlights:
Online ABAP Report Excel with multiple Tabs The Development Soap Box
ABAP Data
Workstation
Extractor
Instantiate
Excel Excel
Fix Format Data
Report OLE Object Workbook
Template
Report
Program
Data
Format
SAP Development Community of Experts
Online ABAP Report Excel with multiple Tabs The Development Soap Box
Implementation Approach:
Procedural
Object Oriented
SAP Development Community of Experts
NOTES
Useful only for online reporting
Data needs to be sorted by Tab, RowID, ColumnID
SAP Development Community of Experts
Types:t_output(1500) typec,
tt_output typestandardtableoft_outputinitialsize0.
concatenatelwa_output
lwa_data-value
intolwa_output
separatedbycl_abap_char_utilities=>horizontal_tab.
SAP Development Community of Experts
data:excel_apptypeole2_object.
*startExcel
createobjectexcel_app'EXCEL.APPLICATION.
check_ole_errorsy-subrcole_error.
*addanewworkbook
callmethodofexcel_app'Workbooks'=workbooks.
callmethodofworkbooks'Add'=workbook.
callmethodofexcel_app'Cells'=cells
exporting
#1=1
#2=1.
callmethodofcells'Select'.
callmethodofactivesheet'Paste'.
SAP Development Community of Experts
Deployment
Lacking:
Encapsulation
Code and data are contained to one instance
Inheritance
No cut and paste of common code.
Multiple instantiation
Several workbooks can be created and worked on simultaneously
SAP Development Community of Experts
NOTES
Useful only for online reporting
Data can be provided in a predefined format the type is
declared in custom include or can be provided as a
standard table.
Data in predefined format needs to be sorted by Tab,
RowID, ColumnID
SAP Development Community of Experts
Data Declaration:
DATA: l_online_excelTYPEREFTOcl_online_excel.
SAP Development Community of Experts
CREATEOBJECTl_online_excel.
l_online_excel->add_title(
EXPORTING _tab_data =it_title
_rows=4
_columns =17).
l_online_excel->add_tabs(it_excel).
l_rc=l_online_excel->add_tabs_general(_tab_data =it_newtab
_tabname ='Customers'
_display ='X'
_title =space).
l_online_excel->start_excel(EXCEPTIONSole_error=1).
lwa_newtab='thisisnewtab'.
APPENDlwa_newtabTOit_newtab.
l_rc=l_online_excel->display_new_tab(
_clipboard =it_newtab
_tabname ='newtab').
SAP Development Community of Experts
OpenNewfilebasedonatemplate:
l_online_excel->start_excel(
exporting_template ='ZZTEST'
_filename =p_file
exceptionsole_error =1).
lv_borderbottom-linestyle=cl_online_excel=>cxl_border_continuous.
lv_borderbottom-weight=cl_online_excel=>cxl_ln_weight_light.
l_rc=l_online_excel->set_format(_start_row =5
_start_col =7
_end_row =5
_end_col =7
_halignment =cxl_halign_centre
_fontstyle =cxl_font_bold
_borderleft =lv_borderleft
_borderright =lv_borderright
_bordertop =lv_bordertop
_borderbottom =lv_borderbottom).
.
SAP Development Community of Experts
Online ABAP Report Excel with multiple Tabs The Development Soap Box
Deployment
Online ABAP Report Excel with multiple Tabs The Development Soap Box
Questions