mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 16:36:12 +08:00
Delete objects moved to abap2xlsx/demos repository (#998)
* Delete objects moved to abap2xlsx/demos repository * remove unused zexcel_export_dir * + procedure for the demo programs Co-authored-by: sandraros <sandra.rossi@gmail.com>
This commit is contained in:
parent
e97169a0c3
commit
bea794926b
|
@ -4,8 +4,10 @@
|
||||||
|
|
||||||
## Procedure
|
## Procedure
|
||||||
|
|
||||||
Execute abapGit using the report **ZABAPGIT_FULL**, click on *New Online*, fill the field *Git repository URL* with *https://github.com/abap2xlsx/abap2xlsx.git*, package with *$abap2xls* if you just want to test. If you want to transport abap2xlsx to production then use a non local package. Click *Create package* if the package doesn't exist yet. Then click *Clone online repo*
|
Execute abapGit using the report **ZABAPGIT_FULL**, click on *New Online*, fill the field *Git repository URL* with *https://github.com/abap2xlsx/abap2xlsx.git*, package with *$abap2xlsx* if you just want to test. If you want to transport abap2xlsx to production then use a non local package. Click *Create package* if the package doesn't exist yet. Then click *Clone online repo*
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
To install abap2xlsx click *pull*.
|
To install abap2xlsx click *pull*.
|
||||||
|
|
||||||
|
After installing, if you want to install the **demo programs**, repeat the actions above, starting from *New Online* to *pull*, and fill *Git repository URL* with *https://github.com/abap2xlsx/demos*.
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_SICF" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<URL>/sap/bc/webdynpro/sap/NPL0018/</URL>
|
|
||||||
<ICFSERVICE>
|
|
||||||
<ICF_NAME>NPL0018</ICF_NAME>
|
|
||||||
<ORIG_NAME>NPL0018</ORIG_NAME>
|
|
||||||
<ICFALTNME>ZDEMO_EXCEL_WDA01</ICFALTNME>
|
|
||||||
</ICFSERVICE>
|
|
||||||
<ICFDOCU>
|
|
||||||
<ICF_NAME>NPL0018</ICF_NAME>
|
|
||||||
<ICF_LANGU>E</ICF_LANGU>
|
|
||||||
<ICF_DOCU>Web Dynpro Application ZDEMO_EXCEL_WDA01 / Component ZDEMO_EXCEL_WDA01</ICF_DOCU>
|
|
||||||
</ICFDOCU>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,280 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZABAP2XLSX_DEMO_SHOW
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
REPORT zabap2xlsx_demo_show.
|
|
||||||
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_perform DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_perform DEFINITION CREATE PRIVATE.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
CLASS-METHODS: setup_objects,
|
|
||||||
collect_reports,
|
|
||||||
|
|
||||||
handle_nav FOR EVENT double_click OF cl_gui_alv_grid
|
|
||||||
IMPORTING e_row.
|
|
||||||
|
|
||||||
PRIVATE SECTION.
|
|
||||||
TYPES: BEGIN OF ty_reports,
|
|
||||||
progname TYPE reposrc-progname,
|
|
||||||
sort TYPE reposrc-progname,
|
|
||||||
description TYPE repti,
|
|
||||||
filename TYPE string,
|
|
||||||
END OF ty_reports.
|
|
||||||
|
|
||||||
CLASS-DATA:
|
|
||||||
lo_grid TYPE REF TO cl_gui_alv_grid,
|
|
||||||
lo_text TYPE REF TO cl_gui_textedit,
|
|
||||||
cl_document TYPE REF TO i_oi_document_proxy,
|
|
||||||
|
|
||||||
t_reports TYPE STANDARD TABLE OF ty_reports WITH NON-UNIQUE DEFAULT KEY.
|
|
||||||
CLASS-DATA:error TYPE REF TO i_oi_error,
|
|
||||||
t_errors TYPE STANDARD TABLE OF REF TO i_oi_error WITH NON-UNIQUE DEFAULT KEY,
|
|
||||||
cl_control TYPE REF TO i_oi_container_control. "Office Dokument
|
|
||||||
|
|
||||||
ENDCLASS. "lcl_perform DEFINITION
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
lcl_perform=>collect_reports( ).
|
|
||||||
lcl_perform=>setup_objects( ).
|
|
||||||
|
|
||||||
END-OF-SELECTION.
|
|
||||||
|
|
||||||
WRITE '.'. " Force output
|
|
||||||
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_perform IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_perform IMPLEMENTATION.
|
|
||||||
METHOD setup_objects.
|
|
||||||
DATA: lo_split TYPE REF TO cl_gui_splitter_container,
|
|
||||||
lo_container TYPE REF TO cl_gui_container.
|
|
||||||
|
|
||||||
DATA: it_fieldcat TYPE lvc_t_fcat,
|
|
||||||
is_layout TYPE lvc_s_layo,
|
|
||||||
is_variant TYPE disvariant.
|
|
||||||
FIELD-SYMBOLS: <fc> LIKE LINE OF it_fieldcat.
|
|
||||||
|
|
||||||
|
|
||||||
CREATE OBJECT lo_split
|
|
||||||
EXPORTING
|
|
||||||
parent = cl_gui_container=>screen0
|
|
||||||
rows = 1
|
|
||||||
columns = 3
|
|
||||||
no_autodef_progid_dynnr = 'X'.
|
|
||||||
lo_split->set_column_width( EXPORTING id = 1
|
|
||||||
width = 20 ).
|
|
||||||
lo_split->set_column_width( EXPORTING id = 2
|
|
||||||
width = 40 ).
|
|
||||||
|
|
||||||
* Left: List of reports
|
|
||||||
lo_container = lo_split->get_container( row = 1
|
|
||||||
column = 1 ).
|
|
||||||
|
|
||||||
CREATE OBJECT lo_grid
|
|
||||||
EXPORTING
|
|
||||||
i_parent = lo_container.
|
|
||||||
SET HANDLER lcl_perform=>handle_nav FOR lo_grid.
|
|
||||||
|
|
||||||
is_variant-report = sy-repid.
|
|
||||||
is_variant-handle = '0001'.
|
|
||||||
|
|
||||||
is_layout-cwidth_opt = 'X'.
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO it_fieldcat ASSIGNING <fc>.
|
|
||||||
<fc>-fieldname = 'PROGNAME'.
|
|
||||||
<fc>-tabname = 'REPOSRC'.
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO it_fieldcat ASSIGNING <fc>.
|
|
||||||
<fc>-fieldname = 'SORT'.
|
|
||||||
<fc>-ref_field = 'PROGNAME'.
|
|
||||||
<fc>-ref_table = 'REPOSRC'.
|
|
||||||
<fc>-tech = abap_true. "No need to display this help field
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO it_fieldcat ASSIGNING <fc>.
|
|
||||||
<fc>-fieldname = 'DESCRIPTION'.
|
|
||||||
<fc>-ref_field = 'REPTI'.
|
|
||||||
<fc>-ref_table = 'RS38M'.
|
|
||||||
|
|
||||||
lo_grid->set_table_for_first_display( EXPORTING
|
|
||||||
is_variant = is_variant
|
|
||||||
i_save = 'A'
|
|
||||||
is_layout = is_layout
|
|
||||||
CHANGING
|
|
||||||
it_outtab = t_reports
|
|
||||||
it_fieldcatalog = it_fieldcat
|
|
||||||
EXCEPTIONS
|
|
||||||
invalid_parameter_combination = 1
|
|
||||||
program_error = 2
|
|
||||||
too_many_lines = 3
|
|
||||||
OTHERS = 4 ).
|
|
||||||
|
|
||||||
* Middle: Text with coding
|
|
||||||
lo_container = lo_split->get_container( row = 1
|
|
||||||
column = 2 ).
|
|
||||||
CREATE OBJECT lo_text
|
|
||||||
EXPORTING
|
|
||||||
parent = lo_container.
|
|
||||||
lo_text->set_readonly_mode( cl_gui_textedit=>true ).
|
|
||||||
lo_text->set_font_fixed( ).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* right: DemoOutput
|
|
||||||
lo_container = lo_split->get_container( row = 1
|
|
||||||
column = 3 ).
|
|
||||||
|
|
||||||
c_oi_container_control_creator=>get_container_control( IMPORTING control = cl_control
|
|
||||||
error = error ).
|
|
||||||
APPEND error TO t_errors.
|
|
||||||
|
|
||||||
cl_control->init_control( EXPORTING inplace_enabled = 'X'
|
|
||||||
no_flush = 'X'
|
|
||||||
r3_application_name = 'Demo Document Container'
|
|
||||||
parent = lo_container
|
|
||||||
IMPORTING error = error
|
|
||||||
EXCEPTIONS OTHERS = 2 ).
|
|
||||||
APPEND error TO t_errors.
|
|
||||||
|
|
||||||
cl_control->get_document_proxy( EXPORTING document_type = 'Excel.Sheet' " EXCEL
|
|
||||||
no_flush = ' '
|
|
||||||
IMPORTING document_proxy = cl_document
|
|
||||||
error = error ).
|
|
||||||
APPEND error TO t_errors.
|
|
||||||
* Errorhandling should be inserted here
|
|
||||||
|
|
||||||
|
|
||||||
ENDMETHOD. "setup_objects
|
|
||||||
|
|
||||||
"collect_reports
|
|
||||||
METHOD collect_reports.
|
|
||||||
FIELD-SYMBOLS <report> LIKE LINE OF t_reports.
|
|
||||||
DATA t_source TYPE STANDARD TABLE OF text255 WITH NON-UNIQUE DEFAULT KEY.
|
|
||||||
DATA texts TYPE STANDARD TABLE OF textpool.
|
|
||||||
DATA description TYPE textpool.
|
|
||||||
|
|
||||||
* Get all demoreports
|
|
||||||
SELECT progname
|
|
||||||
INTO CORRESPONDING FIELDS OF TABLE t_reports
|
|
||||||
FROM reposrc
|
|
||||||
WHERE progname LIKE 'ZDEMO_EXCEL%'
|
|
||||||
AND progname <> sy-repid
|
|
||||||
AND subc = '1'.
|
|
||||||
|
|
||||||
LOOP AT t_reports ASSIGNING <report>.
|
|
||||||
|
|
||||||
* Check if already switched to new outputoptions
|
|
||||||
READ REPORT <report>-progname INTO t_source.
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
FIND 'INCLUDE zdemo_excel_outputopt_incl.' IN TABLE t_source IGNORING CASE.
|
|
||||||
ENDIF.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
DELETE t_reports.
|
|
||||||
CONTINUE.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
|
|
||||||
* Build half-numeric sort
|
|
||||||
<report>-sort = <report>-progname.
|
|
||||||
REPLACE REGEX '(ZDEMO_EXCEL)(\d\d)\s*$' IN <report>-sort WITH '$1\0$2'. " REPLACE REGEX '(ZDEMO_EXCEL)([^][^])*$' IN <report>-sort WITH '$1$2'.REPLACE REGEX '(ZDEMO_EXCEL)([^][^])*$' IN <report>-sort WITH '$1$2'.REPLACE
|
|
||||||
|
|
||||||
REPLACE REGEX '(ZDEMO_EXCEL)(\d)\s*$' IN <report>-sort WITH '$1\0\0$2'.
|
|
||||||
|
|
||||||
* get report text
|
|
||||||
READ TEXTPOOL <report>-progname INTO texts LANGUAGE sy-langu.
|
|
||||||
READ TABLE texts INTO description WITH KEY id = 'R'.
|
|
||||||
IF sy-subrc > 0.
|
|
||||||
"If not available in logon language, use english
|
|
||||||
READ TEXTPOOL <report>-progname INTO texts LANGUAGE 'E'.
|
|
||||||
READ TABLE texts INTO description WITH KEY id = 'R'.
|
|
||||||
ENDIF.
|
|
||||||
"set report title
|
|
||||||
<report>-description = description-entry.
|
|
||||||
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
SORT t_reports BY sort progname.
|
|
||||||
|
|
||||||
ENDMETHOD. "collect_reports
|
|
||||||
|
|
||||||
METHOD handle_nav.
|
|
||||||
CONSTANTS: filename TYPE text80 VALUE 'ZABAP2XLSX_DEMO_SHOW.xlsx'.
|
|
||||||
DATA: wa_report LIKE LINE OF t_reports,
|
|
||||||
t_source TYPE STANDARD TABLE OF text255,
|
|
||||||
t_rawdata TYPE solix_tab,
|
|
||||||
wa_rawdata LIKE LINE OF t_rawdata,
|
|
||||||
bytecount TYPE i,
|
|
||||||
length TYPE i,
|
|
||||||
add_selopt TYPE flag.
|
|
||||||
|
|
||||||
|
|
||||||
READ TABLE t_reports INTO wa_report INDEX e_row-index.
|
|
||||||
CHECK sy-subrc = 0.
|
|
||||||
|
|
||||||
* Set new text into middle frame
|
|
||||||
READ REPORT wa_report-progname INTO t_source.
|
|
||||||
lo_text->set_text_as_r3table( EXPORTING table = t_source ).
|
|
||||||
|
|
||||||
|
|
||||||
* Unload old xls-file
|
|
||||||
cl_document->close_document( ).
|
|
||||||
|
|
||||||
* Get the demo
|
|
||||||
* If additional parameters found on selection screen, start via selection screen , otherwise start w/o
|
|
||||||
CLEAR add_selopt.
|
|
||||||
FIND 'PARAMETERS' IN TABLE t_source.
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
add_selopt = 'X'.
|
|
||||||
ELSE.
|
|
||||||
FIND 'SELECT-OPTIONS' IN TABLE t_source.
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
add_selopt = 'X'.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
IF add_selopt IS INITIAL.
|
|
||||||
SUBMIT (wa_report-progname) AND RETURN "#EC CI_SUBMIT
|
|
||||||
WITH p_backfn = filename
|
|
||||||
WITH rb_back = 'X'
|
|
||||||
WITH rb_down = ' '
|
|
||||||
WITH rb_send = ' '
|
|
||||||
WITH rb_show = ' '.
|
|
||||||
ELSE.
|
|
||||||
SUBMIT (wa_report-progname) VIA SELECTION-SCREEN AND RETURN "#EC CI_SUBMIT
|
|
||||||
WITH p_backfn = filename
|
|
||||||
WITH rb_back = 'X'
|
|
||||||
WITH rb_down = ' '
|
|
||||||
WITH rb_send = ' '
|
|
||||||
WITH rb_show = ' '.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
OPEN DATASET filename FOR INPUT IN BINARY MODE.
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
DO.
|
|
||||||
CLEAR wa_rawdata.
|
|
||||||
READ DATASET filename INTO wa_rawdata LENGTH length.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
APPEND wa_rawdata TO t_rawdata.
|
|
||||||
ADD length TO bytecount.
|
|
||||||
EXIT.
|
|
||||||
ENDIF.
|
|
||||||
APPEND wa_rawdata TO t_rawdata.
|
|
||||||
ADD length TO bytecount.
|
|
||||||
ENDDO.
|
|
||||||
CLOSE DATASET filename.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_control->get_document_proxy( EXPORTING document_type = 'Excel.Sheet' " EXCEL
|
|
||||||
no_flush = ' '
|
|
||||||
IMPORTING document_proxy = cl_document
|
|
||||||
error = error ).
|
|
||||||
|
|
||||||
cl_document->open_document_from_table( EXPORTING document_size = bytecount
|
|
||||||
document_table = t_rawdata
|
|
||||||
open_inplace = 'X' ).
|
|
||||||
|
|
||||||
ENDMETHOD. "handle_nav
|
|
||||||
|
|
||||||
ENDCLASS. "lcl_perform IMPLEMENTATION
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZABAP2XLSX_DEMO_SHOW</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo Show</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,752 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZANGRY_BIRDS
|
|
||||||
*& Just for fun
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zangry_birds.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_excel_writer TYPE REF TO zif_excel_writer,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_border_light TYPE REF TO zcl_excel_style_border,
|
|
||||||
lo_style_color0 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color1 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color2 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color3 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color4 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color5 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color6 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_color7 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_credit TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_link TYPE REF TO zcl_excel_style,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink.
|
|
||||||
|
|
||||||
DATA: lv_style_color0_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color1_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color2_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color3_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color4_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color5_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color6_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_color7_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_credit_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_link_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: lv_col_str TYPE zexcel_cell_column_alpha,
|
|
||||||
lv_row TYPE i,
|
|
||||||
lv_col TYPE i,
|
|
||||||
lt_mapper TYPE TABLE OF zexcel_cell_style,
|
|
||||||
ls_mapper TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS: lv_default_file_name TYPE string VALUE 'angry_birds.xlsx'.
|
|
||||||
|
|
||||||
PARAMETERS: p_path TYPE zexcel_export_dir.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
|
|
||||||
lv_workdir = p_path.
|
|
||||||
cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir
|
|
||||||
CHANGING selected_folder = lv_workdir ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
p_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
|
|
||||||
CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_border_light.
|
|
||||||
lo_border_light->border_color-rgb = zcl_excel_style_color=>c_white.
|
|
||||||
lo_border_light->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
|
|
||||||
" Create color white
|
|
||||||
lo_style_color0 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color0->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color0->fill->fgcolor-rgb = 'FFFFFFFF'.
|
|
||||||
lo_style_color0->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color0_guid = lo_style_color0->get_guid( ).
|
|
||||||
|
|
||||||
" Create color black
|
|
||||||
lo_style_color1 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color1->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color1->fill->fgcolor-rgb = 'FF252525'.
|
|
||||||
lo_style_color1->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color1_guid = lo_style_color1->get_guid( ).
|
|
||||||
|
|
||||||
" Create color dark green
|
|
||||||
lo_style_color2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color2->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color2->fill->fgcolor-rgb = 'FF75913A'.
|
|
||||||
lo_style_color2->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color2_guid = lo_style_color2->get_guid( ).
|
|
||||||
|
|
||||||
" Create color light green
|
|
||||||
lo_style_color3 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color3->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color3->fill->fgcolor-rgb = 'FF9DFB73'.
|
|
||||||
lo_style_color3->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color3_guid = lo_style_color3->get_guid( ).
|
|
||||||
|
|
||||||
" Create color green
|
|
||||||
lo_style_color4 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color4->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color4->fill->fgcolor-rgb = 'FF92CF56'.
|
|
||||||
lo_style_color4->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color4_guid = lo_style_color4->get_guid( ).
|
|
||||||
|
|
||||||
" Create color 2dark green
|
|
||||||
lo_style_color5 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color5->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color5->fill->fgcolor-rgb = 'FF506228'.
|
|
||||||
lo_style_color5->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color5_guid = lo_style_color5->get_guid( ).
|
|
||||||
|
|
||||||
" Create color yellow
|
|
||||||
lo_style_color6 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color6->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color6->fill->fgcolor-rgb = 'FFC3E224'.
|
|
||||||
lo_style_color6->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color6_guid = lo_style_color6->get_guid( ).
|
|
||||||
|
|
||||||
" Create color yellow
|
|
||||||
lo_style_color7 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_color7->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_color7->fill->fgcolor-rgb = 'FFB3C14F'.
|
|
||||||
lo_style_color7->borders->allborders = lo_border_light.
|
|
||||||
lv_style_color7_guid = lo_style_color7->get_guid( ).
|
|
||||||
|
|
||||||
" Credits
|
|
||||||
lo_style_credit = lo_excel->add_new_style( ).
|
|
||||||
lo_style_credit->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_credit->alignment->vertical = zcl_excel_style_alignment=>c_vertical_center.
|
|
||||||
lo_style_credit->font->size = 20.
|
|
||||||
lv_style_credit_guid = lo_style_credit->get_guid( ).
|
|
||||||
|
|
||||||
" Link
|
|
||||||
lo_style_link = lo_excel->add_new_style( ).
|
|
||||||
lo_style_link->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_link->alignment->vertical = zcl_excel_style_alignment=>c_vertical_center.
|
|
||||||
lv_style_link_guid = lo_style_link->get_guid( ).
|
|
||||||
|
|
||||||
" Create image map " line 2
|
|
||||||
DO 30 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 3
|
|
||||||
DO 28 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 4
|
|
||||||
DO 27 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 5
|
|
||||||
DO 9 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 15 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 6
|
|
||||||
DO 7 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 13 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 7
|
|
||||||
DO 6 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 11 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 8
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 9
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 10
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 11
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 7 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 12
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 13
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 14
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 12 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 15
|
|
||||||
DO 6 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 16
|
|
||||||
DO 7 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 7 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 17
|
|
||||||
DO 8 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 13 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 18
|
|
||||||
DO 6 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 23 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 19
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 27 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 20
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 23 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 21
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 19 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 22
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 17 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 23
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 17 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 24
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 10 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 25
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 26
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color6_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 27
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color6_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 28
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color6_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 29
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 30
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 31
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color4_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 32
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color5_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 33
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 34
|
|
||||||
DO 3 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 10 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 35
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 11 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 36
|
|
||||||
DO 4 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 10 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 11 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 37
|
|
||||||
DO 5 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 10 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color7_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 11 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 38
|
|
||||||
DO 6 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 10 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 11 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 39
|
|
||||||
DO 7 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 22 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 1 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 40
|
|
||||||
DO 7 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 17 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 41
|
|
||||||
DO 8 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 3 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 15 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 42
|
|
||||||
DO 9 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 9 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 2 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 43
|
|
||||||
DO 11 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 5 TIMES. APPEND lv_style_color3_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 7 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 44
|
|
||||||
DO 13 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 6 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 4 TIMES. APPEND lv_style_color2_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 45
|
|
||||||
DO 16 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 13 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
" line 46
|
|
||||||
DO 18 TIMES. APPEND lv_style_color0_guid TO lt_mapper. ENDDO.
|
|
||||||
DO 8 TIMES. APPEND lv_style_color1_guid TO lt_mapper. ENDDO.
|
|
||||||
APPEND INITIAL LINE TO lt_mapper. " escape
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Angry Birds' ).
|
|
||||||
|
|
||||||
lv_row = 1.
|
|
||||||
lv_col = 1.
|
|
||||||
|
|
||||||
LOOP AT lt_mapper INTO ls_mapper.
|
|
||||||
lv_col_str = zcl_excel_common=>convert_column2alpha( lv_col ).
|
|
||||||
IF ls_mapper IS INITIAL.
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = lv_row ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 8 ).
|
|
||||||
lv_col = 1.
|
|
||||||
lv_row = lv_row + 1.
|
|
||||||
CONTINUE.
|
|
||||||
ENDIF.
|
|
||||||
lo_worksheet->set_cell( ip_column = lv_col_str
|
|
||||||
ip_row = lv_row
|
|
||||||
ip_value = space
|
|
||||||
ip_style = ls_mapper ).
|
|
||||||
lv_col = lv_col + 1.
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = lv_col_str ).
|
|
||||||
lo_column->set_width( ip_width = 2 ).
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
lo_worksheet->set_show_gridlines( i_show_gridlines = abap_false ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 'AP'
|
|
||||||
ip_row = 15
|
|
||||||
ip_value = 'Created with abap2xlsx'
|
|
||||||
ip_style = lv_style_credit_guid ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_external_link( iv_url = 'https://abap2xlsx.github.io/abap2xlsx' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'AP'
|
|
||||||
ip_row = 24
|
|
||||||
ip_value = 'https://abap2xlsx.github.io/abap2xlsx'
|
|
||||||
ip_style = lv_style_link_guid
|
|
||||||
ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'AP' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_worksheet->set_merge( ip_row = 15 ip_column_start = 'AP' ip_row_to = 22 ip_column_end = 'AR' ).
|
|
||||||
lo_worksheet->set_merge( ip_row = 24 ip_column_start = 'AP' ip_row_to = 26 ip_column_end = 'AR' ).
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
|
|
||||||
lv_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = lv_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = lv_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file_tab.
|
|
||||||
|
|
||||||
" Save the file
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
|
|
||||||
filename = lv_full_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file_tab ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZANGRY_BIRDS</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Styles</ENTRY>
|
|
||||||
<LENGTH>25</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,380 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_CALENDAR
|
|
||||||
*& abap2xlsx Demo: Create Calendar with Pictures
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& This report creates a monthly calendar in the specified date range.
|
|
||||||
*& Each month is put on a seperate worksheet. The pictures for each
|
|
||||||
*& month can be specified in a tab delimited UTF-8 encoded file called
|
|
||||||
*& "Calendar.txt" which is saved in the Export Directory.
|
|
||||||
*& By default this is the SAP Workdir. The file contains 3 fields:
|
|
||||||
*&
|
|
||||||
*& Month (with leading 0)
|
|
||||||
*& Image Filename
|
|
||||||
*& Image Description
|
|
||||||
*& URL for the Description
|
|
||||||
*& Photographer
|
|
||||||
*&
|
|
||||||
*& The Images should be landscape JPEG's with a 3:2 ratio and min.
|
|
||||||
*& 450 pixel height. They must also be saved in the Export Directory.
|
|
||||||
*& In my tests I've discovered a limit of 20 MB in the
|
|
||||||
*& cl_gui_frontend_services=>gui_download method. So keep your images
|
|
||||||
*& smaller or change to a server export using OPEN DATASET.
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_calendar.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE 'Calendar.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
INCLUDE zdemo_calendar_classes.
|
|
||||||
|
|
||||||
DATA: lv_workdir TYPE string.
|
|
||||||
|
|
||||||
PARAMETERS: p_from TYPE dfrom,
|
|
||||||
p_to TYPE dto.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK orientation WITH FRAME TITLE orient.
|
|
||||||
PARAMETERS: p_portr TYPE flag RADIOBUTTON GROUP orie,
|
|
||||||
p_lands TYPE flag RADIOBUTTON GROUP orie DEFAULT 'X'.
|
|
||||||
SELECTION-SCREEN END OF BLOCK orientation.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
orient = 'Orientation'(000).
|
|
||||||
p_from = |{ sy-datum(4) }0101|.
|
|
||||||
p_to = |{ sy-datum(4) }1231|.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
|
||||||
lo_drawing TYPE REF TO zcl_excel_drawing.
|
|
||||||
|
|
||||||
DATA: lo_style_month TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_month_guid TYPE zexcel_cell_style.
|
|
||||||
DATA: lo_style_border TYPE REF TO zcl_excel_style,
|
|
||||||
lo_border_dark TYPE REF TO zcl_excel_style_border,
|
|
||||||
lv_style_border_guid TYPE zexcel_cell_style.
|
|
||||||
DATA: lo_style_center TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_center_guid TYPE zexcel_cell_style.
|
|
||||||
DATA: lo_style_right TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_right_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
image_descr_path TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
DATA: lv_content TYPE xstring,
|
|
||||||
width TYPE i,
|
|
||||||
lv_height TYPE i,
|
|
||||||
lv_from_row TYPE zexcel_cell_row.
|
|
||||||
|
|
||||||
DATA: month TYPE i,
|
|
||||||
month_nr TYPE fcmnr,
|
|
||||||
count TYPE i VALUE 1,
|
|
||||||
title TYPE zexcel_sheet_title,
|
|
||||||
value TYPE string,
|
|
||||||
image_path TYPE string,
|
|
||||||
date_from TYPE datum,
|
|
||||||
date_to TYPE datum,
|
|
||||||
row TYPE zexcel_cell_row,
|
|
||||||
to_row TYPE zexcel_cell_row,
|
|
||||||
to_col TYPE zexcel_cell_column_alpha,
|
|
||||||
to_col_end TYPE zexcel_cell_column_alpha,
|
|
||||||
to_col_int TYPE i.
|
|
||||||
|
|
||||||
DATA: month_names TYPE TABLE OF t247.
|
|
||||||
FIELD-SYMBOLS: <month_name> LIKE LINE OF month_names.
|
|
||||||
|
|
||||||
TYPES: BEGIN OF tt_datatab,
|
|
||||||
month_nr TYPE fcmnr,
|
|
||||||
filename TYPE string,
|
|
||||||
descr TYPE string,
|
|
||||||
url TYPE string,
|
|
||||||
photographer TYPE string,
|
|
||||||
END OF tt_datatab.
|
|
||||||
|
|
||||||
DATA: image_descriptions TYPE TABLE OF tt_datatab.
|
|
||||||
FIELD-SYMBOLS: <img_descr> LIKE LINE OF image_descriptions.
|
|
||||||
|
|
||||||
CONSTANTS: lv_default_file_name TYPE string VALUE 'Calendar', "#EC NOTEXT
|
|
||||||
c_from_row_portrait TYPE zexcel_cell_row VALUE 28,
|
|
||||||
c_from_row_landscape TYPE zexcel_cell_row VALUE 38,
|
|
||||||
from_col TYPE zexcel_cell_column_alpha VALUE 'C',
|
|
||||||
c_height_portrait TYPE i VALUE 450, " Image Height in Portrait Mode
|
|
||||||
c_height_landscape TYPE i VALUE 670, " Image Height in Landscape Mode
|
|
||||||
c_factor TYPE f VALUE '1.5'. " Image Ratio, default 3:2
|
|
||||||
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
p_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
|
|
||||||
CONCATENATE p_path lv_file_separator lv_default_file_name '.xlsx' INTO lv_full_path. "#EC NOTEXT
|
|
||||||
|
|
||||||
" Read Image Names for Month and Description
|
|
||||||
CONCATENATE p_path lv_file_separator lv_default_file_name '.txt' INTO image_descr_path. "#EC NOTEXT
|
|
||||||
cl_gui_frontend_services=>gui_upload(
|
|
||||||
EXPORTING
|
|
||||||
filename = image_descr_path " Name of file
|
|
||||||
filetype = 'ASC' " File Type (ASCII, Binary)
|
|
||||||
has_field_separator = 'X'
|
|
||||||
read_by_line = 'X' " File Written Line-By-Line to the Internal Table
|
|
||||||
codepage = '4110'
|
|
||||||
CHANGING
|
|
||||||
data_tab = image_descriptions " Transfer table for file contents
|
|
||||||
EXCEPTIONS
|
|
||||||
file_open_error = 1
|
|
||||||
file_read_error = 2
|
|
||||||
no_batch = 3
|
|
||||||
gui_refuse_filetransfer = 4
|
|
||||||
invalid_type = 5
|
|
||||||
no_authority = 6
|
|
||||||
unknown_error = 7
|
|
||||||
bad_data_format = 8
|
|
||||||
header_not_allowed = 9
|
|
||||||
separator_not_allowed = 10
|
|
||||||
header_too_long = 11
|
|
||||||
unknown_dp_error = 12
|
|
||||||
access_denied = 13
|
|
||||||
dp_out_of_memory = 14
|
|
||||||
disk_full = 15
|
|
||||||
dp_timeout = 16
|
|
||||||
not_supported_by_gui = 17
|
|
||||||
error_no_gui = 18
|
|
||||||
OTHERS = 19
|
|
||||||
).
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Create Styles
|
|
||||||
" Create an underline double style
|
|
||||||
lo_style_month = lo_excel->add_new_style( ).
|
|
||||||
lo_style_month->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right.
|
|
||||||
lo_style_month->font->bold = abap_true.
|
|
||||||
lo_style_month->font->size = 36.
|
|
||||||
lv_style_month_guid = lo_style_month->get_guid( ).
|
|
||||||
" Create border object
|
|
||||||
CREATE OBJECT lo_border_dark.
|
|
||||||
lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black.
|
|
||||||
lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
"Create style with border
|
|
||||||
lo_style_border = lo_excel->add_new_style( ).
|
|
||||||
lo_style_border->borders->allborders = lo_border_dark.
|
|
||||||
lo_style_border->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right.
|
|
||||||
lo_style_border->alignment->vertical = zcl_excel_style_alignment=>c_vertical_top.
|
|
||||||
lv_style_border_guid = lo_style_border->get_guid( ).
|
|
||||||
"Create style alignment center
|
|
||||||
lo_style_center = lo_excel->add_new_style( ).
|
|
||||||
lo_style_center->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_center->alignment->vertical = zcl_excel_style_alignment=>c_vertical_top.
|
|
||||||
lv_style_center_guid = lo_style_center->get_guid( ).
|
|
||||||
"Create style alignment right
|
|
||||||
lo_style_right = lo_excel->add_new_style( ).
|
|
||||||
lo_style_right->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right.
|
|
||||||
lv_style_right_guid = lo_style_right->get_guid( ).
|
|
||||||
|
|
||||||
" Get Month Names
|
|
||||||
CALL FUNCTION 'MONTH_NAMES_GET'
|
|
||||||
TABLES
|
|
||||||
month_names = month_names.
|
|
||||||
|
|
||||||
zcl_date_calculation=>months_between_two_dates(
|
|
||||||
EXPORTING
|
|
||||||
i_date_from = p_from
|
|
||||||
i_date_to = p_to
|
|
||||||
i_incl_to = abap_true
|
|
||||||
IMPORTING
|
|
||||||
e_month = month
|
|
||||||
).
|
|
||||||
|
|
||||||
date_from = p_from.
|
|
||||||
|
|
||||||
WHILE count <= month.
|
|
||||||
IF count = 1.
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
ELSE.
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
|
||||||
|
|
||||||
title = count.
|
|
||||||
value = count.
|
|
||||||
CONDENSE title.
|
|
||||||
CONDENSE value.
|
|
||||||
lo_worksheet->set_title( title ).
|
|
||||||
lo_worksheet->set_print_gridlines( abap_false ).
|
|
||||||
lo_worksheet->sheet_setup->paper_size = zcl_excel_sheet_setup=>c_papersize_a4.
|
|
||||||
lo_worksheet->sheet_setup->horizontal_centered = abap_true.
|
|
||||||
lo_worksheet->sheet_setup->vertical_centered = abap_true.
|
|
||||||
lo_column = lo_worksheet->get_column( 'A' ).
|
|
||||||
lo_column->set_width( '1.0' ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'B' ).
|
|
||||||
lo_column->set_width( '2.0' ).
|
|
||||||
IF p_lands = abap_true.
|
|
||||||
lo_worksheet->sheet_setup->orientation = zcl_excel_sheet_setup=>c_orientation_landscape.
|
|
||||||
lv_height = c_height_landscape.
|
|
||||||
lv_from_row = c_from_row_landscape.
|
|
||||||
lo_worksheet->sheet_setup->margin_top = '0.10'.
|
|
||||||
lo_worksheet->sheet_setup->margin_left = '0.10'.
|
|
||||||
lo_worksheet->sheet_setup->margin_right = '0.10'.
|
|
||||||
lo_worksheet->sheet_setup->margin_bottom = '0.10'.
|
|
||||||
ELSE.
|
|
||||||
lo_column = lo_worksheet->get_column( 'K' ).
|
|
||||||
lo_column->set_width( '3.0' ).
|
|
||||||
lo_worksheet->sheet_setup->margin_top = '0.80'.
|
|
||||||
lo_worksheet->sheet_setup->margin_left = '0.55'.
|
|
||||||
lo_worksheet->sheet_setup->margin_right = '0.05'.
|
|
||||||
lo_worksheet->sheet_setup->margin_bottom = '0.30'.
|
|
||||||
lv_height = c_height_portrait.
|
|
||||||
lv_from_row = c_from_row_portrait.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
" Add Month Name
|
|
||||||
month_nr = date_from+4(2).
|
|
||||||
IF p_portr = abap_true.
|
|
||||||
READ TABLE month_names WITH KEY mnr = month_nr ASSIGNING <month_name>.
|
|
||||||
CONCATENATE <month_name>-ltx ` ` date_from(4) INTO value.
|
|
||||||
row = lv_from_row - 2.
|
|
||||||
to_col = from_col.
|
|
||||||
ELSE.
|
|
||||||
row = lv_from_row - 1.
|
|
||||||
to_col_int = zcl_excel_common=>convert_column2int( from_col ) + 32.
|
|
||||||
to_col = zcl_excel_common=>convert_column2alpha( to_col_int ).
|
|
||||||
to_col_int = to_col_int + 1.
|
|
||||||
to_col_end = zcl_excel_common=>convert_column2alpha( to_col_int ).
|
|
||||||
CONCATENATE month_nr '/' date_from+2(2) INTO value.
|
|
||||||
to_row = row + 2.
|
|
||||||
lo_worksheet->set_merge(
|
|
||||||
EXPORTING
|
|
||||||
ip_column_start = to_col " Cell Column Start
|
|
||||||
ip_column_end = to_col_end " Cell Column End
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_row_to = to_row " Cell Row
|
|
||||||
).
|
|
||||||
ENDIF.
|
|
||||||
lo_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = to_col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = lv_style_month_guid
|
|
||||||
).
|
|
||||||
|
|
||||||
" Add drawing from a XSTRING read from a file
|
|
||||||
UNASSIGN <img_descr>.
|
|
||||||
READ TABLE image_descriptions WITH KEY month_nr = month_nr ASSIGNING <img_descr>.
|
|
||||||
IF <img_descr> IS ASSIGNED.
|
|
||||||
value = <img_descr>-descr.
|
|
||||||
IF p_portr = abap_true.
|
|
||||||
row = lv_from_row - 3.
|
|
||||||
ELSE.
|
|
||||||
row = lv_from_row - 2.
|
|
||||||
ENDIF.
|
|
||||||
IF NOT <img_descr>-url IS INITIAL.
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_external_link( <img_descr>-url ).
|
|
||||||
lo_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = from_col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_hyperlink = lo_hyperlink
|
|
||||||
).
|
|
||||||
ELSE.
|
|
||||||
lo_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = from_col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
).
|
|
||||||
ENDIF.
|
|
||||||
lo_row = lo_worksheet->get_row( row ).
|
|
||||||
lo_row->set_row_height( '22.0' ).
|
|
||||||
" Photographer
|
|
||||||
IF NOT <img_descr>-photographer IS INITIAL.
|
|
||||||
value = <img_descr>-photographer.
|
|
||||||
lo_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = to_col_end " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = lv_style_right_guid
|
|
||||||
).
|
|
||||||
ENDIF.
|
|
||||||
" In Landscape mode the row between the description and the
|
|
||||||
" dates should be not so high
|
|
||||||
IF p_lands = abap_true.
|
|
||||||
row = lv_from_row - 3.
|
|
||||||
lo_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = from_col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = ' ' " Cell Value
|
|
||||||
).
|
|
||||||
lo_row = lo_worksheet->get_row( row ).
|
|
||||||
lo_row->set_row_height( '7.0' ).
|
|
||||||
row = lv_from_row - 1.
|
|
||||||
lo_row = lo_worksheet->get_row( row ).
|
|
||||||
lo_row->set_row_height( '5.0' ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
CONCATENATE p_path lv_file_separator <img_descr>-filename INTO image_path.
|
|
||||||
lo_drawing = lo_excel->add_new_drawing( ).
|
|
||||||
lo_drawing->set_position( ip_from_row = 1
|
|
||||||
ip_from_col = 'B' ).
|
|
||||||
|
|
||||||
lv_content = zcl_helper=>load_image( image_path ).
|
|
||||||
width = lv_height * c_factor.
|
|
||||||
lo_drawing->set_media( ip_media = lv_content
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_jpg
|
|
||||||
ip_width = width
|
|
||||||
ip_height = lv_height ).
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
" Add Calendar
|
|
||||||
date_to = date_from.
|
|
||||||
date_to+6(2) = '01'. " First of month
|
|
||||||
ADD 31 TO date_to. " Somewhere in following month
|
|
||||||
date_to = date_to - date_to+6(2). " Last of month
|
|
||||||
IF p_portr = abap_true.
|
|
||||||
zcl_helper=>add_calendar(
|
|
||||||
EXPORTING
|
|
||||||
i_date_from = date_from
|
|
||||||
i_date_to = date_to
|
|
||||||
i_from_row = lv_from_row
|
|
||||||
i_from_col = from_col
|
|
||||||
i_day_style = lv_style_border_guid
|
|
||||||
i_cw_style = lv_style_center_guid
|
|
||||||
CHANGING
|
|
||||||
c_worksheet = lo_worksheet
|
|
||||||
).
|
|
||||||
ELSE.
|
|
||||||
zcl_helper=>add_calendar_landscape(
|
|
||||||
EXPORTING
|
|
||||||
i_date_from = date_from
|
|
||||||
i_date_to = date_to
|
|
||||||
i_from_row = lv_from_row
|
|
||||||
i_from_col = from_col
|
|
||||||
i_day_style = lv_style_border_guid
|
|
||||||
i_cw_style = lv_style_center_guid
|
|
||||||
CHANGING
|
|
||||||
c_worksheet = lo_worksheet
|
|
||||||
).
|
|
||||||
ENDIF.
|
|
||||||
count = count + 1.
|
|
||||||
date_from = date_to + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
|
|
||||||
lo_excel->set_active_sheet_index_by_name( '1' ).
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,130 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_CALENDAR</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>000</KEY>
|
|
||||||
<ENTRY>Orientation</ENTRY>
|
|
||||||
<LENGTH>21</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>001</KEY>
|
|
||||||
<ENTRY>CW</ENTRY>
|
|
||||||
<LENGTH>12</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>002</KEY>
|
|
||||||
<ENTRY>Created with https://github.com/abap2xlsx/abap2xlsx</ENTRY>
|
|
||||||
<LENGTH>132</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Create Calendar with Pictures</ENTRY>
|
|
||||||
<LENGTH>45</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_FROM</KEY>
|
|
||||||
<ENTRY>From</ENTRY>
|
|
||||||
<LENGTH>12</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_LANDS</KEY>
|
|
||||||
<ENTRY>Landscape</ENTRY>
|
|
||||||
<LENGTH>17</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>Path</ENTRY>
|
|
||||||
<LENGTH>12</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PORTR</KEY>
|
|
||||||
<ENTRY>Portrait</ENTRY>
|
|
||||||
<LENGTH>16</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_TO</KEY>
|
|
||||||
<ENTRY>To</ENTRY>
|
|
||||||
<LENGTH>10</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
<I18N_TPOOL>
|
|
||||||
<item>
|
|
||||||
<LANGUAGE>D</LANGUAGE>
|
|
||||||
<TEXTPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>000</KEY>
|
|
||||||
<ENTRY>Ausrichtung</ENTRY>
|
|
||||||
<LENGTH>21</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>001</KEY>
|
|
||||||
<ENTRY>KW</ENTRY>
|
|
||||||
<LENGTH>12</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>002</KEY>
|
|
||||||
<ENTRY>Erzeugt mit https://github.com/abap2xlsx/abap2xlsx</ENTRY>
|
|
||||||
<LENGTH>132</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Erzeugen eines Kalenders mit Bildern</ENTRY>
|
|
||||||
<LENGTH>70</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_FROM</KEY>
|
|
||||||
<ENTRY>Von</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_LANDS</KEY>
|
|
||||||
<ENTRY>Querformat</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>Pfad</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PORTR</KEY>
|
|
||||||
<ENTRY>Hochformat</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_TO</KEY>
|
|
||||||
<ENTRY>Bis</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TEXTPOOL>
|
|
||||||
</item>
|
|
||||||
</I18N_TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,476 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Include ZDEMO_CALENDAR_CLASSES
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Class ZCL_DATE_CALCULATION
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
* Text
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS zcl_date_calculation DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
CLASS-METHODS: months_between_two_dates
|
|
||||||
IMPORTING
|
|
||||||
i_date_from TYPE datum
|
|
||||||
i_date_to TYPE datum
|
|
||||||
i_incl_to TYPE flag
|
|
||||||
EXPORTING
|
|
||||||
e_month TYPE i.
|
|
||||||
ENDCLASS. "ZCL_DATE_CALCULATION
|
|
||||||
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS ZCL_DATE_CALCULATION IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS zcl_date_calculation IMPLEMENTATION.
|
|
||||||
METHOD months_between_two_dates.
|
|
||||||
DATA: date_to TYPE datum.
|
|
||||||
DATA: BEGIN OF datum_von,
|
|
||||||
jjjj(4) TYPE n,
|
|
||||||
mm(2) TYPE n,
|
|
||||||
tt(2) TYPE n,
|
|
||||||
END OF datum_von.
|
|
||||||
|
|
||||||
DATA: BEGIN OF datum_bis,
|
|
||||||
jjjj(4) TYPE n,
|
|
||||||
mm(2) TYPE n,
|
|
||||||
tt(2) TYPE n,
|
|
||||||
END OF datum_bis.
|
|
||||||
|
|
||||||
e_month = 0.
|
|
||||||
|
|
||||||
CHECK i_date_from IS NOT INITIAL AND i_date_to IS NOT INITIAL.
|
|
||||||
|
|
||||||
date_to = i_date_to.
|
|
||||||
IF i_incl_to = abap_true.
|
|
||||||
date_to = date_to + 1.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
datum_von = i_date_from.
|
|
||||||
datum_bis = date_to.
|
|
||||||
|
|
||||||
e_month = ( datum_bis-jjjj - datum_von-jjjj ) * 12
|
|
||||||
+ ( datum_bis-mm - datum_von-mm ).
|
|
||||||
ENDMETHOD. "MONTHS_BETWEEN_TWO_DATES
|
|
||||||
ENDCLASS. "ZCL_DATE_CALCULATION IMPLEMENTATION
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS zcl_date_calculation_test DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS zcl_date_calculation_test DEFINITION FOR TESTING
|
|
||||||
DURATION SHORT
|
|
||||||
RISK LEVEL HARMLESS
|
|
||||||
.
|
|
||||||
PRIVATE SECTION.
|
|
||||||
METHODS:
|
|
||||||
months_between_two_dates FOR TESTING.
|
|
||||||
ENDCLASS. "zcl_date_calculation_test DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS zcl_date_calculation_test IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS zcl_date_calculation_test IMPLEMENTATION.
|
|
||||||
METHOD months_between_two_dates.
|
|
||||||
|
|
||||||
DATA: date_from TYPE datum VALUE '20120101',
|
|
||||||
date_to TYPE datum VALUE '20121231'.
|
|
||||||
DATA: month TYPE i.
|
|
||||||
|
|
||||||
zcl_date_calculation=>months_between_two_dates(
|
|
||||||
EXPORTING
|
|
||||||
i_date_from = date_from
|
|
||||||
i_date_to = date_to
|
|
||||||
i_incl_to = abap_true
|
|
||||||
IMPORTING
|
|
||||||
e_month = month
|
|
||||||
).
|
|
||||||
|
|
||||||
cl_abap_unit_assert=>assert_equals(
|
|
||||||
exp = 12 " Data Object with Expected Type
|
|
||||||
act = month " Data Object with Current Value
|
|
||||||
msg = 'Calculated date is wrong' " Message in Case of Error
|
|
||||||
).
|
|
||||||
|
|
||||||
ENDMETHOD. "months_between_two_dates
|
|
||||||
ENDCLASS. "zcl_date_calculation_test IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS zcl_helper DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS zcl_helper DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
CLASS-METHODS:
|
|
||||||
load_image
|
|
||||||
IMPORTING
|
|
||||||
filename TYPE string
|
|
||||||
RETURNING VALUE(r_image) TYPE xstring,
|
|
||||||
add_calendar
|
|
||||||
IMPORTING
|
|
||||||
i_date_from TYPE datum
|
|
||||||
i_date_to TYPE datum
|
|
||||||
i_from_row TYPE zexcel_cell_row
|
|
||||||
i_from_col TYPE zexcel_cell_column_alpha
|
|
||||||
i_day_style TYPE zexcel_cell_style
|
|
||||||
i_cw_style TYPE zexcel_cell_style
|
|
||||||
CHANGING
|
|
||||||
c_worksheet TYPE REF TO zcl_excel_worksheet
|
|
||||||
RAISING
|
|
||||||
zcx_excel,
|
|
||||||
add_calendar_landscape
|
|
||||||
IMPORTING
|
|
||||||
i_date_from TYPE datum
|
|
||||||
i_date_to TYPE datum
|
|
||||||
i_from_row TYPE zexcel_cell_row
|
|
||||||
i_from_col TYPE zexcel_cell_column_alpha
|
|
||||||
i_day_style TYPE zexcel_cell_style
|
|
||||||
i_cw_style TYPE zexcel_cell_style
|
|
||||||
CHANGING
|
|
||||||
c_worksheet TYPE REF TO zcl_excel_worksheet
|
|
||||||
RAISING
|
|
||||||
zcx_excel,
|
|
||||||
add_a2x_footer
|
|
||||||
IMPORTING
|
|
||||||
i_from_row TYPE zexcel_cell_row
|
|
||||||
i_from_col TYPE zexcel_cell_column_alpha
|
|
||||||
CHANGING
|
|
||||||
c_worksheet TYPE REF TO zcl_excel_worksheet
|
|
||||||
RAISING
|
|
||||||
zcx_excel,
|
|
||||||
add_calender_week
|
|
||||||
IMPORTING
|
|
||||||
i_date TYPE datum
|
|
||||||
i_row TYPE zexcel_cell_row
|
|
||||||
i_col TYPE zexcel_cell_column_alpha
|
|
||||||
i_style TYPE zexcel_cell_style
|
|
||||||
CHANGING
|
|
||||||
c_worksheet TYPE REF TO zcl_excel_worksheet
|
|
||||||
RAISING
|
|
||||||
zcx_excel.
|
|
||||||
ENDCLASS. "zcl_helper DEFINITION
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS zcl_helper IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS zcl_helper IMPLEMENTATION.
|
|
||||||
METHOD load_image.
|
|
||||||
"Load samle image
|
|
||||||
DATA: lt_bin TYPE solix_tab,
|
|
||||||
lv_len TYPE i.
|
|
||||||
|
|
||||||
CALL METHOD cl_gui_frontend_services=>gui_upload
|
|
||||||
EXPORTING
|
|
||||||
filename = filename
|
|
||||||
filetype = 'BIN'
|
|
||||||
IMPORTING
|
|
||||||
filelength = lv_len
|
|
||||||
CHANGING
|
|
||||||
data_tab = lt_bin
|
|
||||||
EXCEPTIONS
|
|
||||||
file_open_error = 1
|
|
||||||
file_read_error = 2
|
|
||||||
no_batch = 3
|
|
||||||
gui_refuse_filetransfer = 4
|
|
||||||
invalid_type = 5
|
|
||||||
no_authority = 6
|
|
||||||
unknown_error = 7
|
|
||||||
bad_data_format = 8
|
|
||||||
header_not_allowed = 9
|
|
||||||
separator_not_allowed = 10
|
|
||||||
header_too_long = 11
|
|
||||||
unknown_dp_error = 12
|
|
||||||
access_denied = 13
|
|
||||||
dp_out_of_memory = 14
|
|
||||||
disk_full = 15
|
|
||||||
dp_timeout = 16
|
|
||||||
not_supported_by_gui = 17
|
|
||||||
error_no_gui = 18
|
|
||||||
OTHERS = 19.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
|
|
||||||
EXPORTING
|
|
||||||
input_length = lv_len
|
|
||||||
IMPORTING
|
|
||||||
buffer = r_image
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_bin
|
|
||||||
EXCEPTIONS
|
|
||||||
failed = 1
|
|
||||||
OTHERS = 2.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
ENDMETHOD. "load_image
|
|
||||||
METHOD add_calendar.
|
|
||||||
DATA: day_names TYPE TABLE OF t246.
|
|
||||||
DATA: row TYPE zexcel_cell_row,
|
|
||||||
row_max TYPE i,
|
|
||||||
col_int TYPE zexcel_cell_column,
|
|
||||||
col_max TYPE i,
|
|
||||||
from_col_int TYPE zexcel_cell_column,
|
|
||||||
col TYPE zexcel_cell_column_alpha,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row.
|
|
||||||
DATA: lv_date TYPE datum,
|
|
||||||
value TYPE string,
|
|
||||||
weekday TYPE wotnr,
|
|
||||||
weekrow TYPE wotnr VALUE 1,
|
|
||||||
day TYPE i,
|
|
||||||
width TYPE f,
|
|
||||||
height TYPE f.
|
|
||||||
DATA: hyperlink TYPE REF TO zcl_excel_hyperlink.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <day_name> LIKE LINE OF day_names.
|
|
||||||
|
|
||||||
lv_date = i_date_from.
|
|
||||||
from_col_int = zcl_excel_common=>convert_column2int( i_from_col ).
|
|
||||||
" Add description for Calendar Week
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = i_from_col " Cell Column
|
|
||||||
ip_row = i_from_row " Cell Row
|
|
||||||
ip_value = 'CW'(001) " Cell Value
|
|
||||||
ip_style = i_cw_style
|
|
||||||
).
|
|
||||||
|
|
||||||
" Add Days
|
|
||||||
CALL FUNCTION 'DAY_NAMES_GET'
|
|
||||||
TABLES
|
|
||||||
day_names = day_names.
|
|
||||||
|
|
||||||
LOOP AT day_names ASSIGNING <day_name>.
|
|
||||||
row = i_from_row.
|
|
||||||
col_int = from_col_int + <day_name>-wotnr.
|
|
||||||
col = zcl_excel_common=>convert_column2alpha( col_int ).
|
|
||||||
value = <day_name>-langt.
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = i_cw_style
|
|
||||||
).
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
WHILE lv_date <= i_date_to.
|
|
||||||
day = lv_date+6(2).
|
|
||||||
CALL FUNCTION 'FIMA_X_DAY_IN_MONTH_COMPUTE'
|
|
||||||
EXPORTING
|
|
||||||
i_datum = lv_date
|
|
||||||
IMPORTING
|
|
||||||
e_wochentag_nr = weekday.
|
|
||||||
|
|
||||||
row = i_from_row + weekrow.
|
|
||||||
col_int = from_col_int + weekday.
|
|
||||||
col = zcl_excel_common=>convert_column2alpha( col_int ).
|
|
||||||
|
|
||||||
value = day.
|
|
||||||
CONDENSE value.
|
|
||||||
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = i_day_style " Single-Character Indicator
|
|
||||||
).
|
|
||||||
|
|
||||||
IF weekday = 7.
|
|
||||||
" Add Calender Week
|
|
||||||
zcl_helper=>add_calender_week(
|
|
||||||
EXPORTING
|
|
||||||
i_date = lv_date
|
|
||||||
i_row = row
|
|
||||||
i_col = i_from_col
|
|
||||||
i_style = i_cw_style
|
|
||||||
CHANGING
|
|
||||||
c_worksheet = c_worksheet
|
|
||||||
).
|
|
||||||
weekrow = weekrow + 1.
|
|
||||||
ENDIF.
|
|
||||||
lv_date = lv_date + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
" Add Calender Week
|
|
||||||
zcl_helper=>add_calender_week(
|
|
||||||
EXPORTING
|
|
||||||
i_date = lv_date
|
|
||||||
i_row = row
|
|
||||||
i_col = i_from_col
|
|
||||||
i_style = i_cw_style
|
|
||||||
CHANGING
|
|
||||||
c_worksheet = c_worksheet
|
|
||||||
).
|
|
||||||
" Add Created with abap2xlsx
|
|
||||||
row = row + 2.
|
|
||||||
zcl_helper=>add_a2x_footer(
|
|
||||||
EXPORTING
|
|
||||||
i_from_row = row
|
|
||||||
i_from_col = i_from_col
|
|
||||||
CHANGING
|
|
||||||
c_worksheet = c_worksheet
|
|
||||||
).
|
|
||||||
col_int = from_col_int.
|
|
||||||
col_max = from_col_int + 7.
|
|
||||||
WHILE col_int <= col_max.
|
|
||||||
col = zcl_excel_common=>convert_column2alpha( col_int ).
|
|
||||||
IF sy-index = 1.
|
|
||||||
width = '5.0'.
|
|
||||||
ELSE.
|
|
||||||
width = '11.4'.
|
|
||||||
ENDIF.
|
|
||||||
lo_column = c_worksheet->get_column( col ).
|
|
||||||
lo_column->set_width( width ).
|
|
||||||
col_int = col_int + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
row = i_from_row + 1.
|
|
||||||
row_max = i_from_row + 6.
|
|
||||||
WHILE row <= row_max.
|
|
||||||
height = 50.
|
|
||||||
lo_row = c_worksheet->get_row( row ).
|
|
||||||
lo_row->set_row_height( height ).
|
|
||||||
row = row + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
ENDMETHOD. "add_calendar
|
|
||||||
METHOD add_a2x_footer.
|
|
||||||
DATA: value TYPE string,
|
|
||||||
hyperlink TYPE REF TO zcl_excel_hyperlink.
|
|
||||||
|
|
||||||
value = 'Created with https://github.com/abap2xlsx/abap2xlsx'(002).
|
|
||||||
hyperlink = zcl_excel_hyperlink=>create_external_link( 'https://github.com/abap2xlsx/abap2xlsx' ). "#EC NOTEXT
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = i_from_col " Cell Column
|
|
||||||
ip_row = i_from_row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_hyperlink = hyperlink
|
|
||||||
).
|
|
||||||
|
|
||||||
ENDMETHOD. "add_a2x_footer
|
|
||||||
METHOD add_calendar_landscape.
|
|
||||||
DATA: day_names TYPE TABLE OF t246.
|
|
||||||
|
|
||||||
DATA: lv_date TYPE datum,
|
|
||||||
day TYPE i,
|
|
||||||
value TYPE string,
|
|
||||||
weekday TYPE wotnr.
|
|
||||||
DATA: row TYPE zexcel_cell_row,
|
|
||||||
from_col_int TYPE zexcel_cell_column,
|
|
||||||
col_int TYPE zexcel_cell_column,
|
|
||||||
col TYPE zexcel_cell_column_alpha.
|
|
||||||
DATA: lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <day_name> LIKE LINE OF day_names.
|
|
||||||
|
|
||||||
lv_date = i_date_from.
|
|
||||||
" Add Days
|
|
||||||
CALL FUNCTION 'DAY_NAMES_GET'
|
|
||||||
TABLES
|
|
||||||
day_names = day_names.
|
|
||||||
|
|
||||||
WHILE lv_date <= i_date_to.
|
|
||||||
day = lv_date+6(2).
|
|
||||||
CALL FUNCTION 'FIMA_X_DAY_IN_MONTH_COMPUTE'
|
|
||||||
EXPORTING
|
|
||||||
i_datum = lv_date
|
|
||||||
IMPORTING
|
|
||||||
e_wochentag_nr = weekday.
|
|
||||||
" Day name row
|
|
||||||
row = i_from_row.
|
|
||||||
col_int = from_col_int + day + 2.
|
|
||||||
col = zcl_excel_common=>convert_column2alpha( col_int ).
|
|
||||||
READ TABLE day_names ASSIGNING <day_name>
|
|
||||||
WITH KEY wotnr = weekday.
|
|
||||||
value = <day_name>-kurzt.
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = i_cw_style
|
|
||||||
).
|
|
||||||
|
|
||||||
" Day row
|
|
||||||
row = i_from_row + 1.
|
|
||||||
value = day.
|
|
||||||
CONDENSE value.
|
|
||||||
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = i_day_style " Single-Character Indicator
|
|
||||||
).
|
|
||||||
" width
|
|
||||||
lo_column = c_worksheet->get_column( col ).
|
|
||||||
lo_column->set_width( '3.6' ).
|
|
||||||
|
|
||||||
|
|
||||||
lv_date = lv_date + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
" Add ABAP2XLSX Footer
|
|
||||||
row = i_from_row + 2.
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = col " Cell Column
|
|
||||||
ip_row = row " Cell Row
|
|
||||||
ip_value = ' ' " Cell Value
|
|
||||||
).
|
|
||||||
lo_row = c_worksheet->get_row( row ).
|
|
||||||
lo_row->set_row_height( '5.0' ).
|
|
||||||
row = i_from_row + 3.
|
|
||||||
zcl_helper=>add_a2x_footer(
|
|
||||||
EXPORTING
|
|
||||||
i_from_row = row
|
|
||||||
i_from_col = i_from_col
|
|
||||||
CHANGING
|
|
||||||
c_worksheet = c_worksheet
|
|
||||||
).
|
|
||||||
|
|
||||||
" Set with for all 31 coulumns
|
|
||||||
WHILE day < 32.
|
|
||||||
day = day + 1.
|
|
||||||
col_int = from_col_int + day + 2.
|
|
||||||
col = zcl_excel_common=>convert_column2alpha( col_int ).
|
|
||||||
" width
|
|
||||||
lo_column = c_worksheet->get_column( col ).
|
|
||||||
lo_column->set_width( '3.6' ).
|
|
||||||
ENDWHILE.
|
|
||||||
ENDMETHOD. "ADD_CALENDAR_LANDSCAPE
|
|
||||||
|
|
||||||
METHOD add_calender_week.
|
|
||||||
DATA: week TYPE kweek,
|
|
||||||
week_int TYPE i,
|
|
||||||
value TYPE string.
|
|
||||||
" Add Calender Week
|
|
||||||
CALL FUNCTION 'DATE_GET_WEEK'
|
|
||||||
EXPORTING
|
|
||||||
date = i_date " Date for which the week should be calculated
|
|
||||||
IMPORTING
|
|
||||||
week = week. " Week for date (format:YYYYWW)
|
|
||||||
value = week+4(2).
|
|
||||||
week_int = value.
|
|
||||||
value = week_int.
|
|
||||||
CONDENSE value.
|
|
||||||
c_worksheet->set_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = i_col " Cell Column
|
|
||||||
ip_row = i_row " Cell Row
|
|
||||||
ip_value = value " Cell Value
|
|
||||||
ip_style = i_style
|
|
||||||
).
|
|
||||||
ENDMETHOD. "add_calender_week
|
|
||||||
ENDCLASS. "zcl_helper IMPLEMENTATION
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_CALENDAR_CLASSES</NAME>
|
|
||||||
<SUBC>I</SUBC>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>Include ZDEMO_CALENDAR_CLASSES</ENTRY>
|
|
||||||
<LENGTH>30</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,91 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel.
|
|
||||||
|
|
||||||
DATA: lv_workdir TYPE string,
|
|
||||||
lv_filesep TYPE c LENGTH 1,
|
|
||||||
lv_upfile TYPE string.
|
|
||||||
|
|
||||||
|
|
||||||
PARAMETERS: p_path TYPE zexcel_export_dir.
|
|
||||||
PARAMETERS: p_checkr NO-DISPLAY TYPE abap_bool.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
|
|
||||||
lv_workdir = p_path.
|
|
||||||
cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir
|
|
||||||
CHANGING selected_folder = lv_workdir ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
p_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_filesep ).
|
|
||||||
CONCATENATE p_path lv_filesep '01_HelloWorld.xlsx' INTO lv_upfile.
|
|
||||||
|
|
||||||
SUBMIT zdemo_excel1 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Hello world
|
|
||||||
SUBMIT zdemo_excel2 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Styles
|
|
||||||
SUBMIT zdemo_excel3 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path WITH p_checkr = p_checkr AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: iTab binding
|
|
||||||
SUBMIT zdemo_excel4 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Multi sheets, page setup and sheet properties
|
|
||||||
SUBMIT zdemo_excel5 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Conditional formatting
|
|
||||||
SUBMIT zdemo_excel6 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Formulas
|
|
||||||
SUBMIT zdemo_excel7 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Conditional formatting
|
|
||||||
SUBMIT zdemo_excel8 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Ranges
|
|
||||||
SUBMIT zdemo_excel9 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Data validation
|
|
||||||
SUBMIT zdemo_excel10 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Bind table with field catalog
|
|
||||||
" zdemo_excel11 is not added because it has a selection screen and
|
|
||||||
" you also need to have business partners maintained in transaction BP
|
|
||||||
SUBMIT zdemo_excel12 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Column size
|
|
||||||
SUBMIT zdemo_excel13 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Merge cell
|
|
||||||
SUBMIT zdemo_excel14 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Alignment
|
|
||||||
" zdemo_excel15 added at the end
|
|
||||||
SUBMIT zdemo_excel16 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Drawing
|
|
||||||
SUBMIT zdemo_excel17 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Lock sheet
|
|
||||||
SUBMIT zdemo_excel18 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Lock workbook
|
|
||||||
SUBMIT zdemo_excel19 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Set active sheet
|
|
||||||
" zdemo_excel20 is not added because it uses ALV and cannot be processed (OLE2)
|
|
||||||
SUBMIT zdemo_excel21 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Color Picker
|
|
||||||
SUBMIT zdemo_excel22 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Bind table with field catalog & sheet style
|
|
||||||
SUBMIT zdemo_excel23 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Multiple sheets with and w/o grid lines, print options
|
|
||||||
SUBMIT zdemo_excel24 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Multiple sheets with different default date formats
|
|
||||||
" zdemo_excel25 is not processed because the default logical path may not exist, and anyway zdemo_excel25 doesn't demonstrate any abap2xlsx feature
|
|
||||||
" zdemo_excel26 is not added because it uses ALV and cannot be processed (Native)
|
|
||||||
SUBMIT zdemo_excel27 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Conditional Formatting
|
|
||||||
SUBMIT zdemo_excel28 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: CSV writer
|
|
||||||
" SUBMIT zdemo_excel29 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Macro enabled workbook
|
|
||||||
SUBMIT zdemo_excel30 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: ABAP Cell data types + leading blanks string
|
|
||||||
SUBMIT zdemo_excel31 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Autosize Column with different Font sizes
|
|
||||||
" zdemo_excel32 is not added because it uses ALV and cannot be processed (Native)
|
|
||||||
SUBMIT zdemo_excel33 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Table autofilter
|
|
||||||
SUBMIT zdemo_excel34 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Static Styles Chess
|
|
||||||
SUBMIT zdemo_excel35 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Static Styles
|
|
||||||
SUBMIT zdemo_excel36 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Style applied to sheet, column and single cell
|
|
||||||
SUBMIT zdemo_excel37 WITH p_upfile = lv_upfile
|
|
||||||
WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Simplest call of the reader and writer - passthrough data
|
|
||||||
SUBMIT zdemo_excel38 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Show off integration of drawings ( here using the SAP-Icons )
|
|
||||||
SUBMIT zdemo_excel39 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Charts
|
|
||||||
SUBMIT zdemo_excel40 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Demo Printsettings
|
|
||||||
SUBMIT zdemo_excel41 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Inheritance
|
|
||||||
SUBMIT zdemo_excel44 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: No line if empty
|
|
||||||
SUBMIT zdemo_excel49 WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Bind Table with field having Conversion Exit
|
|
||||||
|
|
||||||
SUBMIT zdemo_excel_comments WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Comments
|
|
||||||
SUBMIT ztest_excel_image_header WITH rb_down = abap_true WITH rb_show = abap_false WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT abap2xlsx Demo: Image in Header and Footer
|
|
||||||
"
|
|
||||||
" Reader/Writer Demo must always run at the end
|
|
||||||
" to make sure all documents where created
|
|
||||||
"
|
|
||||||
SUBMIT zdemo_excel15 WITH p_path = p_path AND RETURN. "#EC CI_SUBMIT Read Excel and write it back
|
|
|
@ -1,28 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo:</ENTRY>
|
|
||||||
<LENGTH>15</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>Select output path</ENTRY>
|
|
||||||
<LENGTH>26</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,64 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL1
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel1.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lv_date TYPE d,
|
|
||||||
lv_time TYPE t.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '01_HelloWorld.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
|
|
||||||
lv_date = '20211231'.
|
|
||||||
lv_time = '055817'.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = lv_date ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = lv_time ).
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_external_link( iv_url = 'https://abap2xlsx.github.io/abap2xlsx' ).
|
|
||||||
lo_worksheet->set_cell( ip_columnrow = 'B4' ip_value = 'Click here to visit abap2xlsx homepage' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = '你好,世界' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = '(Chinese)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'नमस्ते दुनिया' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 7 ip_value = '(Hindi)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Hola Mundo' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 8 ip_value = '(Spanish)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'مرحبا بالعالم' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 9 ip_value = '(Arabic)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_value = 'ওহে বিশ্ব ' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 10 ip_value = '(Bengali)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 11 ip_value = 'Bonjour le monde' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 11 ip_value = '(French)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 12 ip_value = 'Olá Mundo' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 12 ip_value = '(Portuguese)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 13 ip_value = 'Привет, мир' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 13 ip_value = '(Russian)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 14 ip_value = 'ہیلو دنیا' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 14 ip_value = '(Urdu)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 15 ip_value = '👋🌎, 👋🌍, 👋🌏' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 15 ip_value = '(Emoji waving hand + 3 parts of the world)' ).
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'B' ).
|
|
||||||
lo_column->set_width( ip_width = 11 ).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL1</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>RB_BACK</KEY>
|
|
||||||
<LENGTH>17</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Hello World</ENTRY>
|
|
||||||
<LENGTH>28</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,144 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL10
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel10.
|
|
||||||
|
|
||||||
TYPES: ty_sflight_lines TYPE TABLE OF sflight.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_cond TYPE REF TO zcl_excel_style_cond,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column.
|
|
||||||
|
|
||||||
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog,
|
|
||||||
ls_table_settings TYPE zexcel_s_table_settings,
|
|
||||||
ls_iconset TYPE zexcel_conditional_iconset.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '10_iTabFieldCatalog.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <fs_field_catalog> TYPE zexcel_s_fieldcatalog.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Internal table' ).
|
|
||||||
|
|
||||||
ls_iconset-iconset = zcl_excel_style_cond=>c_iconset_5arrows.
|
|
||||||
ls_iconset-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent.
|
|
||||||
ls_iconset-cfvo1_value = '0'.
|
|
||||||
ls_iconset-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent.
|
|
||||||
ls_iconset-cfvo2_value = '20'.
|
|
||||||
ls_iconset-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent.
|
|
||||||
ls_iconset-cfvo3_value = '40'.
|
|
||||||
ls_iconset-cfvo4_type = zcl_excel_style_cond=>c_cfvo_type_percent.
|
|
||||||
ls_iconset-cfvo4_value = '60'.
|
|
||||||
ls_iconset-cfvo5_type = zcl_excel_style_cond=>c_cfvo_type_percent.
|
|
||||||
ls_iconset-cfvo5_value = '80'.
|
|
||||||
ls_iconset-showvalue = zcl_excel_style_cond=>c_showvalue_true.
|
|
||||||
|
|
||||||
"cond style
|
|
||||||
lo_style_cond = lo_worksheet->add_new_style_cond( ).
|
|
||||||
lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset.
|
|
||||||
lo_style_cond->mode_iconset = ls_iconset.
|
|
||||||
lo_style_cond->priority = 1.
|
|
||||||
|
|
||||||
DATA lt_test TYPE ty_sflight_lines.
|
|
||||||
PERFORM load_fixed_data CHANGING lt_test.
|
|
||||||
|
|
||||||
lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = lt_test ).
|
|
||||||
|
|
||||||
LOOP AT lt_field_catalog ASSIGNING <fs_field_catalog>.
|
|
||||||
CASE <fs_field_catalog>-fieldname.
|
|
||||||
WHEN 'CARRID'.
|
|
||||||
<fs_field_catalog>-position = 3.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-totals_function = zcl_excel_table=>totals_function_count.
|
|
||||||
WHEN 'CONNID'.
|
|
||||||
<fs_field_catalog>-position = 4.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-abap_type = cl_abap_typedescr=>typekind_int.
|
|
||||||
"This avoid the excel warning that the number is formatted as a text: abap2xlsx is not able to recognize numc as a number so it formats the number as a text with
|
|
||||||
"the related warning. You can force the type and the framework will correctly format the number as a number
|
|
||||||
WHEN 'FLDATE'.
|
|
||||||
<fs_field_catalog>-position = 2.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'PRICE'.
|
|
||||||
<fs_field_catalog>-position = 1.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-totals_function = zcl_excel_table=>totals_function_sum.
|
|
||||||
<fs_field_catalog>-style_cond = lo_style_cond->get_guid( ).
|
|
||||||
WHEN OTHERS.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_false.
|
|
||||||
ENDCASE.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium5.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table( ip_table = lt_test
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
it_field_catalog = lt_field_catalog ).
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'D' ). "make date field a bit wider
|
|
||||||
lo_column->set_width( ip_width = 13 ).
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
||||||
|
|
||||||
|
|
||||||
FORM load_fixed_data CHANGING ct_test TYPE ty_sflight_lines.
|
|
||||||
DATA: lt_lines TYPE TABLE OF string,
|
|
||||||
lv_line TYPE string,
|
|
||||||
lt_fields TYPE TABLE OF string,
|
|
||||||
lv_comp TYPE i,
|
|
||||||
lv_field TYPE string,
|
|
||||||
ls_test TYPE sflight.
|
|
||||||
FIELD-SYMBOLS: <lv_field> TYPE simple.
|
|
||||||
|
|
||||||
APPEND 'AA 0017 20171219 422 USD 747-400 385 371 191334 31 28 21 21' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20180309 422 USD 747-400 385 365 189984 31 29 21 20' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20180528 422 USD 747-400 385 374 193482 31 30 21 20' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20180816 422 USD 747-400 385 372 193127 31 30 21 20' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20181104 422 USD 747-400 385 44 23908 31 4 21 3' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20190123 422 USD 747-400 385 40 20347 31 3 21 2' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20171219 185 EUR 737-800 140 133 32143 12 12 10 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20180309 185 EUR 737-800 140 137 32595 12 12 10 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20180528 185 EUR 737-800 140 134 31899 12 11 10 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20180816 185 EUR 737-800 140 128 29775 12 10 10 9' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20181104 185 EUR 737-800 140 0 0 12 0 10 0' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20190123 185 EUR 737-800 140 23 5392 12 1 10 2' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20171219 1030 EUR 767-200 260 250 307176 21 20 11 11' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20180309 1030 EUR 767-200 260 252 306054 21 20 11 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20180528 1030 EUR 767-200 260 252 307063 21 20 11 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20180816 1030 EUR 767-200 260 249 300739 21 19 11 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20181104 1030 EUR 767-200 260 104 127647 21 8 11 5' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20190123 1030 EUR 767-200 260 18 22268 21 1 11 1' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20171217 611 USD A380-800 475 458 324379 30 29 20 20' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20180307 611 USD A380-800 475 458 324330 30 30 20 20' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20180526 611 USD A380-800 475 459 328149 30 29 20 20' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20180814 611 USD A380-800 475 462 326805 30 30 20 18' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20181102 611 USD A380-800 475 167 115554 30 10 20 6' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20190121 611 USD A380-800 475 11 9073 30 1 20 1' TO lt_lines.
|
|
||||||
LOOP AT lt_lines INTO lv_line.
|
|
||||||
CONDENSE lv_line.
|
|
||||||
SPLIT lv_line AT space INTO TABLE lt_fields.
|
|
||||||
lv_comp = 2.
|
|
||||||
LOOP AT lt_fields INTO lv_field.
|
|
||||||
ASSIGN COMPONENT lv_comp OF STRUCTURE ls_test TO <lv_field>.
|
|
||||||
<lv_field> = lv_field.
|
|
||||||
lv_comp = lv_comp + 1.
|
|
||||||
ENDLOOP.
|
|
||||||
APPEND ls_test TO ct_test.
|
|
||||||
ENDLOOP.
|
|
||||||
ENDFORM.
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL10</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Format internal table with field catalog</ENTRY>
|
|
||||||
<LENGTH>57</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,372 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL11
|
|
||||||
*& Export Organisation and Contact Persons using ABAP2XLSX
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel11.
|
|
||||||
|
|
||||||
DATA: central_search TYPE bapibus1006_central_search,
|
|
||||||
addressdata_search TYPE bapibus1006_addr_search,
|
|
||||||
others_search TYPE bapibus1006_other_data.
|
|
||||||
DATA: searchresult TYPE TABLE OF bapibus1006_bp_addr,
|
|
||||||
return TYPE TABLE OF bapiret2.
|
|
||||||
DATA: lines TYPE i.
|
|
||||||
FIELD-SYMBOLS: <searchresult_line> LIKE LINE OF searchresult.
|
|
||||||
DATA: centraldata TYPE bapibus1006_central,
|
|
||||||
centraldataperson TYPE bapibus1006_central_person,
|
|
||||||
centraldataorganization TYPE bapibus1006_central_organ.
|
|
||||||
DATA: addressdata TYPE bapibus1006_address.
|
|
||||||
DATA: relationships TYPE TABLE OF bapibus1006_relations.
|
|
||||||
FIELD-SYMBOLS: <relationship> LIKE LINE OF relationships.
|
|
||||||
DATA: relationship_centraldata TYPE bapibus1006002_central.
|
|
||||||
DATA: relationship_addresses TYPE TABLE OF bapibus1006002_addresses.
|
|
||||||
FIELD-SYMBOLS: <relationship_address> LIKE LINE OF relationship_addresses.
|
|
||||||
|
|
||||||
DATA: lt_download TYPE TABLE OF zexcel_s_org_rel.
|
|
||||||
FIELD-SYMBOLS: <download> LIKE LINE OF lt_download.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '11_Export_Org_and_Contact.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
PARAMETERS: md TYPE flag RADIOBUTTON GROUP act.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE TEXT-00a.
|
|
||||||
PARAMETERS: partnerc TYPE bu_type DEFAULT 2, " Organizations
|
|
||||||
postlcod TYPE ad_pstcd1 DEFAULT '8334*',
|
|
||||||
country TYPE land1 DEFAULT 'DE',
|
|
||||||
maxsel TYPE bu_maxsel DEFAULT 100.
|
|
||||||
SELECTION-SCREEN END OF BLOCK a.
|
|
||||||
|
|
||||||
PARAMETERS: rel TYPE flag RADIOBUTTON GROUP act DEFAULT 'X'.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE TEXT-00b.
|
|
||||||
PARAMETERS: reltyp TYPE bu_reltyp DEFAULT 'BUR011',
|
|
||||||
partner TYPE bu_partner DEFAULT '191'.
|
|
||||||
SELECTION-SCREEN END OF BLOCK b.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
IF md = abap_true.
|
|
||||||
" Read all Companies by Master Data
|
|
||||||
central_search-partnercategory = partnerc.
|
|
||||||
addressdata_search-postl_cod1 = postlcod.
|
|
||||||
addressdata_search-country = country.
|
|
||||||
others_search-maxsel = maxsel.
|
|
||||||
others_search-no_search_for_contactperson = 'X'.
|
|
||||||
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_SEARCH_2'
|
|
||||||
EXPORTING
|
|
||||||
centraldata = central_search
|
|
||||||
addressdata = addressdata_search
|
|
||||||
others = others_search
|
|
||||||
TABLES
|
|
||||||
searchresult = searchresult
|
|
||||||
return = return.
|
|
||||||
|
|
||||||
SORT searchresult BY partner.
|
|
||||||
DELETE ADJACENT DUPLICATES FROM searchresult COMPARING partner.
|
|
||||||
ELSEIF rel = abap_true.
|
|
||||||
" Read by Relationship
|
|
||||||
SELECT but050~partner1 AS partner FROM but050
|
|
||||||
INNER JOIN but000 ON but000~partner = but050~partner1 AND but000~type = '2'
|
|
||||||
INTO CORRESPONDING FIELDS OF TABLE searchresult
|
|
||||||
WHERE but050~partner2 = partner
|
|
||||||
AND but050~reltyp = reltyp.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
DESCRIBE TABLE searchresult LINES lines.
|
|
||||||
WRITE: / 'Number of search results: ', lines.
|
|
||||||
|
|
||||||
LOOP AT searchresult ASSIGNING <searchresult_line>.
|
|
||||||
" Read Details of Organization
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_CENTRAL_GETDETAIL'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <searchresult_line>-partner
|
|
||||||
IMPORTING
|
|
||||||
centraldataorganization = centraldataorganization.
|
|
||||||
" Read Standard Address of Organization
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <searchresult_line>-partner
|
|
||||||
IMPORTING
|
|
||||||
addressdata = addressdata.
|
|
||||||
|
|
||||||
" Add Organization to Download
|
|
||||||
APPEND INITIAL LINE TO lt_download ASSIGNING <download>.
|
|
||||||
" Fill Organization Partner Numbers
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_GET_NUMBERS'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <searchresult_line>-partner
|
|
||||||
IMPORTING
|
|
||||||
businesspartnerout = <download>-org_number
|
|
||||||
businesspartnerguidout = <download>-org_guid.
|
|
||||||
|
|
||||||
MOVE-CORRESPONDING centraldataorganization TO <download>.
|
|
||||||
MOVE-CORRESPONDING addressdata TO <download>.
|
|
||||||
CLEAR: addressdata.
|
|
||||||
|
|
||||||
" Read all Relationships
|
|
||||||
CLEAR: relationships.
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_RELATIONSHIPS_GET'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <searchresult_line>-partner
|
|
||||||
TABLES
|
|
||||||
relationships = relationships.
|
|
||||||
DELETE relationships WHERE relationshipcategory <> 'BUR001'.
|
|
||||||
LOOP AT relationships ASSIGNING <relationship>.
|
|
||||||
" Read details of Contact person
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_CENTRAL_GETDETAIL'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <relationship>-partner2
|
|
||||||
IMPORTING
|
|
||||||
centraldata = centraldata
|
|
||||||
centraldataperson = centraldataperson.
|
|
||||||
" Read details of the Relationship
|
|
||||||
CALL FUNCTION 'BAPI_BUPR_CONTP_GETDETAIL'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <relationship>-partner1
|
|
||||||
contactperson = <relationship>-partner2
|
|
||||||
IMPORTING
|
|
||||||
centraldata = relationship_centraldata.
|
|
||||||
" Read relationship address
|
|
||||||
CLEAR: relationship_addresses.
|
|
||||||
|
|
||||||
CALL FUNCTION 'BAPI_BUPR_CONTP_ADDRESSES_GET'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <relationship>-partner1
|
|
||||||
contactperson = <relationship>-partner2
|
|
||||||
TABLES
|
|
||||||
addresses = relationship_addresses.
|
|
||||||
|
|
||||||
READ TABLE relationship_addresses
|
|
||||||
ASSIGNING <relationship_address>
|
|
||||||
WITH KEY standardaddress = 'X'.
|
|
||||||
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
" Read Relationship Address
|
|
||||||
CLEAR addressdata.
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <searchresult_line>-partner
|
|
||||||
addressguid = <relationship_address>-addressguid
|
|
||||||
IMPORTING
|
|
||||||
addressdata = addressdata.
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO lt_download ASSIGNING <download>.
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_GET_NUMBERS'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <relationship>-partner1
|
|
||||||
IMPORTING
|
|
||||||
businesspartnerout = <download>-org_number
|
|
||||||
businesspartnerguidout = <download>-org_guid.
|
|
||||||
|
|
||||||
CALL FUNCTION 'BAPI_BUPA_GET_NUMBERS'
|
|
||||||
EXPORTING
|
|
||||||
businesspartner = <relationship>-partner2
|
|
||||||
IMPORTING
|
|
||||||
businesspartnerout = <download>-contpers_number
|
|
||||||
businesspartnerguidout = <download>-contpers_guid.
|
|
||||||
|
|
||||||
MOVE-CORRESPONDING centraldataorganization TO <download>.
|
|
||||||
MOVE-CORRESPONDING addressdata TO <download>.
|
|
||||||
MOVE-CORRESPONDING centraldataperson TO <download>.
|
|
||||||
MOVE-CORRESPONDING relationship_centraldata TO <download>.
|
|
||||||
|
|
||||||
WRITE: / <relationship>-partner1, <relationship>-partner2.
|
|
||||||
WRITE: centraldataorganization-name1(20), centraldataorganization-name2(10).
|
|
||||||
WRITE: centraldataperson-firstname(15), centraldataperson-lastname(15).
|
|
||||||
WRITE: addressdata-street(25), addressdata-house_no,
|
|
||||||
addressdata-postl_cod1, addressdata-city(25).
|
|
||||||
ENDIF.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_body TYPE REF TO zcl_excel_style,
|
|
||||||
lo_border_dark TYPE REF TO zcl_excel_style_border,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row.
|
|
||||||
|
|
||||||
DATA: lv_style_body_even_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_body_green TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: row TYPE zexcel_cell_row.
|
|
||||||
|
|
||||||
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog,
|
|
||||||
ls_table_settings TYPE zexcel_s_table_settings.
|
|
||||||
|
|
||||||
DATA: column TYPE zexcel_cell_column,
|
|
||||||
column_alpha TYPE zexcel_cell_column_alpha,
|
|
||||||
value TYPE zexcel_cell_value.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <fs_field_catalog> TYPE zexcel_s_fieldcatalog.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Create border object
|
|
||||||
CREATE OBJECT lo_border_dark.
|
|
||||||
lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black.
|
|
||||||
lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
"Create style with border even
|
|
||||||
lo_style_body = lo_excel->add_new_style( ).
|
|
||||||
lo_style_body->fill->fgcolor-rgb = zcl_excel_style_color=>c_yellow.
|
|
||||||
lo_style_body->borders->allborders = lo_border_dark.
|
|
||||||
lv_style_body_even_guid = lo_style_body->get_guid( ).
|
|
||||||
"Create style with border and green fill
|
|
||||||
lo_style_body = lo_excel->add_new_style( ).
|
|
||||||
lo_style_body->fill->fgcolor-rgb = zcl_excel_style_color=>c_green.
|
|
||||||
lo_style_body->borders->allborders = lo_border_dark.
|
|
||||||
lv_style_body_green = lo_style_body->get_guid( ).
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Internal table' ).
|
|
||||||
|
|
||||||
lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = lt_download ).
|
|
||||||
|
|
||||||
LOOP AT lt_field_catalog ASSIGNING <fs_field_catalog>.
|
|
||||||
CASE <fs_field_catalog>-fieldname.
|
|
||||||
WHEN 'ORG_NUMBER'.
|
|
||||||
<fs_field_catalog>-position = 1.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'CONTPERS_NUMBER'.
|
|
||||||
<fs_field_catalog>-position = 2.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'NAME1'.
|
|
||||||
<fs_field_catalog>-position = 3.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'NAME2'.
|
|
||||||
<fs_field_catalog>-position = 4.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'STREET'.
|
|
||||||
<fs_field_catalog>-position = 5.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'HOUSE_NO'.
|
|
||||||
<fs_field_catalog>-position = 6.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'POSTL_COD1'.
|
|
||||||
<fs_field_catalog>-position = 7.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'CITY'.
|
|
||||||
<fs_field_catalog>-position = 8.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'COUNTRYISO'.
|
|
||||||
<fs_field_catalog>-position = 9.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'FIRSTNAME'.
|
|
||||||
<fs_field_catalog>-position = 10.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'LASTNAME'.
|
|
||||||
<fs_field_catalog>-position = 11.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'FUNCTIONNAME'.
|
|
||||||
<fs_field_catalog>-position = 12.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'DEPARTMENTNAME'.
|
|
||||||
<fs_field_catalog>-position = 13.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'TEL1_NUMBR'.
|
|
||||||
<fs_field_catalog>-position = 14.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'TEL1_EXT'.
|
|
||||||
<fs_field_catalog>-position = 15.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'FAX_NUMBER'.
|
|
||||||
<fs_field_catalog>-position = 16.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'FAX_EXTENS'.
|
|
||||||
<fs_field_catalog>-position = 17.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN 'E_MAIL'.
|
|
||||||
<fs_field_catalog>-position = 18.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
WHEN OTHERS.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_false.
|
|
||||||
ENDCASE.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ls_table_settings-top_left_column = 'A'.
|
|
||||||
ls_table_settings-top_left_row = '2'.
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium5.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table( ip_table = lt_download
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
it_field_catalog = lt_field_catalog ).
|
|
||||||
LOOP AT lt_download ASSIGNING <download>.
|
|
||||||
row = sy-tabix + 2.
|
|
||||||
IF NOT <download>-org_number IS INITIAL
|
|
||||||
AND <download>-contpers_number IS INITIAL.
|
|
||||||
" Mark fields of Organization which can be changed green
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'C'
|
|
||||||
ip_row = row
|
|
||||||
ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'D'
|
|
||||||
ip_row = row
|
|
||||||
ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
* CATCH zcx_excel. " Exceptions for ABAP2XLSX
|
|
||||||
ELSEIF NOT <download>-org_number IS INITIAL
|
|
||||||
AND NOT <download>-contpers_number IS INITIAL.
|
|
||||||
" Mark fields of Relationship which can be changed green
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'L' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'M' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'N' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'O' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'P' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'Q' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
lo_worksheet->set_cell_style(
|
|
||||||
ip_column = 'R' ip_row = row ip_style = lv_style_body_green
|
|
||||||
).
|
|
||||||
ENDIF.
|
|
||||||
ENDLOOP.
|
|
||||||
" Add Fieldnames in first row and hide the row
|
|
||||||
LOOP AT lt_field_catalog ASSIGNING <fs_field_catalog>
|
|
||||||
WHERE position <> '' AND dynpfld = abap_true.
|
|
||||||
column = <fs_field_catalog>-position.
|
|
||||||
column_alpha = zcl_excel_common=>convert_column2alpha( column ).
|
|
||||||
value = <fs_field_catalog>-fieldname.
|
|
||||||
lo_worksheet->set_cell( ip_column = column_alpha
|
|
||||||
ip_row = 1
|
|
||||||
ip_value = value
|
|
||||||
ip_style = lv_style_body_even_guid ).
|
|
||||||
ENDLOOP.
|
|
||||||
" Hide first row
|
|
||||||
lo_row = lo_worksheet->get_row( 1 ).
|
|
||||||
lo_row->set_visible( abap_false ).
|
|
||||||
|
|
||||||
DATA: highest_column TYPE zexcel_cell_column,
|
|
||||||
count TYPE int4,
|
|
||||||
col_alpha TYPE zexcel_cell_column_alpha.
|
|
||||||
|
|
||||||
highest_column = lo_worksheet->get_highest_column( ).
|
|
||||||
count = 1.
|
|
||||||
WHILE count <= highest_column.
|
|
||||||
col_alpha = zcl_excel_common=>convert_column2alpha( ip_column = count ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = col_alpha ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
count = count + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,95 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL11</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>K</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>00A</KEY>
|
|
||||||
<ENTRY>Select by master data</ENTRY>
|
|
||||||
<LENGTH>132</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>00B</KEY>
|
|
||||||
<ENTRY>Select by relationship</ENTRY>
|
|
||||||
<LENGTH>132</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Export Organisation and Contact Persons</ENTRY>
|
|
||||||
<LENGTH>55</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>COUNTRY</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>MAXSEL</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>27</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>MD</KEY>
|
|
||||||
<ENTRY>Select by master data</ENTRY>
|
|
||||||
<LENGTH>29</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>PARTNER</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>PARTNERC</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>POSTLCOD</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>21</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>REL</KEY>
|
|
||||||
<ENTRY>Select by relationship</ENTRY>
|
|
||||||
<LENGTH>30</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>RELTYP</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>25</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,108 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL12
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel12.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '12_HideSizeOutlineRowsAndColumns.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Sheet1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world in AutoSize column' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Hello world in a column width size 50' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 4 ip_value = 'Hello world (hidden column)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'F' ip_row = 2 ip_value = 'Outline column level 0' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'G' ip_row = 2 ip_value = 'Outline column level 1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'H' ip_row = 2 ip_value = 'Outline column level 2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'I' ip_row = 2 ip_value = 'Small' ).
|
|
||||||
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'Hello world (hidden row)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = 5 ip_value = 'Hello world in a row height size 20' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'Simple outline rows 10-16 ( collapsed )' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 19 ip_value = '3 Outlines - Outlinelevel 1 is collapsed' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 19 ip_value = 'One of the two inner outlines is expanded, one collapsed' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 20 ip_value = 'Inner outline level - expanded' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 24 ip_value = 'Inner outline level - lines 25-28 are collapsed' ).
|
|
||||||
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~summarybelow = zif_excel_sheet_properties=>c_below_off. " By default is on
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~summaryright = zif_excel_sheet_properties=>c_right_off. " By default is on
|
|
||||||
|
|
||||||
" Column Settings
|
|
||||||
" Auto size
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'B' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'I' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
" Manual Width
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'C' ).
|
|
||||||
lo_column->set_width( ip_width = 50 ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'D' ).
|
|
||||||
lo_column->set_visible( ip_visible = abap_false ).
|
|
||||||
" Implementation in the Writer is not working yet ===== TODO =====
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'F' ).
|
|
||||||
lo_column->set_outline_level( ip_outline_level = 0 ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'G' ).
|
|
||||||
lo_column->set_outline_level( ip_outline_level = 1 ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'H' ).
|
|
||||||
lo_column->set_outline_level( ip_outline_level = 2 ).
|
|
||||||
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 1 ).
|
|
||||||
lo_row->set_visible( ip_visible = abap_false ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 5 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 20 ).
|
|
||||||
|
|
||||||
* Define an outline rows 10-16, collapsed on startup
|
|
||||||
lo_worksheet->set_row_outline( iv_row_from = 10
|
|
||||||
iv_row_to = 16
|
|
||||||
iv_collapsed = abap_true ). " collapsed
|
|
||||||
|
|
||||||
* Define an inner outline rows 21-22, expanded when outer outline becomes extended
|
|
||||||
lo_worksheet->set_row_outline( iv_row_from = 21
|
|
||||||
iv_row_to = 22
|
|
||||||
iv_collapsed = abap_false ). " expanded
|
|
||||||
|
|
||||||
* Define an inner outline rows 25-28, collapsed on startup
|
|
||||||
lo_worksheet->set_row_outline( iv_row_from = 25
|
|
||||||
iv_row_to = 28
|
|
||||||
iv_collapsed = abap_true ). " collapsed
|
|
||||||
|
|
||||||
* Define an outer outline rows 20-30, collapsed on startup
|
|
||||||
lo_worksheet->set_row_outline( iv_row_from = 20
|
|
||||||
iv_row_to = 30
|
|
||||||
iv_collapsed = abap_true ). " collapsed
|
|
||||||
|
|
||||||
* Hint: the order you create the outlines can be arbitrary
|
|
||||||
* You can start with inner outlines or with outer outlines
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Hide columns right of column M
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~hide_columns_from = 'M'.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL12</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Hide Columns</ENTRY>
|
|
||||||
<LENGTH>29</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,87 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL13
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Example by: Alvaro "Blag" Tejada Galindo.
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel13.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lv_style_bold_border_guid TYPE zexcel_cell_style,
|
|
||||||
lo_style_bold_border TYPE REF TO zcl_excel_style,
|
|
||||||
lo_border_dark TYPE REF TO zcl_excel_style_border.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '13_MergedCells.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'sheet1' ).
|
|
||||||
|
|
||||||
CREATE OBJECT lo_border_dark.
|
|
||||||
lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black.
|
|
||||||
lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
|
|
||||||
lo_style_bold_border = lo_excel->add_new_style( ).
|
|
||||||
lo_style_bold_border->font->bold = abap_true.
|
|
||||||
lo_style_bold_border->font->italic = abap_false.
|
|
||||||
lo_style_bold_border->font->color-rgb = zcl_excel_style_color=>c_black.
|
|
||||||
lo_style_bold_border->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_bold_border->borders->allborders = lo_border_dark.
|
|
||||||
lv_style_bold_border_guid = lo_style_bold_border->get_guid( ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'A' ip_value = 'Test' ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'B' ip_value = 'Banana' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'C' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'D' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'E' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'F' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'G' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'Apple' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'F' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'G' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
|
|
||||||
lo_worksheet->set_merge( ip_row = 4 ip_column_start = 'B' ip_column_end = 'G' ).
|
|
||||||
|
|
||||||
" Test also if merge works when oher merged chells are empty
|
|
||||||
lo_worksheet->set_merge( ip_range = 'B6:G6' ip_value = 'Tomato' ).
|
|
||||||
|
|
||||||
" Test the patch provided by Victor Alekhin to merge cells in one column
|
|
||||||
lo_worksheet->set_merge( ip_range = 'B8:G10' ip_value = 'Merge cells also over multiple rows by Victor Alekhin' ).
|
|
||||||
|
|
||||||
" Test the patch provided by Alexander Budeyev with different column merges
|
|
||||||
lo_worksheet->set_cell( ip_row = 12 ip_column = 'B' ip_value = 'Merge cells with different merges by Alexander Budeyev' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 13 ip_column = 'B' ip_value = 'Test' ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_row = 13 ip_column = 'D' ip_value = 'Banana' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 14 ip_column = 'D' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 13 ip_column = 'E' ip_value = 'Apple' ip_style = lv_style_bold_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 13 ip_column = 'F' ip_value = '' ip_style = lv_style_bold_border_guid ).
|
|
||||||
|
|
||||||
" Test merge (issue)
|
|
||||||
lo_worksheet->set_merge( ip_row = 13 ip_column_start = 'B' ip_column_end = 'C' ip_row_to = 15 ).
|
|
||||||
lo_worksheet->set_merge( ip_row = 13 ip_column_start = 'D' ip_column_end = 'D' ip_row_to = 14 ).
|
|
||||||
lo_worksheet->set_merge( ip_row = 13 ip_column_start = 'E' ip_column_end = 'F' ).
|
|
||||||
|
|
||||||
" Test area with merge
|
|
||||||
lo_worksheet->set_area( ip_row = 18 ip_row_to = 19 ip_column_start = 'B' ip_column_end = 'G' ip_style = lv_style_bold_border_guid
|
|
||||||
ip_value = 'Merge cells with new area method by Helmut Bohr ' ip_merge = abap_true ).
|
|
||||||
|
|
||||||
" Test area without merge
|
|
||||||
lo_worksheet->set_area( ip_row = 21 ip_row_to = 22 ip_column_start = 'B' ip_column_end = 'G' ip_style = lv_style_bold_border_guid
|
|
||||||
ip_value = 'Test area' ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL13</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Merge cells</ENTRY>
|
|
||||||
<LENGTH>28</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,160 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL14
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel14.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_center TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_right TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_left TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_general TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_bottom TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_middle TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_top TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_justify TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_mixed TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_mixed_wrap TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_rotated TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_shrink TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_indent TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_center_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_right_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_left_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_general_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_bottom_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_middle_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_top_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_justify_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_mixed_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_mixed_wrap_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_rotated_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_shrink_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_indent_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: lo_row TYPE REF TO zcl_excel_row.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '14_Alignment.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'sheet1' ).
|
|
||||||
|
|
||||||
"Center
|
|
||||||
lo_style_center = lo_excel->add_new_style( ).
|
|
||||||
lo_style_center->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lv_style_center_guid = lo_style_center->get_guid( ).
|
|
||||||
"Right
|
|
||||||
lo_style_right = lo_excel->add_new_style( ).
|
|
||||||
lo_style_right->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right.
|
|
||||||
lv_style_right_guid = lo_style_right->get_guid( ).
|
|
||||||
"Left
|
|
||||||
lo_style_left = lo_excel->add_new_style( ).
|
|
||||||
lo_style_left->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_left.
|
|
||||||
lv_style_left_guid = lo_style_left->get_guid( ).
|
|
||||||
"General
|
|
||||||
lo_style_general = lo_excel->add_new_style( ).
|
|
||||||
lo_style_general->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_general.
|
|
||||||
lv_style_general_guid = lo_style_general->get_guid( ).
|
|
||||||
"Bottom
|
|
||||||
lo_style_bottom = lo_excel->add_new_style( ).
|
|
||||||
lo_style_bottom->alignment->vertical = zcl_excel_style_alignment=>c_vertical_bottom.
|
|
||||||
lv_style_bottom_guid = lo_style_bottom->get_guid( ).
|
|
||||||
"Middle
|
|
||||||
lo_style_middle = lo_excel->add_new_style( ).
|
|
||||||
lo_style_middle->alignment->vertical = zcl_excel_style_alignment=>c_vertical_center.
|
|
||||||
lv_style_middle_guid = lo_style_middle->get_guid( ).
|
|
||||||
"Top
|
|
||||||
lo_style_top = lo_excel->add_new_style( ).
|
|
||||||
lo_style_top->alignment->vertical = zcl_excel_style_alignment=>c_vertical_top.
|
|
||||||
lv_style_top_guid = lo_style_top->get_guid( ).
|
|
||||||
"Justify
|
|
||||||
lo_style_justify = lo_excel->add_new_style( ).
|
|
||||||
lo_style_justify->alignment->vertical = zcl_excel_style_alignment=>c_vertical_justify.
|
|
||||||
lv_style_justify_guid = lo_style_justify->get_guid( ).
|
|
||||||
|
|
||||||
"Shrink
|
|
||||||
lo_style_shrink = lo_excel->add_new_style( ).
|
|
||||||
lo_style_shrink->alignment->shrinktofit = abap_true.
|
|
||||||
lv_style_shrink_guid = lo_style_shrink->get_guid( ).
|
|
||||||
|
|
||||||
"Indent
|
|
||||||
lo_style_indent = lo_excel->add_new_style( ).
|
|
||||||
lo_style_indent->alignment->indent = 5.
|
|
||||||
lv_style_indent_guid = lo_style_indent->get_guid( ).
|
|
||||||
|
|
||||||
"Middle / Centered / Wrap
|
|
||||||
lo_style_mixed_wrap = lo_excel->add_new_style( ).
|
|
||||||
lo_style_mixed_wrap->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_mixed_wrap->alignment->vertical = zcl_excel_style_alignment=>c_vertical_center.
|
|
||||||
lo_style_mixed_wrap->alignment->wraptext = abap_true.
|
|
||||||
lv_style_mixed_wrap_guid = lo_style_mixed_wrap->get_guid( ).
|
|
||||||
|
|
||||||
"Middle / Centered / Wrap
|
|
||||||
lo_style_mixed = lo_excel->add_new_style( ).
|
|
||||||
lo_style_mixed->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_mixed->alignment->vertical = zcl_excel_style_alignment=>c_vertical_center.
|
|
||||||
lv_style_mixed_guid = lo_style_mixed->get_guid( ).
|
|
||||||
|
|
||||||
"Center
|
|
||||||
lo_style_rotated = lo_excel->add_new_style( ).
|
|
||||||
lo_style_rotated->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
|
|
||||||
lo_style_rotated->alignment->vertical = zcl_excel_style_alignment=>c_vertical_center.
|
|
||||||
lo_style_rotated->alignment->textrotation = 165. " -75° == 90° + 75°
|
|
||||||
lv_style_rotated_guid = lo_style_rotated->get_guid( ).
|
|
||||||
|
|
||||||
|
|
||||||
" Set row size for first 7 rows to 40
|
|
||||||
DO 7 TIMES.
|
|
||||||
lo_row = lo_worksheet->get_row( sy-index ).
|
|
||||||
lo_row->set_row_height( 40 ).
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
"Horizontal alignment
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'Centered Text' ip_style = lv_style_center_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 'Right Text' ip_style = lv_style_right_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 6 ip_column = 'B' ip_value = 'Left Text' ip_style = lv_style_left_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 7 ip_column = 'B' ip_value = 'General Text' ip_style = lv_style_general_guid ).
|
|
||||||
|
|
||||||
" Shrink & indent
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'F' ip_value = 'Text shrinked' ip_style = lv_style_shrink_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 5 ip_column = 'F' ip_value = 'Text indented' ip_style = lv_style_indent_guid ).
|
|
||||||
|
|
||||||
"Vertical alignment
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = 'Bottom Text' ip_style = lv_style_bottom_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 5 ip_column = 'D' ip_value = 'Middle Text' ip_style = lv_style_middle_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 6 ip_column = 'D' ip_value = 'Top Text' ip_style = lv_style_top_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 7 ip_column = 'D' ip_value = 'Justify Text' ip_style = lv_style_justify_guid ).
|
|
||||||
|
|
||||||
" Wrapped
|
|
||||||
lo_worksheet->set_cell( ip_row = 10 ip_column = 'B'
|
|
||||||
ip_value = 'This is a wrapped text centered in the middle'
|
|
||||||
ip_style = lv_style_mixed_wrap_guid ).
|
|
||||||
|
|
||||||
" Rotated
|
|
||||||
lo_worksheet->set_cell( ip_row = 10 ip_column = 'D'
|
|
||||||
ip_value = 'This is a centered text rotated by -75°'
|
|
||||||
ip_style = lv_style_rotated_guid ).
|
|
||||||
|
|
||||||
" forced line break
|
|
||||||
DATA: lv_value TYPE string.
|
|
||||||
CONCATENATE 'This is a wrapped text centered in the middle' cl_abap_char_utilities=>cr_lf
|
|
||||||
'and a manuall line break.' INTO lv_value.
|
|
||||||
lo_worksheet->set_cell( ip_row = 11 ip_column = 'B'
|
|
||||||
ip_value = lv_value
|
|
||||||
ip_style = lv_style_mixed_guid ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL14</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Alignment</ENTRY>
|
|
||||||
<LENGTH>26</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,162 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL15
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& 2010-10-30, Gregor Wolf:
|
|
||||||
*& Added the functionality to ouput the read table content
|
|
||||||
*& 2011-12-19, Shahrin Shahrulzaman:
|
|
||||||
*& Added the functionality to have multiple input and output files
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel15.
|
|
||||||
|
|
||||||
TYPES:
|
|
||||||
BEGIN OF t_demo_excel15,
|
|
||||||
input TYPE string,
|
|
||||||
END OF t_demo_excel15.
|
|
||||||
|
|
||||||
CONSTANTS: sheet_with_date_formats TYPE string VALUE '24_Sheets_with_different_default_date_formats.xlsx'.
|
|
||||||
|
|
||||||
DATA: excel TYPE REF TO zcl_excel,
|
|
||||||
lo_excel_writer TYPE REF TO zif_excel_writer,
|
|
||||||
reader TYPE REF TO zif_excel_reader.
|
|
||||||
|
|
||||||
DATA: ex TYPE REF TO zcx_excel,
|
|
||||||
msg TYPE string.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_workdir TYPE string,
|
|
||||||
output_file_path TYPE string,
|
|
||||||
input_file_path TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
DATA: worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
highest_column TYPE zexcel_cell_column,
|
|
||||||
highest_row TYPE int4,
|
|
||||||
column TYPE zexcel_cell_column VALUE 1,
|
|
||||||
col_str TYPE zexcel_cell_column_alpha,
|
|
||||||
row TYPE int4 VALUE 1,
|
|
||||||
value TYPE zexcel_cell_value,
|
|
||||||
converted_date TYPE d.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lt_files TYPE TABLE OF t_demo_excel15.
|
|
||||||
FIELD-SYMBOLS: <wa_files> TYPE t_demo_excel15.
|
|
||||||
|
|
||||||
PARAMETERS: p_path TYPE zexcel_export_dir,
|
|
||||||
p_noout TYPE abap_bool DEFAULT abap_true.
|
|
||||||
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
|
|
||||||
lv_workdir = p_path.
|
|
||||||
cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir
|
|
||||||
CHANGING selected_folder = lv_workdir ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '01_HelloWorld.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '02_Styles.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '03_iTab.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '04_Sheets.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '05_Conditional.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '07_ConditionalAll.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '08_Range.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '13_MergedCells.xlsx'.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = sheet_with_date_formats.
|
|
||||||
APPEND INITIAL LINE TO lt_files ASSIGNING <wa_files>.
|
|
||||||
<wa_files>-input = '31_AutosizeWithDifferentFontSizes.xlsx'.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
p_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
|
|
||||||
|
|
||||||
LOOP AT lt_files ASSIGNING <wa_files>.
|
|
||||||
CONCATENATE p_path lv_file_separator <wa_files>-input INTO input_file_path.
|
|
||||||
CONCATENATE p_path lv_file_separator '15_' <wa_files>-input INTO output_file_path.
|
|
||||||
REPLACE '.xlsx' IN output_file_path WITH 'FromReader.xlsx'.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
CREATE OBJECT reader TYPE zcl_excel_reader_2007.
|
|
||||||
excel = reader->load_file( input_file_path ).
|
|
||||||
|
|
||||||
IF p_noout EQ abap_false.
|
|
||||||
worksheet = excel->get_active_worksheet( ).
|
|
||||||
highest_column = worksheet->get_highest_column( ).
|
|
||||||
highest_row = worksheet->get_highest_row( ).
|
|
||||||
|
|
||||||
WRITE: / 'Filename ', <wa_files>-input.
|
|
||||||
WRITE: / 'Highest column: ', highest_column, 'Highest row: ', highest_row.
|
|
||||||
WRITE: /.
|
|
||||||
|
|
||||||
WHILE row <= highest_row.
|
|
||||||
WHILE column <= highest_column.
|
|
||||||
col_str = zcl_excel_common=>convert_column2alpha( column ).
|
|
||||||
worksheet->get_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_column = col_str
|
|
||||||
ip_row = row
|
|
||||||
IMPORTING
|
|
||||||
ep_value = value
|
|
||||||
).
|
|
||||||
WRITE: value.
|
|
||||||
column = column + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
WRITE: /.
|
|
||||||
column = 1.
|
|
||||||
row = row + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
IF <wa_files>-input = sheet_with_date_formats.
|
|
||||||
worksheet->get_cell(
|
|
||||||
EXPORTING
|
|
||||||
ip_columnrow = 'A4'
|
|
||||||
IMPORTING
|
|
||||||
ep_value = value
|
|
||||||
).
|
|
||||||
WRITE: / 'Date value using get_cell: ', value.
|
|
||||||
converted_date = zcl_excel_common=>excel_string_to_date( ip_value = value ).
|
|
||||||
WRITE: / 'Converted date: ', converted_date.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
|
|
||||||
lv_file = lo_excel_writer->write_file( excel ).
|
|
||||||
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = lv_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = lv_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file_tab.
|
|
||||||
|
|
||||||
" Save the file
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
|
|
||||||
filename = output_file_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file_tab ).
|
|
||||||
|
|
||||||
|
|
||||||
CATCH zcx_excel INTO ex. " Exceptions for ABAP2XLSX
|
|
||||||
msg = ex->get_text( ).
|
|
||||||
WRITE: / msg.
|
|
||||||
ENDTRY.
|
|
||||||
ENDLOOP.
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL15</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Reader</ENTRY>
|
|
||||||
<LENGTH>22</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_NOOUT</KEY>
|
|
||||||
<ENTRY>Hide output</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,131 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL16
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel16.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_drawing TYPE REF TO zcl_excel_drawing.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: ls_io TYPE skwf_io.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '16_Drawings.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
PARAMETERS: p_objid TYPE sdok_docid DEFAULT '456694429165174BE10000000A1550C0', " Question mark in standard Web Dynpro WDT_QUIZ
|
|
||||||
p_class TYPE sdok_class DEFAULT 'M_IMAGE_P',
|
|
||||||
pobjtype TYPE skwf_ioty DEFAULT 'P'.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
"Load samle image
|
|
||||||
DATA: lt_bin TYPE solix_tab,
|
|
||||||
lv_len TYPE i,
|
|
||||||
lv_content TYPE xstring,
|
|
||||||
ls_key TYPE wwwdatatab.
|
|
||||||
|
|
||||||
CALL METHOD cl_gui_frontend_services=>gui_upload
|
|
||||||
EXPORTING
|
|
||||||
filename = 'c:\Program Files\SAP\FrontEnd\SAPgui\wwi\graphics\W_bio.bmp'
|
|
||||||
filetype = 'BIN'
|
|
||||||
IMPORTING
|
|
||||||
filelength = lv_len
|
|
||||||
CHANGING
|
|
||||||
data_tab = lt_bin
|
|
||||||
EXCEPTIONS
|
|
||||||
file_open_error = 1
|
|
||||||
file_read_error = 2
|
|
||||||
no_batch = 3
|
|
||||||
gui_refuse_filetransfer = 4
|
|
||||||
invalid_type = 5
|
|
||||||
no_authority = 6
|
|
||||||
unknown_error = 7
|
|
||||||
bad_data_format = 8
|
|
||||||
header_not_allowed = 9
|
|
||||||
separator_not_allowed = 10
|
|
||||||
header_too_long = 11
|
|
||||||
unknown_dp_error = 12
|
|
||||||
access_denied = 13
|
|
||||||
dp_out_of_memory = 14
|
|
||||||
disk_full = 15
|
|
||||||
dp_timeout = 16
|
|
||||||
not_supported_by_gui = 17
|
|
||||||
error_no_gui = 18
|
|
||||||
OTHERS = 19.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
|
|
||||||
EXPORTING
|
|
||||||
input_length = lv_len
|
|
||||||
IMPORTING
|
|
||||||
buffer = lv_content
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_bin
|
|
||||||
EXCEPTIONS
|
|
||||||
failed = 1
|
|
||||||
OTHERS = 2.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Sheet1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Image from web repository (SMW0)' ).
|
|
||||||
|
|
||||||
" create global drawing, set position and media from web repository
|
|
||||||
lo_drawing = lo_excel->add_new_drawing( ).
|
|
||||||
lo_drawing->set_position( ip_from_row = 3
|
|
||||||
ip_from_col = 'B' ).
|
|
||||||
|
|
||||||
ls_key-relid = 'MI'.
|
|
||||||
ls_key-objid = 'SAPLOGO.GIF'.
|
|
||||||
lo_drawing->set_media_www( ip_key = ls_key
|
|
||||||
ip_width = 166
|
|
||||||
ip_height = 75 ).
|
|
||||||
|
|
||||||
" assign drawing to the worksheet
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
" another drawing from a XSTRING read from a file
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Image from a file (c:\Program Files\SAP\FrontEnd\SAPgui\wwi\graphics\W_bio.bmp)' ).
|
|
||||||
lo_drawing = lo_excel->add_new_drawing( ).
|
|
||||||
lo_drawing->set_position( ip_from_row = 9
|
|
||||||
ip_from_col = 'B' ).
|
|
||||||
lo_drawing->set_media( ip_media = lv_content
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_bmp
|
|
||||||
ip_width = 83
|
|
||||||
ip_height = 160 ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
ls_io-objid = p_objid.
|
|
||||||
ls_io-class = p_class.
|
|
||||||
ls_io-objtype = pobjtype.
|
|
||||||
IF ls_io IS NOT INITIAL.
|
|
||||||
" another drawing from a XSTRING read from a file
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 18 ip_value = 'Mime repository (by default Question mark in standard Web Dynpro WDT_QUIZ)' ).
|
|
||||||
lo_drawing = lo_excel->add_new_drawing( ).
|
|
||||||
lo_drawing->set_position( ip_from_row = 19
|
|
||||||
ip_from_col = 'B' ).
|
|
||||||
lo_drawing->set_media_mime( ip_io = ls_io
|
|
||||||
ip_width = 126
|
|
||||||
ip_height = 145 ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL16</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Drawings</ENTRY>
|
|
||||||
<LENGTH>25</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>POBJTYPE</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_CLASS</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_OBJID</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,53 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL17
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel17.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_protection TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_protection_guid TYPE zexcel_cell_style,
|
|
||||||
lo_style TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '17_SheetProtection.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
PARAMETERS: p_pwd TYPE zexcel_aes_password LOWER CASE DEFAULT 'secret'.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
|
|
||||||
* lo_worksheet->zif_excel_sheet_protection~password = 'DAA7'. "it is the encoded word "secret"
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~password = zcl_excel_common=>encrypt_password( p_pwd ).
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~sheet = zif_excel_sheet_protection=>c_active.
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~objects = zif_excel_sheet_protection=>c_active.
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~scenarios = zif_excel_sheet_protection=>c_active.
|
|
||||||
" First style to unlock a cell
|
|
||||||
lo_style_protection = lo_excel->add_new_style( ).
|
|
||||||
lo_style_protection->protection->locked = zcl_excel_style_protection=>c_protection_unlocked.
|
|
||||||
lv_style_protection_guid = lo_style_protection->get_guid( ).
|
|
||||||
" Another style which should not affect the unlock style
|
|
||||||
lo_style = lo_excel->add_new_style( ).
|
|
||||||
lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style->fill->fgcolor-rgb = 'FFCC3333'.
|
|
||||||
lv_style = lo_style->get_guid( ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 3 ip_column = 'C' ip_value = 'This cell is locked locked and has the second formating' ip_style = lv_style ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'This cell is unlocked' ip_style = lv_style_protection_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 'This cell is locked as all the others empty cell' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 'This cell is unlocked' ip_style = lv_style_protection_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'This cell is unlocked' ip_style = lv_style_protection_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'This cell is locked as all the others empty cell' ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,36 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL17</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Sheet Protection</ENTRY>
|
|
||||||
<LENGTH>33</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PWD</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,34 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL18
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel18.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lv_style_protection_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '18_BookProtection.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_excel->zif_excel_book_protection~protected = zif_excel_book_protection=>c_protected.
|
|
||||||
lo_excel->zif_excel_book_protection~lockrevision = zif_excel_book_protection=>c_locked.
|
|
||||||
lo_excel->zif_excel_book_protection~lockstructure = zif_excel_book_protection=>c_locked.
|
|
||||||
lo_excel->zif_excel_book_protection~lockwindows = zif_excel_book_protection=>c_locked.
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'This cell is unlocked' ip_style = lv_style_protection_guid ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL18</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Book protection</ENTRY>
|
|
||||||
<LENGTH>32</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,53 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL19
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel19.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '19_SetActiveSheet.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
PARAMETERS: p_noout TYPE abap_bool DEFAULT abap_true.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" First Worksheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'First' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 1 ip_column = 'A' ip_value = 'This is Sheet 1' ).
|
|
||||||
|
|
||||||
" Second Worksheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Second' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 1 ip_column = 'A' ip_value = 'This is Sheet 2' ).
|
|
||||||
|
|
||||||
" Third Worksheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Third' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 1 ip_column = 'A' ip_value = 'This is Sheet 3' ).
|
|
||||||
|
|
||||||
IF p_noout EQ abap_false.
|
|
||||||
DATA: active_sheet_index TYPE zexcel_active_worksheet.
|
|
||||||
active_sheet_index = lo_excel->get_active_sheet_index( ).
|
|
||||||
WRITE: 'Sheet Index before: ', active_sheet_index.
|
|
||||||
ENDIF.
|
|
||||||
lo_excel->set_active_sheet_index( '2' ).
|
|
||||||
IF p_noout EQ abap_false.
|
|
||||||
active_sheet_index = lo_excel->get_active_sheet_index( ).
|
|
||||||
WRITE: 'Sheet Index after: ', active_sheet_index.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL19</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Set active sheet</ENTRY>
|
|
||||||
<LENGTH>33</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_NOOUT</KEY>
|
|
||||||
<ENTRY>Hide output</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>26</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
<I18N_TPOOL>
|
|
||||||
<item>
|
|
||||||
<LANGUAGE>D</LANGUAGE>
|
|
||||||
<TEXTPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_NOOUT</KEY>
|
|
||||||
<ENTRY>Hide output</ENTRY>
|
|
||||||
<LENGTH>19</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>26</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TEXTPOOL>
|
|
||||||
</item>
|
|
||||||
</I18N_TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,224 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL2
|
|
||||||
*& Test Styles for ABAP2XLSX
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel2.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_bold TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_underline TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_filled TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_filled_green TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_filled_turquoise TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_border TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_button TYPE REF TO zcl_excel_style,
|
|
||||||
lo_border_dark TYPE REF TO zcl_excel_style_border,
|
|
||||||
lo_border_light TYPE REF TO zcl_excel_style_border,
|
|
||||||
lo_style_gr_cornerlb TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_cornerlt TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_cornerrb TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_cornerrt TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_horizontal90 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_horizontal270 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_horizontalb TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_vertical TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_vertical2 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_fromcenter TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_diagonal45 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_diagonal45b TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_diagonal135 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_gr_diagonal135b TYPE REF TO zcl_excel_style.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
DATA: lo_row TYPE REF TO zcl_excel_row.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '02_Styles.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Create border object
|
|
||||||
CREATE OBJECT lo_border_dark.
|
|
||||||
lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black.
|
|
||||||
lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
CREATE OBJECT lo_border_light.
|
|
||||||
lo_border_light->border_color-rgb = zcl_excel_style_color=>c_gray.
|
|
||||||
lo_border_light->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
" Create a bold / italic style
|
|
||||||
lo_style_bold = lo_excel->add_new_style( ).
|
|
||||||
lo_style_bold->font->bold = abap_true.
|
|
||||||
lo_style_bold->font->italic = abap_true.
|
|
||||||
lo_style_bold->font->name = zcl_excel_style_font=>c_name_arial.
|
|
||||||
lo_style_bold->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_bold->font->color-rgb = zcl_excel_style_color=>c_red.
|
|
||||||
" Create an underline double style
|
|
||||||
lo_style_underline = lo_excel->add_new_style( ).
|
|
||||||
lo_style_underline->font->underline = abap_true.
|
|
||||||
lo_style_underline->font->underline_mode = zcl_excel_style_font=>c_underline_double.
|
|
||||||
lo_style_underline->font->name = zcl_excel_style_font=>c_name_roman.
|
|
||||||
lo_style_underline->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_underline->font->family = zcl_excel_style_font=>c_family_roman.
|
|
||||||
" Create filled style yellow
|
|
||||||
lo_style_filled = lo_excel->add_new_style( ).
|
|
||||||
lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled->fill->fgcolor-theme = zcl_excel_style_color=>c_theme_accent6.
|
|
||||||
" Create border with button effects
|
|
||||||
lo_style_button = lo_excel->add_new_style( ).
|
|
||||||
lo_style_button->borders->right = lo_border_dark.
|
|
||||||
lo_style_button->borders->down = lo_border_dark.
|
|
||||||
lo_style_button->borders->left = lo_border_light.
|
|
||||||
lo_style_button->borders->top = lo_border_light.
|
|
||||||
"Create style with border
|
|
||||||
lo_style_border = lo_excel->add_new_style( ).
|
|
||||||
lo_style_border->borders->allborders = lo_border_dark.
|
|
||||||
lo_style_border->borders->diagonal = lo_border_dark.
|
|
||||||
lo_style_border->borders->diagonal_mode = zcl_excel_style_borders=>c_diagonal_both.
|
|
||||||
" Create filled style green
|
|
||||||
lo_style_filled_green = lo_excel->add_new_style( ).
|
|
||||||
lo_style_filled_green->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled_green->fill->fgcolor-rgb = zcl_excel_style_color=>c_green.
|
|
||||||
lo_style_filled_green->font->name = zcl_excel_style_font=>c_name_cambria.
|
|
||||||
lo_style_filled_green->font->scheme = zcl_excel_style_font=>c_scheme_major.
|
|
||||||
|
|
||||||
" Create filled with gradients
|
|
||||||
lo_style_gr_cornerlb = lo_excel->add_new_style( ).
|
|
||||||
lo_style_gr_cornerlb->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_cornerlb.
|
|
||||||
lo_style_gr_cornerlb->fill->fgcolor-rgb = zcl_excel_style_color=>c_blue.
|
|
||||||
lo_style_gr_cornerlb->fill->bgcolor-rgb = zcl_excel_style_color=>c_white.
|
|
||||||
lo_style_gr_cornerlb->font->name = zcl_excel_style_font=>c_name_cambria.
|
|
||||||
lo_style_gr_cornerlb->font->scheme = zcl_excel_style_font=>c_scheme_major.
|
|
||||||
|
|
||||||
lo_style_gr_cornerlt = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_cornerlt->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_cornerlt.
|
|
||||||
|
|
||||||
lo_style_gr_cornerrb = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_cornerrb->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_cornerrb.
|
|
||||||
|
|
||||||
lo_style_gr_cornerrt = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_cornerrt->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_cornerrt.
|
|
||||||
|
|
||||||
lo_style_gr_horizontal90 = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_horizontal90->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_horizontal90.
|
|
||||||
|
|
||||||
lo_style_gr_horizontal270 = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_horizontal270->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_horizontal270.
|
|
||||||
|
|
||||||
lo_style_gr_horizontalb = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_horizontalb->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_horizontalb.
|
|
||||||
|
|
||||||
lo_style_gr_vertical = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_vertical->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_vertical.
|
|
||||||
|
|
||||||
lo_style_gr_vertical2 = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_vertical2->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_vertical.
|
|
||||||
lo_style_gr_vertical2->fill->fgcolor-rgb = zcl_excel_style_color=>c_white.
|
|
||||||
lo_style_gr_vertical2->fill->bgcolor-rgb = zcl_excel_style_color=>c_blue.
|
|
||||||
|
|
||||||
lo_style_gr_fromcenter = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_fromcenter->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_fromcenter.
|
|
||||||
|
|
||||||
lo_style_gr_diagonal45 = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_diagonal45->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_diagonal45.
|
|
||||||
|
|
||||||
lo_style_gr_diagonal45b = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_diagonal45b->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_diagonal45b.
|
|
||||||
|
|
||||||
lo_style_gr_diagonal135 = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_diagonal135->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_diagonal135.
|
|
||||||
|
|
||||||
lo_style_gr_diagonal135b = lo_excel->add_new_style( io_clone_of = lo_style_gr_cornerlb ).
|
|
||||||
lo_style_gr_diagonal135b->fill->filltype = zcl_excel_style_fill=>c_fill_gradient_diagonal135b.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Create filled style turquoise using legacy excel ver <= 2003 palette. (https://github.com/abap2xlsx/abap2xlsx/issues/92)
|
|
||||||
lo_style_filled_turquoise = lo_excel->add_new_style( ).
|
|
||||||
lo_excel->legacy_palette->set_color( "replace built-in color from palette with out custom RGB turquoise
|
|
||||||
ip_index = 16
|
|
||||||
ip_color = '0040E0D0' ).
|
|
||||||
|
|
||||||
lo_style_filled_turquoise->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled_turquoise->fill->fgcolor-indexed = 16.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Styles' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Bold text' ip_style = lo_style_bold ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 4 ip_value = 'Underlined text' ip_style = lo_style_underline ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'Filled text' ip_style = lo_style_filled ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = 'Borders' ip_style = lo_style_border ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 7 ip_value = 'I''m not a button :)' ip_style = lo_style_button ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'Modified color for Excel 2003' ip_style = lo_style_filled_turquoise ).
|
|
||||||
" Fill the cell and apply one style
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = 'Filled text' ip_style = lo_style_filled ).
|
|
||||||
" Change the style
|
|
||||||
lo_worksheet->set_cell_style( ip_column = 'B' ip_row = 6 ip_style = lo_style_filled_green ).
|
|
||||||
" Add Style to an empty cell to test Fix for Issue
|
|
||||||
"#44 Exception ZCX_EXCEL thrown when style is set for an empty cell
|
|
||||||
" https://github.com/abap2xlsx/abap2xlsx/issues/44
|
|
||||||
lo_worksheet->set_cell_style( ip_column = 'E' ip_row = 6 ip_style = lo_style_filled_green ).
|
|
||||||
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_style = lo_style_gr_cornerlb ip_value = zcl_excel_style_fill=>c_fill_gradient_cornerlb ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 10 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 11 ip_style = lo_style_gr_cornerlt ip_value = zcl_excel_style_fill=>c_fill_gradient_cornerlt ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 11 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 12 ip_style = lo_style_gr_cornerrb ip_value = zcl_excel_style_fill=>c_fill_gradient_cornerrb ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 12 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 13 ip_style = lo_style_gr_cornerrt ip_value = zcl_excel_style_fill=>c_fill_gradient_cornerrt ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 13 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 14 ip_style = lo_style_gr_horizontal90 ip_value = zcl_excel_style_fill=>c_fill_gradient_horizontal90 ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 14 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 15 ip_style = lo_style_gr_horizontal270 ip_value = zcl_excel_style_fill=>c_fill_gradient_horizontal270 ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 15 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 16 ip_style = lo_style_gr_horizontalb ip_value = zcl_excel_style_fill=>c_fill_gradient_horizontalb ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 16 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 17 ip_style = lo_style_gr_vertical ip_value = zcl_excel_style_fill=>c_fill_gradient_vertical ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 17 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 18 ip_style = lo_style_gr_vertical2 ip_value = zcl_excel_style_fill=>c_fill_gradient_vertical ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 18 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 19 ip_style = lo_style_gr_fromcenter ip_value = zcl_excel_style_fill=>c_fill_gradient_fromcenter ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 19 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 20 ip_style = lo_style_gr_diagonal45 ip_value = zcl_excel_style_fill=>c_fill_gradient_diagonal45 ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 20 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 21 ip_style = lo_style_gr_diagonal45b ip_value = zcl_excel_style_fill=>c_fill_gradient_diagonal45b ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 21 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 22 ip_style = lo_style_gr_diagonal135 ip_value = zcl_excel_style_fill=>c_fill_gradient_diagonal135 ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 22 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 23 ip_style = lo_style_gr_diagonal135b ip_value = zcl_excel_style_fill=>c_fill_gradient_diagonal135b ).
|
|
||||||
lo_row = lo_worksheet->get_row( ip_row = 23 ).
|
|
||||||
lo_row->set_row_height( ip_row_height = 30 ).
|
|
||||||
|
|
||||||
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL2</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Styles</ENTRY>
|
|
||||||
<LENGTH>25</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,193 +0,0 @@
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* REPORT ZDEMO_EXCEL20
|
|
||||||
* Demo for method zcl_excel_worksheet-bind_alv:
|
|
||||||
* export data from ALV (CL_GUI_ALV_GRID) object to excel
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel20.
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_handle_events DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_handle_events DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS:
|
|
||||||
on_user_command FOR EVENT added_function OF cl_salv_events
|
|
||||||
IMPORTING e_salv_function.
|
|
||||||
ENDCLASS. "lcl_handle_events DEFINITION
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_handle_events IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_handle_events IMPLEMENTATION.
|
|
||||||
METHOD on_user_command.
|
|
||||||
PERFORM user_command." using e_salv_function text-i08.
|
|
||||||
ENDMETHOD. "on_user_command
|
|
||||||
ENDCLASS. "lcl_handle_events IMPLEMENTATION
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* DATA DECLARATION
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_alv TYPE REF TO cl_gui_alv_grid,
|
|
||||||
lo_salv TYPE REF TO cl_salv_table,
|
|
||||||
gr_events TYPE REF TO lcl_handle_events,
|
|
||||||
lr_events TYPE REF TO cl_salv_events_table,
|
|
||||||
gt_sbook TYPE TABLE OF sbook,
|
|
||||||
gt_listheader TYPE slis_t_listheader,
|
|
||||||
wa_listheader LIKE LINE OF gt_listheader.
|
|
||||||
|
|
||||||
DATA: l_path TYPE string, " local dir
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
lv_default_file_name TYPE string VALUE '20_BindAlv.xlsx'.
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
*START-OF-SELECTION
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
* get data
|
|
||||||
* ------------------------------------------
|
|
||||||
|
|
||||||
SELECT *
|
|
||||||
INTO TABLE gt_sbook[]
|
|
||||||
FROM sbook "#EC CI_NOWHERE
|
|
||||||
UP TO 10 ROWS.
|
|
||||||
|
|
||||||
* Display ALV
|
|
||||||
* ------------------------------------------
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
cl_salv_table=>factory(
|
|
||||||
EXPORTING
|
|
||||||
list_display = abap_false
|
|
||||||
IMPORTING
|
|
||||||
r_salv_table = lo_salv
|
|
||||||
CHANGING
|
|
||||||
t_table = gt_sbook[] ).
|
|
||||||
CATCH cx_salv_msg .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
lo_salv->set_screen_status(
|
|
||||||
EXPORTING
|
|
||||||
report = sy-repid
|
|
||||||
pfstatus = 'ALV_STATUS'
|
|
||||||
set_functions = lo_salv->c_functions_all ).
|
|
||||||
CATCH cx_salv_msg .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
lr_events = lo_salv->get_event( ).
|
|
||||||
CREATE OBJECT gr_events.
|
|
||||||
SET HANDLER gr_events->on_user_command FOR lr_events.
|
|
||||||
|
|
||||||
lo_salv->display( ).
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form USER_COMMAND
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
* ALV user command
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM user_command .
|
|
||||||
IF sy-ucomm = 'EXCEL'.
|
|
||||||
|
|
||||||
* get save file path
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = l_path ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
cl_gui_frontend_services=>directory_browse(
|
|
||||||
EXPORTING initial_folder = l_path
|
|
||||||
CHANGING selected_folder = l_path ).
|
|
||||||
|
|
||||||
IF l_path IS INITIAL.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir(
|
|
||||||
CHANGING sapworkdir = lv_workdir ).
|
|
||||||
l_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>get_file_separator(
|
|
||||||
CHANGING file_separator = lv_file_separator ).
|
|
||||||
|
|
||||||
CONCATENATE l_path lv_file_separator lv_default_file_name
|
|
||||||
INTO l_path.
|
|
||||||
|
|
||||||
* export file to save file path
|
|
||||||
|
|
||||||
PERFORM export_to_excel.
|
|
||||||
|
|
||||||
ENDIF.
|
|
||||||
ENDFORM. " USER_COMMAND
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* FORM EXPORT_TO_EXCEL
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* This subroutine is principal demo session
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM export_to_excel.
|
|
||||||
|
|
||||||
* create zcl_excel_worksheet object
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
|
|
||||||
* get ALV object from screen
|
|
||||||
|
|
||||||
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
|
|
||||||
IMPORTING
|
|
||||||
e_grid = lo_alv.
|
|
||||||
|
|
||||||
* build list header
|
|
||||||
|
|
||||||
wa_listheader-typ = 'H'.
|
|
||||||
wa_listheader-info = sy-title.
|
|
||||||
APPEND wa_listheader TO gt_listheader.
|
|
||||||
|
|
||||||
wa_listheader-typ = 'S'.
|
|
||||||
wa_listheader-info = 'Created by: ABAP2XLSX Group'.
|
|
||||||
APPEND wa_listheader TO gt_listheader.
|
|
||||||
|
|
||||||
wa_listheader-typ = 'A'.
|
|
||||||
wa_listheader-info =
|
|
||||||
'Project hosting at https://github.com/abap2xlsx'.
|
|
||||||
APPEND wa_listheader TO gt_listheader.
|
|
||||||
|
|
||||||
* write to excel using method Bin_ALV
|
|
||||||
|
|
||||||
lo_worksheet->bind_alv_ole2(
|
|
||||||
EXPORTING
|
|
||||||
* I_DOCUMENT_URL = SPACE " excel template
|
|
||||||
* I_XLS = 'X' " create in xls format?
|
|
||||||
i_save_path = l_path
|
|
||||||
io_alv = lo_alv
|
|
||||||
it_listheader = gt_listheader
|
|
||||||
i_top = 2
|
|
||||||
i_left = 1
|
|
||||||
* I_COLUMNS_HEADER = 'X'
|
|
||||||
* I_COLUMNS_AUTOFIT = 'X'
|
|
||||||
* I_FORMAT_COL_HEADER =
|
|
||||||
* I_FORMAT_SUBTOTAL =
|
|
||||||
* I_FORMAT_TOTAL =
|
|
||||||
EXCEPTIONS
|
|
||||||
miss_guide = 1
|
|
||||||
ex_transfer_kkblo_error = 2
|
|
||||||
fatal_error = 3
|
|
||||||
inv_data_range = 4
|
|
||||||
dim_mismatch_vkey = 5
|
|
||||||
dim_mismatch_sema = 6
|
|
||||||
error_in_sema = 7
|
|
||||||
OTHERS = 8
|
|
||||||
).
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDFORM. "EXPORT_TO_EXCEL
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,123 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL21
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel21.
|
|
||||||
|
|
||||||
TYPES:
|
|
||||||
BEGIN OF t_color_style,
|
|
||||||
color TYPE zexcel_style_color_argb,
|
|
||||||
style TYPE zexcel_cell_style,
|
|
||||||
END OF t_color_style.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_filled TYPE REF TO zcl_excel_style.
|
|
||||||
|
|
||||||
DATA: color_styles TYPE TABLE OF t_color_style.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <color_style> LIKE LINE OF color_styles.
|
|
||||||
|
|
||||||
CONSTANTS: max TYPE i VALUE 255,
|
|
||||||
step TYPE i VALUE 51.
|
|
||||||
|
|
||||||
DATA: red TYPE i,
|
|
||||||
green TYPE i,
|
|
||||||
blue TYPE i,
|
|
||||||
red_hex(1) TYPE x,
|
|
||||||
green_hex(1) TYPE x,
|
|
||||||
blue_hex(1) TYPE x,
|
|
||||||
red_str TYPE string,
|
|
||||||
green_str TYPE string,
|
|
||||||
blue_str TYPE string.
|
|
||||||
|
|
||||||
DATA: color TYPE zexcel_style_color_argb,
|
|
||||||
tint TYPE zexcel_style_color_tint.
|
|
||||||
|
|
||||||
DATA: row TYPE i,
|
|
||||||
row_tmp TYPE i,
|
|
||||||
column TYPE zexcel_cell_column VALUE 1,
|
|
||||||
col_str TYPE zexcel_cell_column_alpha.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '21_BackgroundColorPicker.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
WHILE red <= max.
|
|
||||||
green = 0.
|
|
||||||
WHILE green <= max.
|
|
||||||
blue = 0.
|
|
||||||
WHILE blue <= max.
|
|
||||||
red_hex = red.
|
|
||||||
red_str = red_hex.
|
|
||||||
green_hex = green.
|
|
||||||
green_str = green_hex.
|
|
||||||
blue_hex = blue.
|
|
||||||
blue_str = blue_hex.
|
|
||||||
" Create filled
|
|
||||||
CONCATENATE 'FF' red_str green_str blue_str INTO color.
|
|
||||||
APPEND INITIAL LINE TO color_styles ASSIGNING <color_style>.
|
|
||||||
lo_style_filled = lo_excel->add_new_style( ).
|
|
||||||
lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled->fill->fgcolor-rgb = color.
|
|
||||||
<color_style>-color = color.
|
|
||||||
<color_style>-style = lo_style_filled->get_guid( ).
|
|
||||||
blue = blue + step.
|
|
||||||
ENDWHILE.
|
|
||||||
green = green + step.
|
|
||||||
ENDWHILE.
|
|
||||||
red = red + step.
|
|
||||||
ENDWHILE.
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Color Picker' ).
|
|
||||||
LOOP AT color_styles ASSIGNING <color_style>.
|
|
||||||
row_tmp = ( max / step + 1 ) * 3.
|
|
||||||
IF row = row_tmp.
|
|
||||||
row = 0.
|
|
||||||
column = column + 1.
|
|
||||||
ENDIF.
|
|
||||||
row = row + 1.
|
|
||||||
col_str = zcl_excel_common=>convert_column2alpha( column ).
|
|
||||||
|
|
||||||
" Fill the cell and apply one style
|
|
||||||
lo_worksheet->set_cell( ip_column = col_str
|
|
||||||
ip_row = row
|
|
||||||
ip_value = <color_style>-color
|
|
||||||
ip_style = <color_style>-style ).
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
row = row + 2.
|
|
||||||
tint = '-0.5'.
|
|
||||||
DO 10 TIMES.
|
|
||||||
column = 1.
|
|
||||||
DO 10 TIMES.
|
|
||||||
lo_style_filled = lo_excel->add_new_style( ).
|
|
||||||
lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled->fill->fgcolor-theme = sy-index - 1.
|
|
||||||
lo_style_filled->fill->fgcolor-tint = tint.
|
|
||||||
<color_style>-style = lo_style_filled->get_guid( ).
|
|
||||||
col_str = zcl_excel_common=>convert_column2alpha( column ).
|
|
||||||
lo_worksheet->set_cell_style( ip_column = col_str
|
|
||||||
ip_row = row
|
|
||||||
ip_style = <color_style>-style ).
|
|
||||||
|
|
||||||
ADD 1 TO column.
|
|
||||||
ENDDO.
|
|
||||||
ADD '0.1' TO tint.
|
|
||||||
ADD 1 TO row.
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL21</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo:</ENTRY>
|
|
||||||
<LENGTH>15</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,176 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL22
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel22.
|
|
||||||
|
|
||||||
TYPES: ty_sflight_lines TYPE TABLE OF sflight.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_date TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_editable TYPE REF TO zcl_excel_style,
|
|
||||||
lo_data_validation TYPE REF TO zcl_excel_data_validation.
|
|
||||||
|
|
||||||
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog,
|
|
||||||
ls_table_settings TYPE zexcel_s_table_settings,
|
|
||||||
ls_table_settings_out TYPE zexcel_s_table_settings.
|
|
||||||
|
|
||||||
DATA: lv_style_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: lv_row TYPE char10.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <fs_field_catalog> TYPE zexcel_s_fieldcatalog.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '22_itab_fieldcatalog.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'PN_MASSIVE' ).
|
|
||||||
|
|
||||||
DATA lt_test TYPE ty_sflight_lines.
|
|
||||||
PERFORM load_fixed_data CHANGING lt_test.
|
|
||||||
|
|
||||||
" sheet style (white background)
|
|
||||||
lo_style = lo_excel->add_new_style( ).
|
|
||||||
lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style->fill->fgcolor-rgb = zcl_excel_style_color=>c_white.
|
|
||||||
lv_style_guid = lo_style->get_guid( ).
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~set_style( lv_style_guid ).
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~password = zcl_excel_common=>encrypt_password( 'test' ).
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~sheet = zif_excel_sheet_protection=>c_active.
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~objects = zif_excel_sheet_protection=>c_active.
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~scenarios = zif_excel_sheet_protection=>c_active.
|
|
||||||
|
|
||||||
" Create cell style for display only fields
|
|
||||||
lo_style = lo_excel->add_new_style( ).
|
|
||||||
lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style->fill->fgcolor-rgb = zcl_excel_style_color=>c_gray.
|
|
||||||
lo_style->number_format->format_code = zcl_excel_style_number_format=>c_format_text.
|
|
||||||
|
|
||||||
" Create cell style for display only date field
|
|
||||||
lo_style_date = lo_excel->add_new_style( ).
|
|
||||||
lo_style_date->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_date->fill->fgcolor-rgb = zcl_excel_style_color=>c_gray.
|
|
||||||
lo_style_date->number_format->format_code = zcl_excel_style_number_format=>c_format_date_ddmmyyyy.
|
|
||||||
|
|
||||||
" Create cell style for editable fields
|
|
||||||
lo_style_editable = lo_excel->add_new_style( ).
|
|
||||||
lo_style_editable->protection->locked = zcl_excel_style_protection=>c_protection_unlocked.
|
|
||||||
|
|
||||||
lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = lt_test ).
|
|
||||||
|
|
||||||
LOOP AT lt_field_catalog ASSIGNING <fs_field_catalog>.
|
|
||||||
CASE <fs_field_catalog>-fieldname.
|
|
||||||
WHEN 'CARRID'.
|
|
||||||
<fs_field_catalog>-position = 3.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-style = lo_style->get_guid( ).
|
|
||||||
WHEN 'CONNID'.
|
|
||||||
<fs_field_catalog>-position = 1.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-style = lo_style->get_guid( ).
|
|
||||||
<fs_field_catalog>-scrtext_m = |Flight\r\nNumber|. " Demonstrates header on 2 lines
|
|
||||||
WHEN 'FLDATE'.
|
|
||||||
<fs_field_catalog>-position = 2.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-style = lo_style_date->get_guid( ).
|
|
||||||
WHEN 'PRICE'.
|
|
||||||
<fs_field_catalog>-position = 4.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_true.
|
|
||||||
<fs_field_catalog>-style = lo_style_editable->get_guid( ).
|
|
||||||
<fs_field_catalog>-totals_function = zcl_excel_table=>totals_function_sum.
|
|
||||||
WHEN OTHERS.
|
|
||||||
<fs_field_catalog>-dynpfld = abap_false.
|
|
||||||
ENDCASE.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
|
|
||||||
ls_table_settings-show_row_stripes = abap_true.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table( EXPORTING
|
|
||||||
ip_table = lt_test
|
|
||||||
it_field_catalog = lt_field_catalog
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
IMPORTING
|
|
||||||
es_table_settings = ls_table_settings_out ).
|
|
||||||
|
|
||||||
lo_worksheet->freeze_panes( ip_num_rows = 3 ). "freeze column headers when scrolling
|
|
||||||
|
|
||||||
lo_data_validation = lo_worksheet->add_new_data_validation( ).
|
|
||||||
lo_data_validation->type = zcl_excel_data_validation=>c_type_custom.
|
|
||||||
lv_row = ls_table_settings_out-top_left_row.
|
|
||||||
CONDENSE lv_row.
|
|
||||||
CONCATENATE 'ISNUMBER(' ls_table_settings_out-top_left_column lv_row ')' INTO lo_data_validation->formula1.
|
|
||||||
lo_data_validation->cell_row = ls_table_settings_out-top_left_row.
|
|
||||||
lo_data_validation->cell_column = ls_table_settings_out-top_left_column.
|
|
||||||
lo_data_validation->cell_row_to = ls_table_settings_out-bottom_right_row.
|
|
||||||
lo_data_validation->cell_column_to = ls_table_settings_out-bottom_right_column.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
||||||
|
|
||||||
|
|
||||||
FORM load_fixed_data CHANGING ct_test TYPE ty_sflight_lines.
|
|
||||||
DATA: lt_lines TYPE TABLE OF string,
|
|
||||||
lv_line TYPE string,
|
|
||||||
lt_fields TYPE TABLE OF string,
|
|
||||||
lv_comp TYPE i,
|
|
||||||
lv_field TYPE string,
|
|
||||||
ls_test TYPE sflight.
|
|
||||||
FIELD-SYMBOLS: <lv_field> TYPE simple.
|
|
||||||
|
|
||||||
APPEND 'AA 0017 20171219 422 USD 747-400 385 371 191334 31 28 21 21' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20180309 422 USD 747-400 385 365 189984 31 29 21 20' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20180528 422 USD 747-400 385 374 193482 31 30 21 20' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20180816 422 USD 747-400 385 372 193127 31 30 21 20' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20181104 422 USD 747-400 385 44 23908 31 4 21 3' TO lt_lines.
|
|
||||||
APPEND 'AA 0017 20190123 422 USD 747-400 385 40 20347 31 3 21 2' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20171219 185 EUR 737-800 140 133 32143 12 12 10 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20180309 185 EUR 737-800 140 137 32595 12 12 10 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20180528 185 EUR 737-800 140 134 31899 12 11 10 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20180816 185 EUR 737-800 140 128 29775 12 10 10 9' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20181104 185 EUR 737-800 140 0 0 12 0 10 0' TO lt_lines.
|
|
||||||
APPEND 'AZ 0555 20190123 185 EUR 737-800 140 23 5392 12 1 10 2' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20171219 1030 EUR 767-200 260 250 307176 21 20 11 11' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20180309 1030 EUR 767-200 260 252 306054 21 20 11 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20180528 1030 EUR 767-200 260 252 307063 21 20 11 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20180816 1030 EUR 767-200 260 249 300739 21 19 11 10' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20181104 1030 EUR 767-200 260 104 127647 21 8 11 5' TO lt_lines.
|
|
||||||
APPEND 'AZ 0789 20190123 1030 EUR 767-200 260 18 22268 21 1 11 1' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20171217 611 USD A380-800 475 458 324379 30 29 20 20' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20180307 611 USD A380-800 475 458 324330 30 30 20 20' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20180526 611 USD A380-800 475 459 328149 30 29 20 20' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20180814 611 USD A380-800 475 462 326805 30 30 20 18' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20181102 611 USD A380-800 475 167 115554 30 10 20 6' TO lt_lines.
|
|
||||||
APPEND 'DL 0106 20190121 611 USD A380-800 475 11 9073 30 1 20 1' TO lt_lines.
|
|
||||||
LOOP AT lt_lines INTO lv_line.
|
|
||||||
CONDENSE lv_line.
|
|
||||||
SPLIT lv_line AT space INTO TABLE lt_fields.
|
|
||||||
lv_comp = 2.
|
|
||||||
LOOP AT lt_fields INTO lv_field.
|
|
||||||
ASSIGN COMPONENT lv_comp OF STRUCTURE ls_test TO <lv_field>.
|
|
||||||
<lv_field> = lv_field.
|
|
||||||
lv_comp = lv_comp + 1.
|
|
||||||
ENDLOOP.
|
|
||||||
APPEND ls_test TO ct_test.
|
|
||||||
ENDLOOP.
|
|
||||||
ENDFORM.
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL22</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Export internal table</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,88 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL23
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel23.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '23_Sheets_with_and_without_grid_lines.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the first sheet with grid lines and print centered horizontal & vertical' ).
|
|
||||||
lo_worksheet->set_show_gridlines( i_show_gridlines = abap_true ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet2!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is a link to the second sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale = 150.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale_normal = 150.
|
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->vertical_centered = abap_true.
|
|
||||||
lo_worksheet->sheet_setup->horizontal_centered = abap_true.
|
|
||||||
|
|
||||||
" Second sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the second sheet with grid lines in display and print' ).
|
|
||||||
lo_worksheet->set_show_gridlines( i_show_gridlines = abap_true ).
|
|
||||||
lo_worksheet->set_print_gridlines( i_print_gridlines = abap_true ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet3!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to the third sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale = 160.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale_pagelayoutview = 200.
|
|
||||||
|
|
||||||
" Third sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet3' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the third sheet without grid lines in display and print' ).
|
|
||||||
lo_worksheet->set_show_gridlines( i_show_gridlines = abap_false ).
|
|
||||||
lo_worksheet->set_print_gridlines( i_print_gridlines = abap_false ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet4!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to the fourth sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale = 170.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview = 150.
|
|
||||||
|
|
||||||
" Fourth sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet4' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the fourth sheet with grid lines and print centered ONLY horizontal' ).
|
|
||||||
lo_worksheet->set_show_gridlines( i_show_gridlines = abap_true ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to the first sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale = 150.
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~zoomscale_normal = 150.
|
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->horizontal_centered = abap_true.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL23</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Multiple sheets with and w/o grid lines, print options</ENTRY>
|
|
||||||
<LENGTH>70</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,109 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL23
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel24.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
DATA: lv_value TYPE string.
|
|
||||||
DATA: lv_date TYPE d VALUE '19000226',
|
|
||||||
lv_row TYPE i.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '24_Sheets_with_different_default_date_formats.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'Default Date Format' ).
|
|
||||||
" Insert date
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = 'Date:' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 4 ip_value = lv_date ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet2!A1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 6 ip_value = 'This is a link to the second sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'A' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
|
|
||||||
|
|
||||||
" Second sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_default_excel_date_format( zcl_excel_style_number_format=>c_format_date_yyyymmdd ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'Date Format set to YYYYMMDD' ).
|
|
||||||
" Insert current date
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = 'Date:' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 4 ip_value = lv_date ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet3!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 6 ip_value = 'This is link to the third sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
" Third sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
" TODO: It seems that the zcl_excel_style_number_format=>c_format_date_yyyymmddslash
|
|
||||||
" does not produce a valid output
|
|
||||||
lo_worksheet->set_default_excel_date_format( zcl_excel_style_number_format=>c_format_date_yyyymmddslash ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet3' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'Date Format set to YYYY/MM/DD' ).
|
|
||||||
" Insert current date
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = 'Date:' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 4 ip_value = lv_date ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet4!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 6 ip_value = 'This is link to the 4th sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
" 4th sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
" Illustrate the Problem caused by:
|
|
||||||
" Excel 2000 incorrectly assumes that the year 1900 is a leap year.
|
|
||||||
" http://support.microsoft.com/kb/214326/en-us
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet4' ).
|
|
||||||
" Loop from Start Date to the Max Date current data in daily steps
|
|
||||||
CONSTANTS: lv_max TYPE d VALUE '19000302'.
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'Formated date' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Integer value for this date' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 3 ip_value = 'Date as string' ).
|
|
||||||
|
|
||||||
lv_row = 4.
|
|
||||||
WHILE lv_date < lv_max.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = lv_row ip_value = lv_date ).
|
|
||||||
lv_value = zcl_excel_common=>date_to_excel_string( lv_date ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = lv_row ip_value = lv_value ).
|
|
||||||
lv_value = lv_date.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = lv_row ip_value = lv_value ).
|
|
||||||
lv_date = lv_date + 1.
|
|
||||||
lv_row = lv_row + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
|
|
||||||
lv_row = lv_row + 1.
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = lv_row ip_value = 'This is link to the first sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
lo_excel->set_active_sheet_index_by_name( 'Sheet1' ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL24</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Multiple sheets with different default date formats</ENTRY>
|
|
||||||
<LENGTH>70</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,169 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL25
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel25.
|
|
||||||
|
|
||||||
TYPES: BEGIN OF ty_f4_path,
|
|
||||||
pathintern TYPE filepath-pathintern,
|
|
||||||
pathname TYPE pathtext-pathname,
|
|
||||||
pathextern TYPE path-pathextern,
|
|
||||||
END OF ty_f4_path.
|
|
||||||
|
|
||||||
DATA: lt_r_fldval TYPE RANGE OF filepath-pathintern,
|
|
||||||
lt_value TYPE TABLE OF ty_f4_path,
|
|
||||||
ls_value TYPE ty_f4_path.
|
|
||||||
|
|
||||||
PARAMETERS log_path TYPE filepath-pathintern DEFAULT 'LOCAL_TEMPORARY_FILES'.
|
|
||||||
SELECTION-SCREEN COMMENT /35(83) physpath.
|
|
||||||
PARAMETERS filename TYPE string LOWER CASE DEFAULT '25_HelloWorld.xlsx'.
|
|
||||||
PARAMETERS param_1 TYPE string LOWER CASE.
|
|
||||||
PARAMETERS param_2 TYPE string LOWER CASE.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN OUTPUT.
|
|
||||||
|
|
||||||
PERFORM read_file_paths.
|
|
||||||
READ TABLE lt_value WITH KEY pathintern = log_path INTO ls_value.
|
|
||||||
physpath = ls_value-pathextern.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR log_path.
|
|
||||||
|
|
||||||
DATA: lt_return TYPE TABLE OF ddshretval,
|
|
||||||
ls_return TYPE ddshretval,
|
|
||||||
lt_dynpfield TYPE TABLE OF dynpread,
|
|
||||||
ls_dynpfield TYPE dynpread.
|
|
||||||
|
|
||||||
CALL FUNCTION 'DYNP_VALUES_READ'
|
|
||||||
EXPORTING
|
|
||||||
dyname = sy-repid
|
|
||||||
dynumb = sy-dynnr
|
|
||||||
request = 'A' " read all screen fields
|
|
||||||
TABLES
|
|
||||||
dynpfields = lt_dynpfield
|
|
||||||
EXCEPTIONS
|
|
||||||
OTHERS = 9.
|
|
||||||
|
|
||||||
READ TABLE lt_dynpfield WITH KEY fieldname = 'LOG_PATH' INTO ls_dynpfield.
|
|
||||||
log_path = ls_dynpfield-fieldvalue.
|
|
||||||
|
|
||||||
PERFORM read_file_paths.
|
|
||||||
|
|
||||||
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
|
|
||||||
EXPORTING
|
|
||||||
value_org = 'S'
|
|
||||||
multiple_choice = ' '
|
|
||||||
retfield = 'PATHINTERN'
|
|
||||||
TABLES
|
|
||||||
value_tab = lt_value
|
|
||||||
return_tab = lt_return
|
|
||||||
EXCEPTIONS
|
|
||||||
OTHERS = 0.
|
|
||||||
|
|
||||||
IF lt_return IS INITIAL.
|
|
||||||
RETURN.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
READ TABLE lt_return INDEX 1 INTO ls_return.
|
|
||||||
READ TABLE lt_value WITH KEY pathintern = ls_return-fieldval INTO ls_value.
|
|
||||||
|
|
||||||
DELETE lt_dynpfield WHERE fieldname = 'LOG_PATH' OR fieldname = 'PHYSPATH'.
|
|
||||||
ls_dynpfield-fieldname = 'LOG_PATH'.
|
|
||||||
ls_dynpfield-fieldvalue = ls_value-pathintern.
|
|
||||||
APPEND ls_dynpfield TO lt_dynpfield.
|
|
||||||
ls_dynpfield-fieldname = 'PHYSPATH'.
|
|
||||||
ls_dynpfield-fieldvalue = ls_value-pathextern.
|
|
||||||
APPEND ls_dynpfield TO lt_dynpfield.
|
|
||||||
|
|
||||||
CALL FUNCTION 'DYNP_VALUES_UPDATE'
|
|
||||||
EXPORTING
|
|
||||||
dyname = sy-repid
|
|
||||||
dynumb = sy-dynnr
|
|
||||||
TABLES
|
|
||||||
dynpfields = lt_dynpfield
|
|
||||||
EXCEPTIONS
|
|
||||||
OTHERS = 8.
|
|
||||||
|
|
||||||
FORM read_file_paths.
|
|
||||||
|
|
||||||
DATA: ls_r_fldval LIKE LINE OF lt_r_fldval.
|
|
||||||
|
|
||||||
CLEAR lt_r_fldval.
|
|
||||||
IF log_path CA '*'.
|
|
||||||
ls_r_fldval-sign = 'I'.
|
|
||||||
ls_r_fldval-option = 'CP'.
|
|
||||||
ls_r_fldval-low = log_path.
|
|
||||||
APPEND ls_r_fldval TO lt_r_fldval.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
SELECT filepath~pathintern pathtext~pathname path~pathextern
|
|
||||||
FROM filepath
|
|
||||||
INNER JOIN path ON path~pathintern = filepath~pathintern
|
|
||||||
INNER JOIN opsystem ON opsystem~filesys = path~filesys AND opsystem~opsys = sy-opsys
|
|
||||||
LEFT JOIN pathtext ON pathtext~pathintern = filepath~pathintern AND pathtext~language = sy-langu
|
|
||||||
INTO TABLE lt_value
|
|
||||||
WHERE filepath~pathintern IN lt_r_fldval.
|
|
||||||
|
|
||||||
ENDFORM.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel.
|
|
||||||
DATA: lo_excel_writer TYPE REF TO zif_excel_writer.
|
|
||||||
DATA: lo_worksheet TYPE REF TO zcl_excel_worksheet.
|
|
||||||
DATA: lo_exception TYPE REF TO cx_root.
|
|
||||||
DATA: lv_file TYPE xstring.
|
|
||||||
DATA: lv_default_file_name TYPE string.
|
|
||||||
DATA: lv_default_file_name2 TYPE c LENGTH 255.
|
|
||||||
DATA: lv_error TYPE string.
|
|
||||||
|
|
||||||
CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
|
|
||||||
EXPORTING
|
|
||||||
logical_path = log_path
|
|
||||||
file_name = filename
|
|
||||||
parameter_1 = param_1
|
|
||||||
parameter_2 = param_2
|
|
||||||
IMPORTING
|
|
||||||
file_name_with_path = lv_default_file_name " File name with path
|
|
||||||
EXCEPTIONS
|
|
||||||
other = 1.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
|
|
||||||
lv_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
OPEN DATASET lv_default_file_name FOR OUTPUT IN BINARY MODE.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
RAISE EXCEPTION TYPE cx_sy_file_open
|
|
||||||
EXPORTING
|
|
||||||
filename = lv_default_file_name
|
|
||||||
errorcode = sy-subrc
|
|
||||||
errortext = |Cannot create or open file - Check Tx FILE Logical Path 'LOCAL_TEMPORARY_FILES'|.
|
|
||||||
ENDIF.
|
|
||||||
TRANSFER lv_file TO lv_default_file_name.
|
|
||||||
|
|
||||||
CLOSE DATASET lv_default_file_name.
|
|
||||||
CATCH cx_root INTO lo_exception.
|
|
||||||
lv_error = lo_exception->get_text( ).
|
|
||||||
MESSAGE lv_error TYPE 'I'.
|
|
||||||
STOP.
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
lv_default_file_name2 = lv_default_file_name.
|
|
||||||
SET PARAMETER ID 'GR8' FIELD lv_default_file_name2.
|
|
||||||
SUBMIT zdemo_excel37 VIA SELECTION-SCREEN WITH p_applse = abap_true AND RETURN.
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL25</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Write Hello World using Logical Path on the App Server</ENTRY>
|
|
||||||
<LENGTH>70</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,207 +0,0 @@
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* REPORT ZDEMO_EXCEL26
|
|
||||||
* Demo for method zcl_excel_worksheet-bind_object:
|
|
||||||
* export data from ALV (CL_GUI_ALV_GRID) object or cl_salv_table object
|
|
||||||
* to Excel.
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel26.
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_handle_events DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_handle_events DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS:
|
|
||||||
on_user_command FOR EVENT added_function OF cl_salv_events
|
|
||||||
IMPORTING e_salv_function.
|
|
||||||
ENDCLASS. "lcl_handle_events DEFINITION
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_handle_events IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_handle_events IMPLEMENTATION.
|
|
||||||
METHOD on_user_command.
|
|
||||||
PERFORM user_command." using e_salv_function text-i08.
|
|
||||||
ENDMETHOD. "on_user_command
|
|
||||||
ENDCLASS. "lcl_handle_events IMPLEMENTATION
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* DATA DECLARATION
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_salv TYPE REF TO cl_salv_table,
|
|
||||||
gr_events TYPE REF TO lcl_handle_events,
|
|
||||||
lr_events TYPE REF TO cl_salv_events_table,
|
|
||||||
gt_sbook TYPE TABLE OF sbook.
|
|
||||||
|
|
||||||
DATA: l_path TYPE string, " local dir
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
lv_default_file_name TYPE string VALUE '26_Bind_ALV.xlsx'.
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
*START-OF-SELECTION
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
* get data
|
|
||||||
* ------------------------------------------
|
|
||||||
|
|
||||||
SELECT *
|
|
||||||
INTO TABLE gt_sbook[]
|
|
||||||
FROM sbook "#EC CI_NOWHERE
|
|
||||||
UP TO 10 ROWS.
|
|
||||||
|
|
||||||
* Display ALV
|
|
||||||
* ------------------------------------------
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
cl_salv_table=>factory(
|
|
||||||
EXPORTING
|
|
||||||
list_display = abap_false
|
|
||||||
IMPORTING
|
|
||||||
r_salv_table = lo_salv
|
|
||||||
CHANGING
|
|
||||||
t_table = gt_sbook[] ).
|
|
||||||
CATCH cx_salv_msg .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
lo_salv->set_screen_status(
|
|
||||||
EXPORTING
|
|
||||||
report = sy-repid
|
|
||||||
pfstatus = 'ALV_STATUS'
|
|
||||||
set_functions = lo_salv->c_functions_all ).
|
|
||||||
CATCH cx_salv_msg .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
lr_events = lo_salv->get_event( ).
|
|
||||||
CREATE OBJECT gr_events.
|
|
||||||
SET HANDLER gr_events->on_user_command FOR lr_events.
|
|
||||||
|
|
||||||
lo_salv->display( ).
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form USER_COMMAND
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
* ALV user command
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM user_command .
|
|
||||||
DATA: lo_error TYPE REF TO zcx_excel,
|
|
||||||
lv_message TYPE string.
|
|
||||||
IF sy-ucomm = 'EXCEL'.
|
|
||||||
|
|
||||||
* get save file path
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = l_path ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
cl_gui_frontend_services=>directory_browse(
|
|
||||||
EXPORTING initial_folder = l_path
|
|
||||||
CHANGING selected_folder = l_path ).
|
|
||||||
|
|
||||||
IF l_path IS INITIAL.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir(
|
|
||||||
CHANGING sapworkdir = lv_workdir ).
|
|
||||||
l_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>get_file_separator(
|
|
||||||
CHANGING file_separator = lv_file_separator ).
|
|
||||||
|
|
||||||
CONCATENATE l_path lv_file_separator lv_default_file_name
|
|
||||||
INTO l_path.
|
|
||||||
|
|
||||||
* export file to save file path
|
|
||||||
TRY.
|
|
||||||
PERFORM export_to_excel.
|
|
||||||
CATCH zcx_excel INTO lo_error.
|
|
||||||
lv_message = lo_error->get_text( ).
|
|
||||||
MESSAGE lv_message TYPE 'I' DISPLAY LIKE 'E'.
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
ENDIF.
|
|
||||||
ENDFORM. " USER_COMMAND
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* FORM EXPORT_TO_EXCEL
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* This subroutine is principal demo session
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM export_to_excel RAISING zcx_excel.
|
|
||||||
DATA: lo_error TYPE REF TO zcx_excel,
|
|
||||||
lv_message TYPE string.
|
|
||||||
|
|
||||||
* create zcl_excel_worksheet object
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
|
|
||||||
* write to excel using method Bin_object
|
|
||||||
lo_worksheet->bind_alv(
|
|
||||||
io_alv = lo_salv
|
|
||||||
it_table = gt_sbook
|
|
||||||
i_top = 2
|
|
||||||
i_left = 1
|
|
||||||
).
|
|
||||||
|
|
||||||
PERFORM write_file.
|
|
||||||
|
|
||||||
ENDFORM. "EXPORT_TO_EXCEL
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form WRITE_FILE
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
* text
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* --> p1 text
|
|
||||||
* <-- p2 text
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
FORM write_file RAISING zcx_excel.
|
|
||||||
DATA: lt_file TYPE solix_tab,
|
|
||||||
l_bytecount TYPE i,
|
|
||||||
l_file TYPE xstring.
|
|
||||||
|
|
||||||
DATA: lo_excel_writer TYPE REF TO zif_excel_writer.
|
|
||||||
|
|
||||||
DATA: ls_seoclass TYPE seoclass.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
|
|
||||||
l_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
|
|
||||||
SELECT SINGLE * INTO ls_seoclass
|
|
||||||
FROM seoclass
|
|
||||||
WHERE clsname = 'CL_BCS_CONVERT'.
|
|
||||||
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
CALL METHOD (ls_seoclass-clsname)=>xstring_to_solix
|
|
||||||
EXPORTING
|
|
||||||
iv_xstring = l_file
|
|
||||||
RECEIVING
|
|
||||||
et_solix = lt_file.
|
|
||||||
|
|
||||||
l_bytecount = xstrlen( l_file ).
|
|
||||||
ELSE.
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = l_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = l_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = l_bytecount
|
|
||||||
filename = l_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file ).
|
|
||||||
|
|
||||||
ENDFORM. " WRITE_FILE
|
|
|
@ -1,991 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL26</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<CUA>
|
|
||||||
<ADM>
|
|
||||||
<ACTCODE>000010</ACTCODE>
|
|
||||||
<PFKCODE>000010</PFKCODE>
|
|
||||||
</ADM>
|
|
||||||
<STA>
|
|
||||||
<RSMPE_STAT>
|
|
||||||
<CODE>ALV_STATUS</CODE>
|
|
||||||
<MODAL>D</MODAL>
|
|
||||||
<ACTCODE>000001</ACTCODE>
|
|
||||||
<PFKCODE>000001</PFKCODE>
|
|
||||||
<BUTCODE>0001</BUTCODE>
|
|
||||||
<INT_NOTE>Standard for General List Output</INT_NOTE>
|
|
||||||
</RSMPE_STAT>
|
|
||||||
</STA>
|
|
||||||
<FUN>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>%PC</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_EXPORT</TEXT_NAME>
|
|
||||||
<ICON_ID>@49@</ICON_ID>
|
|
||||||
<FUN_TEXT>Local file...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>%SC</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SEARCH</TEXT_NAME>
|
|
||||||
<ICON_ID>@13@</ICON_ID>
|
|
||||||
<FUN_TEXT>Find</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>%SC+</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SEARCH_NEXT</TEXT_NAME>
|
|
||||||
<ICON_ID>@4E@</ICON_ID>
|
|
||||||
<FUN_TEXT>Find next</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>%SL</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Mail recipient</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&ABC</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>ABC Analysis</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&ALL</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SELECT_ALL</TEXT_NAME>
|
|
||||||
<ICON_ID>@4B@</ICON_ID>
|
|
||||||
<FUN_TEXT>Select all</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&AQW</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Word processing...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&AVE</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_ALV_VARIANT_SAVE</TEXT_NAME>
|
|
||||||
<ICON_ID>@DN@</ICON_ID>
|
|
||||||
<FUN_TEXT>Save layout...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&CRB</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_TOTAL_LEFT</TEXT_NAME>
|
|
||||||
<ICON_ID>@0B@</ICON_ID>
|
|
||||||
<FUN_TEXT>First Column</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&CRE</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_TOTAL_RIGHT</TEXT_NAME>
|
|
||||||
<ICON_ID>@0C@</ICON_ID>
|
|
||||||
<FUN_TEXT>Last column</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&CRL</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_COLUMN_LEFT</TEXT_NAME>
|
|
||||||
<ICON_ID>@0D@</ICON_ID>
|
|
||||||
<FUN_TEXT>Column left</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&CRR</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_COLUMN_RIGHT</TEXT_NAME>
|
|
||||||
<ICON_ID>@0E@</ICON_ID>
|
|
||||||
<FUN_TEXT>Column right</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&EB9</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_TABLE_SETTINGS</TEXT_NAME>
|
|
||||||
<ICON_ID>@36@</ICON_ID>
|
|
||||||
<FUN_TEXT>Call Up Report</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&ETA</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SELECT_DETAIL</TEXT_NAME>
|
|
||||||
<ICON_ID>@16@</ICON_ID>
|
|
||||||
<FUN_TEXT>Details</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&F03</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Back</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&F12</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_CANCEL</TEXT_NAME>
|
|
||||||
<ICON_ID>@0W@</ICON_ID>
|
|
||||||
<FUN_TEXT>Cancel</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&F15</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Exit</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&IC1</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SELECT_DETAIL</TEXT_NAME>
|
|
||||||
<ICON_ID>@16@</ICON_ID>
|
|
||||||
<FUN_TEXT>Choose</FUN_TEXT>
|
|
||||||
<PATH>S</PATH>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&ILD</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_FILTER_UNDO</TEXT_NAME>
|
|
||||||
<ICON_ID>@GD@</ICON_ID>
|
|
||||||
<FUN_TEXT>Delete Filter</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&ILT</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_FILTER</TEXT_NAME>
|
|
||||||
<ICON_ID>@4G@</ICON_ID>
|
|
||||||
<FUN_TEXT>Set filter</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&LFO</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_INFORMATION</TEXT_NAME>
|
|
||||||
<ICON_ID>@0S@</ICON_ID>
|
|
||||||
<FUN_TEXT>List status...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&NFO</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_INFORMATION</TEXT_NAME>
|
|
||||||
<ICON_ID>@0S@</ICON_ID>
|
|
||||||
<FUN_TEXT>Selections...</FUN_TEXT>
|
|
||||||
<INFO_TEXT>Selections</INFO_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&NTE</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Refresh</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&OAD</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_ALV_VARIANT_CHOOSE</TEXT_NAME>
|
|
||||||
<ICON_ID>@DM@</ICON_ID>
|
|
||||||
<FUN_TEXT>Select layout...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&ODN</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SORT_DOWN</TEXT_NAME>
|
|
||||||
<ICON_ID>@3F@</ICON_ID>
|
|
||||||
<FUN_TEXT>Sort in descendin.</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&OL0</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_ALV_VARIANTS</TEXT_NAME>
|
|
||||||
<ICON_ID>@LZ@</ICON_ID>
|
|
||||||
<FUN_TEXT>Change layout...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&OMP</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Collapse</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&OUP</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SORT_UP</TEXT_NAME>
|
|
||||||
<ICON_ID>@3E@</ICON_ID>
|
|
||||||
<FUN_TEXT>Sort in Ascending...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&RNT</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_PRINT</TEXT_NAME>
|
|
||||||
<ICON_ID>@0X@</ICON_ID>
|
|
||||||
<FUN_TEXT>Print</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&RNT_PREV</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Print preview</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&SAL</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_DESELECT_ALL</TEXT_NAME>
|
|
||||||
<ICON_ID>@4D@</ICON_ID>
|
|
||||||
<FUN_TEXT>Deselect all</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&SUM</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_INTERMEDIATE_SUM</TEXT_NAME>
|
|
||||||
<ICON_ID>@5V@</ICON_ID>
|
|
||||||
<FUN_TEXT>Subtotals...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&UMC</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_SUM</TEXT_NAME>
|
|
||||||
<ICON_ID>@3Z@</ICON_ID>
|
|
||||||
<FUN_TEXT>Total</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&XML</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>XML Export...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&XPA</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Expand</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>&XXL</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>Spreadsheet...</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>EXCEL</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_XLV</TEXT_NAME>
|
|
||||||
<ICON_ID>@J3@</ICON_ID>
|
|
||||||
<FUN_TEXT>Excel</FUN_TEXT>
|
|
||||||
<ICON_TEXT>Export to Excel</ICON_TEXT>
|
|
||||||
<INFO_TEXT>Export to Excel</INFO_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>P</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<FUN_TEXT>First Page</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>P+</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_NEXT_PAGE</TEXT_NAME>
|
|
||||||
<ICON_ID>@30@</ICON_ID>
|
|
||||||
<FUN_TEXT>Next page</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>P++</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_LAST_PAGE</TEXT_NAME>
|
|
||||||
<ICON_ID>@31@</ICON_ID>
|
|
||||||
<FUN_TEXT>Last Page</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>P-</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_PREVIOUS_PAGE</TEXT_NAME>
|
|
||||||
<ICON_ID>@2Z@</ICON_ID>
|
|
||||||
<FUN_TEXT>Previous Page</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
<RSMPE_FUNT>
|
|
||||||
<CODE>P--</CODE>
|
|
||||||
<TEXTNO>001</TEXTNO>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT_NAME>ICON_FIRST_PAGE</TEXT_NAME>
|
|
||||||
<ICON_ID>@2Y@</ICON_ID>
|
|
||||||
<FUN_TEXT>First Page</FUN_TEXT>
|
|
||||||
</RSMPE_FUNT>
|
|
||||||
</FUN>
|
|
||||||
<MTX>
|
|
||||||
<RSMPE_MNLT>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT>List</TEXT>
|
|
||||||
</RSMPE_MNLT>
|
|
||||||
<RSMPE_MNLT>
|
|
||||||
<CODE>000002</CODE>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT>Edit</TEXT>
|
|
||||||
</RSMPE_MNLT>
|
|
||||||
<RSMPE_MNLT>
|
|
||||||
<CODE>000003</CODE>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT>Goto</TEXT>
|
|
||||||
</RSMPE_MNLT>
|
|
||||||
<RSMPE_MNLT>
|
|
||||||
<CODE>000004</CODE>
|
|
||||||
<TEXT_TYPE>S</TEXT_TYPE>
|
|
||||||
<TEXT>Settings</TEXT>
|
|
||||||
</RSMPE_MNLT>
|
|
||||||
</MTX>
|
|
||||||
<ACT>
|
|
||||||
<RSMPE_ACT>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<NO>01</NO>
|
|
||||||
<MENUCODE>000001</MENUCODE>
|
|
||||||
</RSMPE_ACT>
|
|
||||||
<RSMPE_ACT>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<NO>02</NO>
|
|
||||||
<MENUCODE>000002</MENUCODE>
|
|
||||||
</RSMPE_ACT>
|
|
||||||
<RSMPE_ACT>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<NO>03</NO>
|
|
||||||
<MENUCODE>000003</MENUCODE>
|
|
||||||
</RSMPE_ACT>
|
|
||||||
<RSMPE_ACT>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<NO>04</NO>
|
|
||||||
<MENUCODE>000004</MENUCODE>
|
|
||||||
</RSMPE_ACT>
|
|
||||||
</ACT>
|
|
||||||
<BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>01</NO>
|
|
||||||
<PFNO>39</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>02</NO>
|
|
||||||
<PFNO>37</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>04</NO>
|
|
||||||
<PFNO>05</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>05</NO>
|
|
||||||
<PFNO>06</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>07</NO>
|
|
||||||
<PFNO>28</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>08</NO>
|
|
||||||
<PFNO>40</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>09</NO>
|
|
||||||
<PFNO>29</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>10</NO>
|
|
||||||
<PFNO>38</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>12</NO>
|
|
||||||
<PFNO>30</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>13</NO>
|
|
||||||
<PFNO>42</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>15</NO>
|
|
||||||
<PFNO>45</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>17</NO>
|
|
||||||
<PFNO>32</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>18</NO>
|
|
||||||
<PFNO>33</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>19</NO>
|
|
||||||
<PFNO>34</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>20</NO>
|
|
||||||
<PFNO>09</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>22</NO>
|
|
||||||
<PFNO>41</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>23</NO>
|
|
||||||
<PFNO>07</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>25</NO>
|
|
||||||
<PFNO>18</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>26</NO>
|
|
||||||
<PFNO>26</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>27</NO>
|
|
||||||
<PFNO>27</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
<RSMPE_BUT>
|
|
||||||
<PFK_CODE>000001</PFK_CODE>
|
|
||||||
<CODE>0001</CODE>
|
|
||||||
<NO>28</NO>
|
|
||||||
<PFNO>19</PFNO>
|
|
||||||
</RSMPE_BUT>
|
|
||||||
</BUT>
|
|
||||||
<PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>02</PFNO>
|
|
||||||
<FUNCODE>&IC1</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>03</PFNO>
|
|
||||||
<FUNCODE>&F03</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>05</PFNO>
|
|
||||||
<FUNCODE>&ALL</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>06</PFNO>
|
|
||||||
<FUNCODE>&SAL</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>07</PFNO>
|
|
||||||
<FUNCODE>&NFO</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>08</PFNO>
|
|
||||||
<FUNCODE>&NTE</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>09</PFNO>
|
|
||||||
<FUNCODE>EXCEL</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>12</PFNO>
|
|
||||||
<FUNCODE>&F12</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>15</PFNO>
|
|
||||||
<FUNCODE>&F15</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>18</PFNO>
|
|
||||||
<FUNCODE>&CRB</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>19</PFNO>
|
|
||||||
<FUNCODE>&CRE</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>21</PFNO>
|
|
||||||
<FUNCODE>P</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>22</PFNO>
|
|
||||||
<FUNCODE>P-</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>23</PFNO>
|
|
||||||
<FUNCODE>P+</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>24</PFNO>
|
|
||||||
<FUNCODE>P++</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>25</PFNO>
|
|
||||||
<FUNCODE>&ABC</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>26</PFNO>
|
|
||||||
<FUNCODE>&CRL</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>27</PFNO>
|
|
||||||
<FUNCODE>&CRR</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>28</PFNO>
|
|
||||||
<FUNCODE>&OUP</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>29</PFNO>
|
|
||||||
<FUNCODE>&ILT</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>30</PFNO>
|
|
||||||
<FUNCODE>&UMC</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>31</PFNO>
|
|
||||||
<FUNCODE>%SL</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>32</PFNO>
|
|
||||||
<FUNCODE>&OL0</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>33</PFNO>
|
|
||||||
<FUNCODE>&OAD</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>34</PFNO>
|
|
||||||
<FUNCODE>&AVE</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>35</PFNO>
|
|
||||||
<FUNCODE>&XPA</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>37</PFNO>
|
|
||||||
<FUNCODE>&EB9</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>38</PFNO>
|
|
||||||
<FUNCODE>&ILD</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>39</PFNO>
|
|
||||||
<FUNCODE>&ETA</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>40</PFNO>
|
|
||||||
<FUNCODE>&ODN</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>41</PFNO>
|
|
||||||
<FUNCODE>&LFO</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>42</PFNO>
|
|
||||||
<FUNCODE>&SUM</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>43</PFNO>
|
|
||||||
<FUNCODE>&XXL</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>44</PFNO>
|
|
||||||
<FUNCODE>&AQW</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>45</PFNO>
|
|
||||||
<FUNCODE>%PC</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>46</PFNO>
|
|
||||||
<FUNCODE>&RNT_PREV</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>47</PFNO>
|
|
||||||
<FUNCODE>&OMP</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>48</PFNO>
|
|
||||||
<FUNCODE>&XML</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>71</PFNO>
|
|
||||||
<FUNCODE>%SC</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>80</PFNO>
|
|
||||||
<FUNCODE>P--</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>81</PFNO>
|
|
||||||
<FUNCODE>P-</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>82</PFNO>
|
|
||||||
<FUNCODE>P+</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>83</PFNO>
|
|
||||||
<FUNCODE>P++</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>84</PFNO>
|
|
||||||
<FUNCODE>%SC+</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
<RSMPE_PFK>
|
|
||||||
<CODE>000001</CODE>
|
|
||||||
<PFNO>86</PFNO>
|
|
||||||
<FUNCODE>&RNT</FUNCODE>
|
|
||||||
<FUNNO>001</FUNNO>
|
|
||||||
</RSMPE_PFK>
|
|
||||||
</PFK>
|
|
||||||
<SET>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>%PC</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>%SC</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>%SC+</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>%SL</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&ABC</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&ALL</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&AQW</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&AVE</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&CRB</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&CRE</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&CRL</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&CRR</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&EB9</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&ETA</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&F03</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&F12</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&F15</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&IC1</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&ILD</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&ILT</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&LFO</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&NFO</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&NTE</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&OAD</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&ODN</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&OL0</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&OMP</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&OUP</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&RNT</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&RNT_PREV</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&SAL</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&SUM</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&UMC</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&XML</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&XPA</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>&XXL</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>EXCEL</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>P</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>P+</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>P++</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>P-</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
<RSMPE_STAF>
|
|
||||||
<STATUS>ALV_STATUS</STATUS>
|
|
||||||
<FUNCTION>P--</FUNCTION>
|
|
||||||
</RSMPE_STAF>
|
|
||||||
</SET>
|
|
||||||
<DOC>
|
|
||||||
<RSMPE_ATRT>
|
|
||||||
<OBJ_TYPE>A</OBJ_TYPE>
|
|
||||||
<OBJ_CODE>000001</OBJ_CODE>
|
|
||||||
<MODAL>D</MODAL>
|
|
||||||
<INT_NOTE>Standard for General List Output</INT_NOTE>
|
|
||||||
</RSMPE_ATRT>
|
|
||||||
<RSMPE_ATRT>
|
|
||||||
<OBJ_TYPE>P</OBJ_TYPE>
|
|
||||||
<OBJ_CODE>000001</OBJ_CODE>
|
|
||||||
<MODAL>D</MODAL>
|
|
||||||
<INT_NOTE>Standard for General List Output</INT_NOTE>
|
|
||||||
</RSMPE_ATRT>
|
|
||||||
<RSMPE_ATRT>
|
|
||||||
<OBJ_TYPE>B</OBJ_TYPE>
|
|
||||||
<OBJ_CODE>000001</OBJ_CODE>
|
|
||||||
<SUB_CODE>0001</SUB_CODE>
|
|
||||||
<MODAL>D</MODAL>
|
|
||||||
<INT_NOTE>Standard for General List Output</INT_NOTE>
|
|
||||||
</RSMPE_ATRT>
|
|
||||||
</DOC>
|
|
||||||
</CUA>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Test Excel Reader (Now in ZDEMO_EXCEL15)</ENTRY>
|
|
||||||
<LENGTH>56</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,229 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL27
|
|
||||||
*& Test Styles for ABAP2XLSX
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel27.
|
|
||||||
|
|
||||||
CLASS lcl_app DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS main
|
|
||||||
RAISING
|
|
||||||
zcx_excel.
|
|
||||||
PRIVATE SECTION.
|
|
||||||
METHODS conditional_formatting_cellis
|
|
||||||
IMPORTING
|
|
||||||
column TYPE simple
|
|
||||||
row TYPE zexcel_cell_row
|
|
||||||
rule TYPE zexcel_condition_rule
|
|
||||||
op TYPE zexcel_condition_operator
|
|
||||||
f TYPE zexcel_style_formula
|
|
||||||
f2 TYPE zexcel_style_formula
|
|
||||||
numfmt TYPE string
|
|
||||||
RAISING
|
|
||||||
zcx_excel.
|
|
||||||
METHODS conditional_formatting_textfun
|
|
||||||
IMPORTING
|
|
||||||
column TYPE simple
|
|
||||||
row TYPE zexcel_cell_row
|
|
||||||
txtfun TYPE zcl_excel_style_cond=>tv_textfunction
|
|
||||||
text TYPE string
|
|
||||||
numfmt TYPE string
|
|
||||||
RAISING
|
|
||||||
zcx_excel.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
CONSTANTS: c_fish TYPE string VALUE 'Fish'.
|
|
||||||
|
|
||||||
DATA: lo_app TYPE REF TO lcl_app.
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_range TYPE REF TO zcl_excel_range,
|
|
||||||
lo_data_validation TYPE REF TO zcl_excel_data_validation,
|
|
||||||
lo_style_1 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_2 TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_1_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_2_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_guid TYPE zexcel_cell_style,
|
|
||||||
ls_cellis TYPE zexcel_conditional_cellis,
|
|
||||||
ls_textfunction TYPE zcl_excel_style_cond=>ts_conditional_textfunction.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lv_title TYPE zexcel_sheet_title.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '27_ConditionalFormatting.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
DATA: lo_error TYPE REF TO zcx_excel,
|
|
||||||
lv_message TYPE string.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_app.
|
|
||||||
TRY.
|
|
||||||
lo_app->main( ).
|
|
||||||
CATCH zcx_excel INTO lo_error.
|
|
||||||
lv_message = lo_error->get_text( ).
|
|
||||||
MESSAGE lv_message TYPE 'I' DISPLAY LIKE 'E'.
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
|
|
||||||
CLASS lcl_app IMPLEMENTATION.
|
|
||||||
|
|
||||||
METHOD main.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lo_style_cond TYPE REF TO zcl_excel_style_cond,
|
|
||||||
lo_style TYPE REF TO zcl_excel_style.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
lo_style_1 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_1->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_1->fill->bgcolor-rgb = zcl_excel_style_color=>c_green.
|
|
||||||
lv_style_1_guid = lo_style_1->get_guid( ).
|
|
||||||
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_2->fill->bgcolor-rgb = zcl_excel_style_color=>c_red.
|
|
||||||
lv_style_2_guid = lo_style_2->get_guid( ).
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lv_title = 'Conditional formatting'.
|
|
||||||
lo_worksheet->set_title( lv_title ).
|
|
||||||
" Set values for dropdown
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'A' ip_value = c_fish ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 'Anchovy' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 'Carp' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 'Catfish' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 'Cod' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 'Eel' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 9 ip_column = 'A' ip_value = 'Haddock' ).
|
|
||||||
|
|
||||||
lo_range = lo_excel->add_new_range( ).
|
|
||||||
lo_range->name = c_fish.
|
|
||||||
lo_range->set_value( ip_sheet_name = lv_title
|
|
||||||
ip_start_column = 'A'
|
|
||||||
ip_start_row = 4
|
|
||||||
ip_stop_column = 'A'
|
|
||||||
ip_stop_row = 9 ).
|
|
||||||
|
|
||||||
" 1st validation
|
|
||||||
lo_data_validation = lo_worksheet->add_new_data_validation( ).
|
|
||||||
lo_data_validation->type = zcl_excel_data_validation=>c_type_list.
|
|
||||||
lo_data_validation->formula1 = c_fish.
|
|
||||||
lo_data_validation->cell_row = 2.
|
|
||||||
lo_data_validation->cell_column = 'C'.
|
|
||||||
lo_worksheet->set_cell( ip_row = 2 ip_column = 'C' ip_value = 'Select a value' ).
|
|
||||||
|
|
||||||
lo_style_cond = lo_worksheet->add_new_style_cond( ).
|
|
||||||
lo_style_cond->rule = zcl_excel_style_cond=>c_rule_cellis.
|
|
||||||
ls_cellis-formula = '"Anchovy"'.
|
|
||||||
ls_cellis-operator = zcl_excel_style_cond=>c_operator_equal.
|
|
||||||
ls_cellis-cell_style = lv_style_1_guid.
|
|
||||||
lo_style_cond->mode_cellis = ls_cellis.
|
|
||||||
lo_style_cond->priority = 1.
|
|
||||||
lo_style_cond->set_range( ip_start_column = 'C'
|
|
||||||
ip_start_row = 2
|
|
||||||
ip_stop_column = 'C'
|
|
||||||
ip_stop_row = 2 ).
|
|
||||||
|
|
||||||
lo_style_cond = lo_worksheet->add_new_style_cond( ).
|
|
||||||
lo_style_cond->rule = zcl_excel_style_cond=>c_rule_cellis.
|
|
||||||
ls_cellis-formula = '"Carp"'.
|
|
||||||
ls_cellis-operator = zcl_excel_style_cond=>c_operator_equal.
|
|
||||||
ls_cellis-cell_style = lv_style_2_guid.
|
|
||||||
lo_style_cond->mode_cellis = ls_cellis.
|
|
||||||
lo_style_cond->priority = 2.
|
|
||||||
lo_style_cond->set_range( ip_start_column = 'C'
|
|
||||||
ip_start_row = 2
|
|
||||||
ip_stop_column = 'C'
|
|
||||||
ip_stop_row = 2 ).
|
|
||||||
|
|
||||||
" Conditional formatting for all operators
|
|
||||||
conditional_formatting_cellis( column = 'C' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_equal f = '="Anchovy"' f2 = '' numfmt = 'equal to Anchovy' ).
|
|
||||||
conditional_formatting_cellis( column = 'C' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_equal f = '="Anchovy"' f2 = '' numfmt = 'equal to Anchovy' ).
|
|
||||||
conditional_formatting_cellis( column = 'D' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_notequal f = '="Anchovy"' f2 = '' numfmt = 'not equal to Anchovy' ).
|
|
||||||
conditional_formatting_cellis( column = 'E' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_between f = '="B"' f2 = '="CC"' numfmt = 'between B and CC' ).
|
|
||||||
conditional_formatting_cellis( column = 'F' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_greaterthan f = '="Catfish"' f2 = '' numfmt = 'greater than Catfish' ).
|
|
||||||
conditional_formatting_cellis( column = 'G' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_greaterthanorequal f = '="Catfish"' f2 = '' numfmt = 'greater than or equal to Catfish' ).
|
|
||||||
conditional_formatting_cellis( column = 'H' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_lessthan f = '="Catfish"' f2 = '' numfmt = 'less than Catfish' ).
|
|
||||||
conditional_formatting_cellis( column = 'I' row = 4 rule = zcl_excel_style_cond=>c_rule_cellis op = zcl_excel_style_cond=>c_operator_lessthanorequal f = '="Catfish"' f2 = '' numfmt = 'less than or equal to Catfish' ).
|
|
||||||
|
|
||||||
" Conditional formatting for all text functions
|
|
||||||
conditional_formatting_textfun( column = 'C' row = 6 txtfun = zcl_excel_style_cond=>c_textfunction_beginswith text = 'A' numfmt = 'begins with A' ).
|
|
||||||
conditional_formatting_textfun( column = 'D' row = 6 txtfun = zcl_excel_style_cond=>c_textfunction_containstext text = 'h' numfmt = 'contains text h' ).
|
|
||||||
conditional_formatting_textfun( column = 'E' row = 6 txtfun = zcl_excel_style_cond=>c_textfunction_endswith text = 'p' numfmt = 'ends with p' ).
|
|
||||||
conditional_formatting_textfun( column = 'F' row = 6 txtfun = zcl_excel_style_cond=>c_textfunction_notcontains text = 'h' numfmt = 'not contains h' ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD conditional_formatting_cellis.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lo_style TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_cond TYPE REF TO zcl_excel_style_cond.
|
|
||||||
|
|
||||||
lo_style = lo_excel->add_new_style( ).
|
|
||||||
lo_style->font->color-rgb = zcl_excel_style_color=>c_white.
|
|
||||||
lo_style->number_format->format_code = '@\ "' && numfmt && '"'.
|
|
||||||
lo_style->alignment->wraptext = abap_true.
|
|
||||||
lv_style_guid = lo_style->get_guid( ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = column ip_formula = '$C$2' ip_style = lv_style_guid ).
|
|
||||||
|
|
||||||
lo_style_cond = lo_worksheet->add_new_style_cond( ).
|
|
||||||
lo_style_cond->rule = rule.
|
|
||||||
ls_cellis-operator = op.
|
|
||||||
ls_cellis-formula = f.
|
|
||||||
ls_cellis-formula2 = f2.
|
|
||||||
ls_cellis-cell_style = lv_style_1_guid.
|
|
||||||
lo_style_cond->mode_cellis = ls_cellis.
|
|
||||||
lo_style_cond->priority = 1.
|
|
||||||
lo_style_cond->set_range( ip_start_column = column
|
|
||||||
ip_start_row = row
|
|
||||||
ip_stop_column = column
|
|
||||||
ip_stop_row = row ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD conditional_formatting_textfun.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lo_style TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_cond TYPE REF TO zcl_excel_style_cond.
|
|
||||||
|
|
||||||
lo_style = lo_excel->add_new_style( ).
|
|
||||||
lo_style->font->color-rgb = zcl_excel_style_color=>c_white.
|
|
||||||
lo_style->number_format->format_code = '@\ "' && numfmt && '"'.
|
|
||||||
lo_style->alignment->wraptext = abap_true.
|
|
||||||
lv_style_guid = lo_style->get_guid( ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = column ip_formula = '$C$2' ip_style = lv_style_guid ).
|
|
||||||
|
|
||||||
lo_style_cond = lo_worksheet->add_new_style_cond( ).
|
|
||||||
lo_style_cond->rule = zcl_excel_style_cond=>c_rule_textfunction.
|
|
||||||
ls_textfunction-textfunction = txtfun.
|
|
||||||
ls_textfunction-text = text.
|
|
||||||
ls_textfunction-cell_style = lv_style_1_guid.
|
|
||||||
lo_style_cond->mode_textfunction = ls_textfunction.
|
|
||||||
lo_style_cond->priority = 1.
|
|
||||||
lo_style_cond->set_range( ip_start_column = column
|
|
||||||
ip_start_row = row
|
|
||||||
ip_stop_column = column
|
|
||||||
ip_stop_row = row ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
ENDCLASS.
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL27</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Data conditional formatting with styles</ENTRY>
|
|
||||||
<LENGTH>56</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_READER</KEY>
|
|
||||||
<ENTRY>Write back after using Reader</ENTRY>
|
|
||||||
<LENGTH>37</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,105 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL28
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel28.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_excel_writer TYPE REF TO zif_excel_writer,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS: lv_default_file_name TYPE string VALUE '28_HelloWorld.csv'.
|
|
||||||
|
|
||||||
PARAMETERS: p_path TYPE string.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = p_path
|
|
||||||
CHANGING selected_folder = p_path ).
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
p_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
|
|
||||||
CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = sy-datum ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = sy-uzeit ).
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( 'B' ).
|
|
||||||
lo_column->set_width( 11 ).
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the second sheet' ).
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_csv.
|
|
||||||
zcl_excel_writer_csv=>set_delimiter( ip_value = cl_abap_char_utilities=>horizontal_tab ).
|
|
||||||
zcl_excel_writer_csv=>set_enclosure( ip_value = '''' ).
|
|
||||||
zcl_excel_writer_csv=>set_endofline( ip_value = cl_abap_char_utilities=>cr_lf ).
|
|
||||||
|
|
||||||
zcl_excel_writer_csv=>set_active_sheet_index( i_active_worksheet = 2 ).
|
|
||||||
|
|
||||||
lv_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = lv_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = lv_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file_tab.
|
|
||||||
|
|
||||||
" Save the file
|
|
||||||
REPLACE FIRST OCCURRENCE OF '.csv' IN lv_full_path WITH '_Sheet2.csv'.
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
|
|
||||||
filename = lv_full_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file_tab ).
|
|
||||||
|
|
||||||
zcl_excel_writer_csv=>set_active_sheet_index_by_name( i_worksheet_name = 'Sheet1' ).
|
|
||||||
lv_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
REPLACE FIRST OCCURRENCE OF '_Sheet2.csv' IN lv_full_path WITH '_Sheet1.csv'.
|
|
||||||
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = lv_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = lv_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file_tab.
|
|
||||||
|
|
||||||
" Save the file
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
|
|
||||||
filename = lv_full_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file_tab ).
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL28</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: export in CSV</ENTRY>
|
|
||||||
<LENGTH>29</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,163 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL29
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel29.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_excel_writer TYPE REF TO zif_excel_writer,
|
|
||||||
lo_excel_reader TYPE REF TO zif_excel_reader.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_filename TYPE string,
|
|
||||||
lv_workdir TYPE string.
|
|
||||||
DATA: lv_separator TYPE c LENGTH 1.
|
|
||||||
|
|
||||||
SELECTION-SCREEN COMMENT /1(83) p_text1.
|
|
||||||
SELECTION-SCREEN COMMENT /1(83) p_text2.
|
|
||||||
SELECTION-SCREEN SKIP 1.
|
|
||||||
|
|
||||||
PARAMETERS: p_smw0 RADIOBUTTON GROUP rad1 DEFAULT 'X'.
|
|
||||||
PARAMETERS: p_objid TYPE w3objid OBLIGATORY DEFAULT 'ZDEMO_EXCEL29_INPUT'.
|
|
||||||
|
|
||||||
PARAMETERS: p_file RADIOBUTTON GROUP rad1.
|
|
||||||
PARAMETERS: p_path TYPE zexcel_export_dir.
|
|
||||||
|
|
||||||
LOAD-OF-PROGRAM.
|
|
||||||
p_text1 = 'abap2xlsx works with VBA macro by using an existing VBA binary.'.
|
|
||||||
p_text2 = '(we do not want to create a VBA editor).'.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN OUTPUT.
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_separator ).
|
|
||||||
p_path = lv_workdir && lv_separator && 'TestMacro.xlsm'.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
|
|
||||||
|
|
||||||
DATA: lt_filetable TYPE filetable,
|
|
||||||
lv_rc TYPE i.
|
|
||||||
|
|
||||||
CALL METHOD cl_gui_frontend_services=>file_open_dialog
|
|
||||||
EXPORTING
|
|
||||||
window_title = 'Select Macro-Enabled Workbook template'
|
|
||||||
default_extension = '*.xlsm'
|
|
||||||
file_filter = 'Excel Macro-Enabled Workbook (*.xlsm)|*.xlsm'
|
|
||||||
initial_directory = lv_workdir
|
|
||||||
CHANGING
|
|
||||||
file_table = lt_filetable
|
|
||||||
rc = lv_rc
|
|
||||||
EXCEPTIONS
|
|
||||||
file_open_dialog_failed = 1
|
|
||||||
cntl_error = 2
|
|
||||||
error_no_gui = 3
|
|
||||||
not_supported_by_gui = 4
|
|
||||||
OTHERS = 5.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
READ TABLE lt_filetable INTO lv_filename INDEX 1.
|
|
||||||
p_path = lv_filename.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
lv_full_path = p_path.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_reader TYPE zcl_excel_reader_xlsm.
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_xlsm.
|
|
||||||
* load template
|
|
||||||
IF p_file IS NOT INITIAL.
|
|
||||||
lo_excel = lo_excel_reader->load_file( lv_full_path ).
|
|
||||||
ELSE.
|
|
||||||
PERFORM load_smw0 USING lo_excel_reader p_objid CHANGING lo_excel.
|
|
||||||
ENDIF.
|
|
||||||
lv_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
REPLACE '.xlsm' IN lv_full_path WITH 'FromReader.xlsm'.
|
|
||||||
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = lv_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = lv_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file_tab.
|
|
||||||
|
|
||||||
" Save the file
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
|
|
||||||
filename = lv_full_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file_tab ).
|
|
||||||
|
|
||||||
FORM load_smw0
|
|
||||||
USING
|
|
||||||
io_reader TYPE REF TO zif_excel_reader
|
|
||||||
iv_w3objid TYPE w3objid
|
|
||||||
CHANGING
|
|
||||||
ro_excel TYPE REF TO zcl_excel
|
|
||||||
RAISING
|
|
||||||
zcx_excel.
|
|
||||||
|
|
||||||
DATA: lv_excel_data TYPE xstring,
|
|
||||||
lt_mime TYPE TABLE OF w3mime,
|
|
||||||
ls_key TYPE wwwdatatab,
|
|
||||||
lv_errormessage TYPE string,
|
|
||||||
lv_filesize TYPE i,
|
|
||||||
lv_filesizec TYPE c LENGTH 10.
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Read file into binary string
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
ls_key-relid = 'MI'.
|
|
||||||
ls_key-objid = iv_w3objid .
|
|
||||||
|
|
||||||
CALL FUNCTION 'WWWDATA_IMPORT'
|
|
||||||
EXPORTING
|
|
||||||
key = ls_key
|
|
||||||
TABLES
|
|
||||||
mime = lt_mime
|
|
||||||
EXCEPTIONS
|
|
||||||
OTHERS = 1.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
lv_errormessage = 'A problem occured when reading the MIME object'(004).
|
|
||||||
zcx_excel=>raise_text( lv_errormessage ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
CALL FUNCTION 'WWWPARAMS_READ'
|
|
||||||
EXPORTING
|
|
||||||
relid = ls_key-relid
|
|
||||||
objid = ls_key-objid
|
|
||||||
name = 'filesize'
|
|
||||||
IMPORTING
|
|
||||||
value = lv_filesizec.
|
|
||||||
|
|
||||||
lv_filesize = lv_filesizec.
|
|
||||||
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
|
|
||||||
EXPORTING
|
|
||||||
input_length = lv_filesize
|
|
||||||
IMPORTING
|
|
||||||
buffer = lv_excel_data
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_mime
|
|
||||||
EXCEPTIONS
|
|
||||||
failed = 1
|
|
||||||
OTHERS = 2.
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Parse Excel data into ZCL_EXCEL object from binary string
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
ro_excel = io_reader->load( i_excel2007 = lv_excel_data ).
|
|
||||||
|
|
||||||
ENDFORM.
|
|
|
@ -1,46 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL29</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Macro-Enabled workbook</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_FILE</KEY>
|
|
||||||
<ENTRY>Load template from file</ENTRY>
|
|
||||||
<LENGTH>31</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_OBJID</KEY>
|
|
||||||
<ENTRY>Object ID</ENTRY>
|
|
||||||
<LENGTH>17</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>Macro-enabled Workbook</ENTRY>
|
|
||||||
<LENGTH>30</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_SMW0</KEY>
|
|
||||||
<ENTRY>Load template from SMW0</ENTRY>
|
|
||||||
<LENGTH>31</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,198 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL3
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel3.
|
|
||||||
|
|
||||||
TYPES: ty_sflight_lines TYPE TABLE OF sflight,
|
|
||||||
ty_scarr_lines TYPE TABLE OF scarr.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column.
|
|
||||||
|
|
||||||
DATA: ls_table_settings TYPE zexcel_s_table_settings.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lv_title TYPE zexcel_sheet_title,
|
|
||||||
lt_carr TYPE ty_scarr_lines,
|
|
||||||
row TYPE zexcel_cell_row VALUE 2,
|
|
||||||
ls_error TYPE zcl_excel_worksheet=>mty_s_ignored_errors,
|
|
||||||
lt_error TYPE zcl_excel_worksheet=>mty_th_ignored_errors,
|
|
||||||
lo_range TYPE REF TO zcl_excel_range.
|
|
||||||
DATA: lo_data_validation TYPE REF TO zcl_excel_data_validation.
|
|
||||||
FIELD-SYMBOLS: <carr> LIKE LINE OF lt_carr.
|
|
||||||
|
|
||||||
CONSTANTS: c_airlines TYPE string VALUE 'Airlines'.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '03_iTab.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
PARAMETERS: p_empty TYPE flag.
|
|
||||||
PARAMETERS: p_checkr NO-DISPLAY TYPE abap_bool.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Internal table' ).
|
|
||||||
|
|
||||||
DATA lt_test TYPE ty_sflight_lines.
|
|
||||||
|
|
||||||
IF p_empty <> abap_true.
|
|
||||||
IF p_checkr = abap_true.
|
|
||||||
PERFORM load_fixed_data_for_checker CHANGING lt_test.
|
|
||||||
ELSE.
|
|
||||||
SELECT * FROM sflight INTO TABLE lt_test. "#EC CI_NOWHERE
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
|
|
||||||
ls_table_settings-show_row_stripes = abap_true.
|
|
||||||
ls_table_settings-nofilters = abap_true.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table( ip_table = lt_test
|
|
||||||
is_table_settings = ls_table_settings ).
|
|
||||||
|
|
||||||
IF p_checkr = abap_true.
|
|
||||||
PERFORM set_column_headers USING lo_worksheet
|
|
||||||
'Airline;Flight Number;Date;Airfare;Airline Currency;Plane Type;Max. capacity econ.;Occupied econ.;Total;Max. capacity bus.;Occupied bus.;Max. capacity 1st;Occupied 1st'.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
lo_worksheet->freeze_panes( ip_num_rows = 3 ). "freeze column headers when scrolling
|
|
||||||
IF lines( lt_test ) >= 1.
|
|
||||||
ls_error-cell_coords = |B2:B{ lines( lt_test ) + 1 }|.
|
|
||||||
ls_error-number_stored_as_text = abap_true.
|
|
||||||
INSERT ls_error INTO TABLE lt_error.
|
|
||||||
lo_worksheet->set_ignored_errors( lt_error ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'E' ). "make date field a bit wider
|
|
||||||
lo_column->set_width( ip_width = 11 ).
|
|
||||||
" Add another table for data validations
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lv_title = 'Data Validation'.
|
|
||||||
lo_worksheet->set_title( lv_title ).
|
|
||||||
lo_worksheet->set_cell( ip_row = 1 ip_column = 'A' ip_value = c_airlines ).
|
|
||||||
IF p_checkr = abap_true.
|
|
||||||
PERFORM load_scarr_data_for_checker CHANGING lt_carr.
|
|
||||||
ELSE.
|
|
||||||
SELECT * FROM scarr INTO TABLE lt_carr. "#EC CI_NOWHERE
|
|
||||||
ENDIF.
|
|
||||||
LOOP AT lt_carr ASSIGNING <carr>.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'A' ip_value = <carr>-carrid ).
|
|
||||||
row = row + 1.
|
|
||||||
ENDLOOP.
|
|
||||||
row = row - 1.
|
|
||||||
lo_range = lo_excel->add_new_range( ).
|
|
||||||
lo_range->name = c_airlines.
|
|
||||||
lo_range->set_value( ip_sheet_name = lv_title
|
|
||||||
ip_start_column = 'A'
|
|
||||||
ip_start_row = 2
|
|
||||||
ip_stop_column = 'A'
|
|
||||||
ip_stop_row = row ).
|
|
||||||
" Set Data Validation
|
|
||||||
lo_excel->set_active_sheet_index( 1 ).
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
|
|
||||||
lo_data_validation = lo_worksheet->add_new_data_validation( ).
|
|
||||||
lo_data_validation->type = zcl_excel_data_validation=>c_type_list.
|
|
||||||
lo_data_validation->formula1 = c_airlines.
|
|
||||||
lo_data_validation->cell_row = 4.
|
|
||||||
lo_data_validation->cell_column = 'C'.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FORM load_fixed_data_for_checker CHANGING ct_test TYPE ty_sflight_lines.
|
|
||||||
DATA: lt_lines TYPE TABLE OF string.
|
|
||||||
|
|
||||||
APPEND 'AA;0017;20171219; 422;USD;747-400 ;385;371;191334;31;28;21;21' TO lt_lines.
|
|
||||||
APPEND 'AA;0017;20180309; 422;USD;747-400 ;385;365;189984;31;29;21;20' TO lt_lines.
|
|
||||||
APPEND 'AA;0017;20180528; 422;USD;747-400 ;385;374;193482;31;30;21;20' TO lt_lines.
|
|
||||||
APPEND 'AA;0017;20180816; 422;USD;747-400 ;385;372;193127;31;30;21;20' TO lt_lines.
|
|
||||||
APPEND 'AA;0017;20181104; 422;USD;747-400 ;385; 44; 23908;31; 4;21; 3' TO lt_lines.
|
|
||||||
APPEND 'AA;0017;20190123; 422;USD;747-400 ;385; 40; 20347;31; 3;21; 2' TO lt_lines.
|
|
||||||
APPEND 'AZ;0555;20171219; 185;EUR;737-800 ;140;133; 32143;12;12;10;10' TO lt_lines.
|
|
||||||
APPEND 'AZ;0555;20180309; 185;EUR;737-800 ;140;137; 32595;12;12;10;10' TO lt_lines.
|
|
||||||
APPEND 'AZ;0555;20180528; 185;EUR;737-800 ;140;134; 31899;12;11;10;10' TO lt_lines.
|
|
||||||
APPEND 'AZ;0555;20180816; 185;EUR;737-800 ;140;128; 29775;12;10;10; 9' TO lt_lines.
|
|
||||||
APPEND 'AZ;0555;20181104; 185;EUR;737-800 ;140; 0; 0;12; 0;10; 0' TO lt_lines.
|
|
||||||
APPEND 'AZ;0555;20190123; 185;EUR;737-800 ;140; 23; 5392;12; 1;10; 2' TO lt_lines.
|
|
||||||
APPEND 'AZ;0789;20171219;1030;EUR;767-200 ;260;250;307176;21;20;11;11' TO lt_lines.
|
|
||||||
APPEND 'AZ;0789;20180309;1030;EUR;767-200 ;260;252;306054;21;20;11;10' TO lt_lines.
|
|
||||||
APPEND 'AZ;0789;20180528;1030;EUR;767-200 ;260;252;307063;21;20;11;10' TO lt_lines.
|
|
||||||
APPEND 'AZ;0789;20180816;1030;EUR;767-200 ;260;249;300739;21;19;11;10' TO lt_lines.
|
|
||||||
APPEND 'AZ;0789;20181104;1030;EUR;767-200 ;260;104;127647;21; 8;11; 5' TO lt_lines.
|
|
||||||
APPEND 'AZ;0789;20190123;1030;EUR;767-200 ;260; 18; 22268;21; 1;11; 1' TO lt_lines.
|
|
||||||
APPEND 'DL;0106;20171217; 611;USD;A380-800;475;458;324379;30;29;20;20' TO lt_lines.
|
|
||||||
APPEND 'DL;0106;20180307; 611;USD;A380-800;475;458;324330;30;30;20;20' TO lt_lines.
|
|
||||||
APPEND 'DL;0106;20180526; 611;USD;A380-800;475;459;328149;30;29;20;20' TO lt_lines.
|
|
||||||
APPEND 'DL;0106;20180814; 611;USD;A380-800;475;462;326805;30;30;20;18' TO lt_lines.
|
|
||||||
APPEND 'DL;0106;20181102; 611;USD;A380-800;475;167;115554;30;10;20; 6' TO lt_lines.
|
|
||||||
APPEND 'DL;0106;20190121; 611;USD;A380-800;475; 11; 9073;30; 1;20; 1' TO lt_lines.
|
|
||||||
|
|
||||||
PERFORM load_data USING lt_lines CHANGING ct_test.
|
|
||||||
ENDFORM.
|
|
||||||
|
|
||||||
FORM load_scarr_data_for_checker CHANGING ct_scarr TYPE ty_scarr_lines.
|
|
||||||
DATA: lt_lines TYPE TABLE OF string.
|
|
||||||
|
|
||||||
APPEND 'AA;American Airlines;USD;http://www.aa.com ' TO lt_lines.
|
|
||||||
APPEND 'AZ;Alitalia ;EUR;http://www.alitalia.it ' TO lt_lines.
|
|
||||||
APPEND 'DL;Delta Airlines ;USD;http://www.delta-air.com' TO lt_lines.
|
|
||||||
|
|
||||||
PERFORM load_data USING lt_lines CHANGING ct_scarr.
|
|
||||||
ENDFORM.
|
|
||||||
|
|
||||||
FORM load_data USING it_data TYPE table CHANGING ct_data TYPE table.
|
|
||||||
DATA: lv_line TYPE string,
|
|
||||||
lt_fields TYPE TABLE OF string,
|
|
||||||
lv_comp TYPE i,
|
|
||||||
lv_field TYPE string,
|
|
||||||
lv_ref_line TYPE REF TO data.
|
|
||||||
FIELD-SYMBOLS:
|
|
||||||
<lv_field> TYPE simple,
|
|
||||||
<ls_line> TYPE any.
|
|
||||||
|
|
||||||
CREATE DATA lv_ref_line LIKE LINE OF ct_data.
|
|
||||||
ASSIGN lv_ref_line->* TO <ls_line>.
|
|
||||||
|
|
||||||
LOOP AT it_data INTO lv_line.
|
|
||||||
CLEAR <ls_line>.
|
|
||||||
SPLIT lv_line AT ';' INTO TABLE lt_fields.
|
|
||||||
lv_comp = 2.
|
|
||||||
LOOP AT lt_fields INTO lv_field.
|
|
||||||
ASSIGN COMPONENT lv_comp OF STRUCTURE <ls_line> TO <lv_field>.
|
|
||||||
<lv_field> = lv_field.
|
|
||||||
lv_comp = lv_comp + 1.
|
|
||||||
ENDLOOP.
|
|
||||||
APPEND <ls_line> TO ct_data.
|
|
||||||
ENDLOOP.
|
|
||||||
ENDFORM.
|
|
||||||
|
|
||||||
FORM set_column_headers
|
|
||||||
USING io_worksheet TYPE REF TO zcl_excel_worksheet
|
|
||||||
iv_headers TYPE csequence
|
|
||||||
RAISING zcx_excel.
|
|
||||||
|
|
||||||
DATA: lt_headers TYPE TABLE OF string,
|
|
||||||
lv_header TYPE string,
|
|
||||||
lv_tabix TYPE i.
|
|
||||||
|
|
||||||
SPLIT iv_headers AT ';' INTO TABLE lt_headers.
|
|
||||||
LOOP AT lt_headers INTO lv_header.
|
|
||||||
lv_tabix = sy-tabix.
|
|
||||||
io_worksheet->set_cell( ip_row = 1 ip_column = lv_tabix ip_value = lv_header ).
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ENDFORM.
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL3</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Export internal table</ENTRY>
|
|
||||||
<LENGTH>38</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_EMPTY</KEY>
|
|
||||||
<ENTRY>Leave Table Empty</ENTRY>
|
|
||||||
<LENGTH>25</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,96 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL1
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel30.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lv_value TYPE string,
|
|
||||||
lv_count TYPE i VALUE 10,
|
|
||||||
lv_packed TYPE p LENGTH 16 DECIMALS 1 VALUE '1234567890.5'.
|
|
||||||
|
|
||||||
CONSTANTS: lc_typekind_string TYPE abap_typekind VALUE cl_abap_typedescr=>typekind_string,
|
|
||||||
lc_typekind_packed TYPE abap_typekind VALUE cl_abap_typedescr=>typekind_packed,
|
|
||||||
lc_typekind_num TYPE abap_typekind VALUE cl_abap_typedescr=>typekind_num,
|
|
||||||
lc_typekind_date TYPE abap_typekind VALUE cl_abap_typedescr=>typekind_date,
|
|
||||||
lc_typekind_s_ls TYPE string VALUE 's_leading_blanks'.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '30_CellDataTypes.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Cell data types' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'Number as String'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 2 ip_value = '11'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 1 ip_value = 'String'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = ' String with leading spaces'
|
|
||||||
ip_data_type = lc_typekind_s_ls ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = ' Negative Value'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 1 ip_value = 'Packed'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 2 ip_value = '50000.01-'
|
|
||||||
ip_abap_type = lc_typekind_packed ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 1 ip_value = 'Number with Percentage'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 2 ip_value = '0 %'
|
|
||||||
ip_abap_type = lc_typekind_num ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = 1 ip_value = 'Date'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = 2 ip_value = '20110831'
|
|
||||||
ip_abap_type = lc_typekind_date ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'Positive Value'
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = '5000.02'
|
|
||||||
ip_abap_type = lc_typekind_packed ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 3 ip_value = '50 %'
|
|
||||||
ip_abap_type = lc_typekind_num ).
|
|
||||||
|
|
||||||
WHILE lv_count <= 15.
|
|
||||||
lv_value = lv_count.
|
|
||||||
CONCATENATE 'Positive Value with' lv_value 'Digits' INTO lv_value SEPARATED BY space.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = lv_count ip_value = lv_value
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = lv_count ip_value = lv_packed
|
|
||||||
ip_abap_type = lc_typekind_packed ).
|
|
||||||
CONCATENATE 'Positive Value with' lv_value 'Digits formated as string' INTO lv_value SEPARATED BY space.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = lv_count ip_value = lv_value
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = lv_count ip_value = lv_packed
|
|
||||||
ip_abap_type = lc_typekind_string ).
|
|
||||||
lv_packed = lv_packed * 10.
|
|
||||||
lv_count = lv_count + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'A' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'B' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'C' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'D' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'E' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL30</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: ABAP Cell data types</ENTRY>
|
|
||||||
<LENGTH>37</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,160 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL1
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel31.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: fieldval TYPE text80,
|
|
||||||
row TYPE i,
|
|
||||||
style_column_a TYPE REF TO zcl_excel_style,
|
|
||||||
style_column_a_guid TYPE zexcel_cell_style,
|
|
||||||
style_column_b TYPE REF TO zcl_excel_style,
|
|
||||||
style_column_b_guid TYPE zexcel_cell_style,
|
|
||||||
style_column_c TYPE REF TO zcl_excel_style,
|
|
||||||
style_column_c_guid TYPE zexcel_cell_style,
|
|
||||||
style_font TYPE REF TO zcl_excel_style_font.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '31_AutosizeWithDifferentFontSizes.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
" Use active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Regular Font' ).
|
|
||||||
|
|
||||||
style_column_a = lo_excel->add_new_style( ).
|
|
||||||
style_column_a->font->size = 32. " quite large
|
|
||||||
style_column_a_guid = style_column_a->get_guid( ).
|
|
||||||
|
|
||||||
style_column_c = lo_excel->add_new_style( ).
|
|
||||||
style_column_c->font->size = 16. " not so large
|
|
||||||
style_column_c_guid = style_column_c->get_guid( ).
|
|
||||||
|
|
||||||
|
|
||||||
DO 20 TIMES.
|
|
||||||
row = sy-index.
|
|
||||||
CLEAR fieldval.
|
|
||||||
DO sy-index TIMES.
|
|
||||||
CONCATENATE fieldval 'X' INTO fieldval.
|
|
||||||
ENDDO.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = row ip_value = fieldval ip_style = style_column_a_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = row ip_value = fieldval ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = row ip_value = fieldval ip_style = style_column_c_guid ).
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( 'A' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'B' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'C' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_worksheet->calculate_column_widths( ).
|
|
||||||
|
|
||||||
" Add sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Bold Font' ).
|
|
||||||
|
|
||||||
style_column_a = lo_excel->add_new_style( ).
|
|
||||||
style_column_a->font->size = 32. " quite large
|
|
||||||
style_column_a->font->bold = abap_true.
|
|
||||||
style_column_a_guid = style_column_a->get_guid( ).
|
|
||||||
|
|
||||||
style_column_b = lo_excel->add_new_style( ).
|
|
||||||
style_column_b->font->bold = abap_true.
|
|
||||||
style_column_b_guid = style_column_b->get_guid( ).
|
|
||||||
|
|
||||||
style_column_c = lo_excel->add_new_style( ).
|
|
||||||
style_column_c->font->size = 16. " not so large
|
|
||||||
style_column_c->font->bold = abap_true.
|
|
||||||
style_column_c_guid = style_column_c->get_guid( ).
|
|
||||||
|
|
||||||
DO 20 TIMES.
|
|
||||||
row = sy-index.
|
|
||||||
CLEAR fieldval.
|
|
||||||
DO sy-index TIMES.
|
|
||||||
CONCATENATE fieldval 'X' INTO fieldval.
|
|
||||||
ENDDO.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = row ip_value = fieldval ip_style = style_column_a_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = row ip_value = fieldval ip_style = style_column_b_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = row ip_value = fieldval ip_style = style_column_c_guid ).
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( 'A' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'B' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'C' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_worksheet->calculate_column_widths( ).
|
|
||||||
|
|
||||||
" Add sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Italic Font' ).
|
|
||||||
|
|
||||||
style_column_a = lo_excel->add_new_style( ).
|
|
||||||
style_column_a->font->size = 32. " quite large
|
|
||||||
style_column_a->font->italic = abap_true.
|
|
||||||
style_column_a_guid = style_column_a->get_guid( ).
|
|
||||||
|
|
||||||
style_column_b = lo_excel->add_new_style( ).
|
|
||||||
style_column_b->font->italic = abap_true.
|
|
||||||
style_column_b_guid = style_column_b->get_guid( ).
|
|
||||||
|
|
||||||
style_column_c = lo_excel->add_new_style( ).
|
|
||||||
style_column_c->font->size = 16. " not so large
|
|
||||||
style_column_c->font->italic = abap_true.
|
|
||||||
style_column_c_guid = style_column_c->get_guid( ).
|
|
||||||
|
|
||||||
DO 20 TIMES.
|
|
||||||
row = sy-index.
|
|
||||||
CLEAR fieldval.
|
|
||||||
DO sy-index TIMES.
|
|
||||||
CONCATENATE fieldval 'X' INTO fieldval.
|
|
||||||
ENDDO.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = row ip_value = fieldval ip_style = style_column_a_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = row ip_value = fieldval ip_style = style_column_b_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = row ip_value = fieldval ip_style = style_column_c_guid ).
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( 'A' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'B' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'C' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
lo_worksheet->calculate_column_widths( ).
|
|
||||||
|
|
||||||
" Add sheet for merged cells
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Merged cells' ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = 'This is a very long header text' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 2 ip_value = 'Some data' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = 'Some more data' ).
|
|
||||||
|
|
||||||
lo_worksheet->set_merge(
|
|
||||||
EXPORTING
|
|
||||||
ip_column_start = 'A'
|
|
||||||
ip_column_end = 'C'
|
|
||||||
ip_row = 1 ).
|
|
||||||
|
|
||||||
lo_column = lo_worksheet->get_column( 'A' ).
|
|
||||||
lo_column->set_auto_size( ip_auto_size = abap_true ).
|
|
||||||
|
|
||||||
lo_excel->set_active_sheet_index( i_active_worksheet = 1 ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL31</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Autosize Column with different Font sizes</ENTRY>
|
|
||||||
<LENGTH>58</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,232 +0,0 @@
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* REPORT ZDEMO_EXCEL32
|
|
||||||
* Demo for export options from ALV GRID:
|
|
||||||
* export data from ALV (CL_GUI_ALV_GRID) object or cl_salv_table object
|
|
||||||
* to Excel.
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel32.
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_handle_events DEFINITION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_handle_events DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS:
|
|
||||||
on_user_command FOR EVENT added_function OF cl_salv_events
|
|
||||||
IMPORTING e_salv_function.
|
|
||||||
ENDCLASS. "lcl_handle_events DEFINITION
|
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* CLASS lcl_handle_events IMPLEMENTATION
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
*
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
CLASS lcl_handle_events IMPLEMENTATION.
|
|
||||||
METHOD on_user_command.
|
|
||||||
PERFORM user_command." using e_salv_function text-i08.
|
|
||||||
ENDMETHOD. "on_user_command
|
|
||||||
ENDCLASS. "lcl_handle_events IMPLEMENTATION
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* DATA DECLARATION
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_salv TYPE REF TO cl_salv_table,
|
|
||||||
gr_events TYPE REF TO lcl_handle_events,
|
|
||||||
lr_events TYPE REF TO cl_salv_events_table,
|
|
||||||
gt_sbook TYPE TABLE OF sbook.
|
|
||||||
|
|
||||||
DATA: l_path TYPE string, " local dir
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
lv_default_file_name TYPE string VALUE '32_Export_ALV.xlsx',
|
|
||||||
lv_default_file_name2 TYPE string VALUE '32_Export_Convert.xlsx'.
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
*START-OF-SELECTION
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
* get data
|
|
||||||
* ------------------------------------------
|
|
||||||
|
|
||||||
SELECT *
|
|
||||||
INTO TABLE gt_sbook[]
|
|
||||||
FROM sbook "#EC CI_NOWHERE
|
|
||||||
UP TO 100 ROWS.
|
|
||||||
|
|
||||||
* Display ALV
|
|
||||||
* ------------------------------------------
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
cl_salv_table=>factory(
|
|
||||||
EXPORTING
|
|
||||||
list_display = abap_false
|
|
||||||
IMPORTING
|
|
||||||
r_salv_table = lo_salv
|
|
||||||
CHANGING
|
|
||||||
t_table = gt_sbook[] ).
|
|
||||||
CATCH cx_salv_msg .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
lo_salv->set_screen_status(
|
|
||||||
EXPORTING
|
|
||||||
report = sy-repid
|
|
||||||
pfstatus = 'ALV_STATUS'
|
|
||||||
set_functions = lo_salv->c_functions_all ).
|
|
||||||
CATCH cx_salv_msg .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
lr_events = lo_salv->get_event( ).
|
|
||||||
CREATE OBJECT gr_events.
|
|
||||||
SET HANDLER gr_events->on_user_command FOR lr_events.
|
|
||||||
|
|
||||||
lo_salv->display( ).
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form USER_COMMAND
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
* ALV user command
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM user_command .
|
|
||||||
DATA: lo_error TYPE REF TO zcx_excel,
|
|
||||||
lv_message TYPE string.
|
|
||||||
|
|
||||||
* get save file path
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = l_path ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
cl_gui_frontend_services=>directory_browse(
|
|
||||||
EXPORTING initial_folder = l_path
|
|
||||||
CHANGING selected_folder = l_path ).
|
|
||||||
|
|
||||||
IF l_path IS INITIAL.
|
|
||||||
cl_gui_frontend_services=>get_sapgui_workdir(
|
|
||||||
CHANGING sapworkdir = lv_workdir ).
|
|
||||||
l_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>get_file_separator(
|
|
||||||
CHANGING file_separator = lv_file_separator ).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* export file to save file path
|
|
||||||
TRY.
|
|
||||||
CASE sy-ucomm.
|
|
||||||
WHEN 'EXCELBIND'.
|
|
||||||
CONCATENATE l_path lv_file_separator lv_default_file_name
|
|
||||||
INTO l_path.
|
|
||||||
PERFORM export_to_excel_bind.
|
|
||||||
|
|
||||||
WHEN 'EXCELCONV'.
|
|
||||||
|
|
||||||
CONCATENATE l_path lv_file_separator lv_default_file_name2
|
|
||||||
INTO l_path.
|
|
||||||
PERFORM export_to_excel_conv.
|
|
||||||
|
|
||||||
ENDCASE.
|
|
||||||
|
|
||||||
CATCH zcx_excel INTO lo_error.
|
|
||||||
lv_message = lo_error->get_text( ).
|
|
||||||
MESSAGE lv_message TYPE 'I' DISPLAY LIKE 'E'.
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
ENDFORM. " USER_COMMAND
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* FORM EXPORT_TO_EXCEL_CONV
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* This subroutine is principal demo session
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM export_to_excel_conv RAISING zcx_excel.
|
|
||||||
DATA: lo_converter TYPE REF TO zcl_excel_converter.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_converter.
|
|
||||||
lo_converter->convert(
|
|
||||||
EXPORTING
|
|
||||||
io_alv = lo_salv
|
|
||||||
it_table = gt_sbook
|
|
||||||
i_row_int = 2
|
|
||||||
i_column_int = 2 ).
|
|
||||||
lo_converter->write_file( i_path = l_path ).
|
|
||||||
|
|
||||||
ENDFORM. "EXPORT_TO_EXCEL_CONV
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* FORM EXPORT_TO_EXCEL_BIND
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* This subroutine is principal demo session
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
FORM export_to_excel_bind RAISING zcx_excel.
|
|
||||||
* create zcl_excel_worksheet object
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
|
|
||||||
* write to excel using method Bin_object
|
|
||||||
lo_worksheet->bind_alv(
|
|
||||||
io_alv = lo_salv
|
|
||||||
it_table = gt_sbook
|
|
||||||
i_top = 2
|
|
||||||
i_left = 1
|
|
||||||
).
|
|
||||||
|
|
||||||
PERFORM write_file.
|
|
||||||
|
|
||||||
ENDFORM. "EXPORT_TO_EXCEL_BIND
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form WRITE_FILE
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
* text
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
* --> p1 text
|
|
||||||
* <-- p2 text
|
|
||||||
*----------------------------------------------------------------------*
|
|
||||||
FORM write_file RAISING zcx_excel.
|
|
||||||
DATA: lt_file TYPE solix_tab,
|
|
||||||
l_bytecount TYPE i,
|
|
||||||
l_file TYPE xstring.
|
|
||||||
|
|
||||||
DATA: lo_excel_writer TYPE REF TO zif_excel_writer.
|
|
||||||
|
|
||||||
DATA: ls_seoclass TYPE seoclass.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
|
|
||||||
l_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
|
|
||||||
SELECT SINGLE * INTO ls_seoclass
|
|
||||||
FROM seoclass
|
|
||||||
WHERE clsname = 'CL_BCS_CONVERT'.
|
|
||||||
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
CALL METHOD (ls_seoclass-clsname)=>xstring_to_solix
|
|
||||||
EXPORTING
|
|
||||||
iv_xstring = l_file
|
|
||||||
RECEIVING
|
|
||||||
et_solix = lt_file.
|
|
||||||
|
|
||||||
l_bytecount = xstrlen( l_file ).
|
|
||||||
ELSE.
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = l_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = l_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = l_bytecount
|
|
||||||
filename = l_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file ).
|
|
||||||
|
|
||||||
ENDFORM. " WRITE_FILE
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,118 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL3
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel33.
|
|
||||||
|
|
||||||
TYPES: ty_t005t_lines TYPE TABLE OF t005t.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_converter TYPE REF TO zcl_excel_converter,
|
|
||||||
lo_autofilter TYPE REF TO zcl_excel_autofilter.
|
|
||||||
|
|
||||||
DATA lt_test TYPE ty_t005t_lines.
|
|
||||||
|
|
||||||
DATA: l_cell_value TYPE zexcel_cell_value,
|
|
||||||
ls_area TYPE zexcel_s_autofilter_area.
|
|
||||||
DATA: ls_option TYPE zexcel_s_converter_option.
|
|
||||||
|
|
||||||
CONSTANTS: c_airlines TYPE string VALUE 'Airlines'.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '33_autofilter.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
PARAMETERS p_convex AS CHECKBOX.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Internal table' ).
|
|
||||||
|
|
||||||
PERFORM load_fixed_data CHANGING lt_test.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_converter.
|
|
||||||
|
|
||||||
ls_option-conv_exit_length = p_convex.
|
|
||||||
lo_converter->set_option( ls_option ).
|
|
||||||
lo_converter->convert( EXPORTING
|
|
||||||
it_table = lt_test
|
|
||||||
i_row_int = 1
|
|
||||||
i_column_int = 1
|
|
||||||
io_worksheet = lo_worksheet
|
|
||||||
CHANGING
|
|
||||||
co_excel = lo_excel ) .
|
|
||||||
PERFORM set_column_headers USING lo_worksheet 'Client;Language;Country;Name;Nationality;Long name;Nationality'.
|
|
||||||
|
|
||||||
lo_autofilter = lo_excel->add_new_autofilter( io_sheet = lo_worksheet ) .
|
|
||||||
|
|
||||||
ls_area-row_start = 1.
|
|
||||||
ls_area-col_start = 1.
|
|
||||||
ls_area-row_end = lo_worksheet->get_highest_row( ).
|
|
||||||
ls_area-col_end = lo_worksheet->get_highest_column( ).
|
|
||||||
|
|
||||||
lo_autofilter->set_filter_area( is_area = ls_area ).
|
|
||||||
|
|
||||||
lo_worksheet->get_cell( EXPORTING
|
|
||||||
ip_column = 'C'
|
|
||||||
ip_row = 2
|
|
||||||
IMPORTING
|
|
||||||
ep_value = l_cell_value ).
|
|
||||||
lo_autofilter->set_value( i_column = 3
|
|
||||||
i_value = l_cell_value ).
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
||||||
|
|
||||||
|
|
||||||
FORM load_fixed_data CHANGING ct_test TYPE ty_t005t_lines.
|
|
||||||
DATA: lt_lines TYPE TABLE OF string,
|
|
||||||
lv_line TYPE string,
|
|
||||||
lt_fields TYPE TABLE OF string,
|
|
||||||
lv_comp TYPE i,
|
|
||||||
lv_field TYPE string,
|
|
||||||
ls_test TYPE t005t.
|
|
||||||
FIELD-SYMBOLS: <lv_field> TYPE simple.
|
|
||||||
|
|
||||||
APPEND '001 E AD Andorra Andorran Andorra Andorran ' TO lt_lines.
|
|
||||||
APPEND '001 E BE Belgium Belgian Belgium Belgian ' TO lt_lines.
|
|
||||||
APPEND '001 E DE Germany German Germany German ' TO lt_lines.
|
|
||||||
APPEND '001 E FM Micronesia Micronesian Micronesia Micronesian' TO lt_lines.
|
|
||||||
LOOP AT lt_lines INTO lv_line.
|
|
||||||
CONDENSE lv_line.
|
|
||||||
SPLIT lv_line AT space INTO TABLE lt_fields.
|
|
||||||
lv_comp = 1.
|
|
||||||
LOOP AT lt_fields INTO lv_field.
|
|
||||||
ASSIGN COMPONENT lv_comp OF STRUCTURE ls_test TO <lv_field>.
|
|
||||||
<lv_field> = lv_field.
|
|
||||||
lv_comp = lv_comp + 1.
|
|
||||||
ENDLOOP.
|
|
||||||
APPEND ls_test TO ct_test.
|
|
||||||
ENDLOOP.
|
|
||||||
ENDFORM.
|
|
||||||
|
|
||||||
FORM set_column_headers
|
|
||||||
USING io_worksheet TYPE REF TO zcl_excel_worksheet
|
|
||||||
iv_headers TYPE csequence
|
|
||||||
RAISING zcx_excel.
|
|
||||||
|
|
||||||
DATA: lt_headers TYPE TABLE OF string,
|
|
||||||
lv_header TYPE string,
|
|
||||||
lv_tabix TYPE i.
|
|
||||||
|
|
||||||
SPLIT iv_headers AT ';' INTO TABLE lt_headers.
|
|
||||||
LOOP AT lt_headers INTO lv_header.
|
|
||||||
lv_tabix = sy-tabix.
|
|
||||||
io_worksheet->set_cell( ip_row = 1 ip_column = lv_tabix ip_value = lv_header ).
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ENDFORM.
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL33</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Autofilter</ENTRY>
|
|
||||||
<LENGTH>26</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_CONVEX</KEY>
|
|
||||||
<ENTRY>Output length for conv. exits</ENTRY>
|
|
||||||
<LENGTH>37</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,217 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL2
|
|
||||||
*& Test Styles for ABAP2XLSX
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel34.
|
|
||||||
|
|
||||||
CONSTANTS: width TYPE f VALUE '10.14'.
|
|
||||||
CONSTANTS: height TYPE f VALUE '57.75'.
|
|
||||||
|
|
||||||
DATA: current_row TYPE i,
|
|
||||||
col TYPE i,
|
|
||||||
col_alpha TYPE zexcel_cell_column_alpha,
|
|
||||||
row TYPE i,
|
|
||||||
row_board TYPE i,
|
|
||||||
colorflag TYPE i,
|
|
||||||
color TYPE zexcel_style_color_argb,
|
|
||||||
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_row TYPE REF TO zcl_excel_row,
|
|
||||||
|
|
||||||
writing1 TYPE string,
|
|
||||||
writing2 TYPE string.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '34_Static Styles_Chess.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Spassky_vs_Bronstein' ).
|
|
||||||
|
|
||||||
* Header
|
|
||||||
current_row = 1.
|
|
||||||
|
|
||||||
ADD 1 TO current_row.
|
|
||||||
lo_worksheet->set_cell( ip_row = current_row ip_column = 'B' ip_value = 'White' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = current_row ip_column = 'C' ip_value = 'Spassky, Boris V -- wins in turn 23' ).
|
|
||||||
|
|
||||||
ADD 1 TO current_row.
|
|
||||||
lo_worksheet->set_cell( ip_row = current_row ip_column = 'B' ip_value = 'Black' ).
|
|
||||||
lo_worksheet->set_cell( ip_row = current_row ip_column = 'C' ip_value = 'Bronstein, David I' ).
|
|
||||||
|
|
||||||
ADD 1 TO current_row.
|
|
||||||
* Set size of column + Writing above chessboard
|
|
||||||
DO 8 TIMES.
|
|
||||||
|
|
||||||
writing1 = zcl_excel_common=>convert_column2alpha( sy-index ).
|
|
||||||
writing2 = sy-index .
|
|
||||||
row = current_row + sy-index.
|
|
||||||
|
|
||||||
col = sy-index + 1.
|
|
||||||
col_alpha = zcl_excel_common=>convert_column2alpha( col ).
|
|
||||||
|
|
||||||
* Set size of column
|
|
||||||
lo_column = lo_worksheet->get_column( col_alpha ).
|
|
||||||
lo_column->set_width( width ).
|
|
||||||
|
|
||||||
* Set size of row
|
|
||||||
lo_row = lo_worksheet->get_row( row ).
|
|
||||||
lo_row->set_row_height( height ).
|
|
||||||
|
|
||||||
* Set writing on chessboard
|
|
||||||
lo_worksheet->set_cell( ip_row = row
|
|
||||||
ip_column = 'A'
|
|
||||||
ip_value = writing2 ).
|
|
||||||
lo_worksheet->change_cell_style( ip_column = 'A'
|
|
||||||
ip_row = row
|
|
||||||
ip_alignment_vertical = zcl_excel_style_alignment=>c_vertical_center ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row
|
|
||||||
ip_column = 'J'
|
|
||||||
ip_value = writing2 ).
|
|
||||||
lo_worksheet->change_cell_style( ip_column = 'J'
|
|
||||||
ip_row = row
|
|
||||||
ip_alignment_vertical = zcl_excel_style_alignment=>c_vertical_center ).
|
|
||||||
|
|
||||||
row = current_row + 9.
|
|
||||||
lo_worksheet->set_cell( ip_row = current_row
|
|
||||||
ip_column = col_alpha
|
|
||||||
ip_value = writing1 ).
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = current_row
|
|
||||||
ip_alignment_horizontal = zcl_excel_style_alignment=>c_horizontal_center ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row
|
|
||||||
ip_column = col_alpha
|
|
||||||
ip_value = writing1 ).
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_alignment_horizontal = zcl_excel_style_alignment=>c_horizontal_center ).
|
|
||||||
ENDDO.
|
|
||||||
lo_column = lo_worksheet->get_column( 'A' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'J' ).
|
|
||||||
lo_column->set_auto_size( abap_true ).
|
|
||||||
|
|
||||||
* Set win-position
|
|
||||||
CONSTANTS: c_pawn TYPE string VALUE 'Pawn'.
|
|
||||||
CONSTANTS: c_rook TYPE string VALUE 'Rook'.
|
|
||||||
CONSTANTS: c_knight TYPE string VALUE 'Knight'.
|
|
||||||
CONSTANTS: c_bishop TYPE string VALUE 'Bishop'.
|
|
||||||
CONSTANTS: c_queen TYPE string VALUE 'Queen'.
|
|
||||||
CONSTANTS: c_king TYPE string VALUE 'King'.
|
|
||||||
|
|
||||||
row = current_row + 1.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'B' ip_value = c_rook ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'F' ip_value = c_rook ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'G' ip_value = c_knight ).
|
|
||||||
row = current_row + 2.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'B' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'C' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'D' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'F' ip_value = c_queen ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'H' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'I' ip_value = c_king ).
|
|
||||||
row = current_row + 3.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'I' ip_value = c_pawn ).
|
|
||||||
row = current_row + 4.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'D' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'F' ip_value = c_knight ).
|
|
||||||
row = current_row + 5.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'E' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'F' ip_value = c_queen ).
|
|
||||||
row = current_row + 6.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'C' ip_value = c_bishop ).
|
|
||||||
row = current_row + 7.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'B' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'C' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'H' ip_value = c_pawn ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'I' ip_value = c_pawn ).
|
|
||||||
row = current_row + 8.
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'G' ip_value = c_rook ).
|
|
||||||
lo_worksheet->set_cell( ip_row = row ip_column = 'H' ip_value = c_king ).
|
|
||||||
|
|
||||||
* Set Chessboard
|
|
||||||
DO 8 TIMES.
|
|
||||||
IF sy-index <= 3. " Black
|
|
||||||
color = zcl_excel_style_color=>c_black.
|
|
||||||
ELSE.
|
|
||||||
color = zcl_excel_style_color=>c_white.
|
|
||||||
ENDIF.
|
|
||||||
row_board = sy-index.
|
|
||||||
row = current_row + sy-index.
|
|
||||||
DO 8 TIMES.
|
|
||||||
col = sy-index + 1.
|
|
||||||
col_alpha = zcl_excel_common=>convert_column2alpha( col ).
|
|
||||||
TRY.
|
|
||||||
* Borders around outer limits
|
|
||||||
IF row_board = 1.
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_borders_top_style = zcl_excel_style_border=>c_border_thick
|
|
||||||
ip_borders_top_color_rgb = zcl_excel_style_color=>c_black ).
|
|
||||||
ENDIF.
|
|
||||||
IF row_board = 8.
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_borders_down_style = zcl_excel_style_border=>c_border_thick
|
|
||||||
ip_borders_down_color_rgb = zcl_excel_style_color=>c_black ).
|
|
||||||
ENDIF.
|
|
||||||
IF col = 2.
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_borders_left_style = zcl_excel_style_border=>c_border_thick
|
|
||||||
ip_borders_left_color_rgb = zcl_excel_style_color=>c_black ).
|
|
||||||
ENDIF.
|
|
||||||
IF col = 9.
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_borders_right_style = zcl_excel_style_border=>c_border_thick
|
|
||||||
ip_borders_right_color_rgb = zcl_excel_style_color=>c_black ).
|
|
||||||
ENDIF.
|
|
||||||
* Style for writing
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_font_color_rgb = color
|
|
||||||
ip_font_bold = 'X'
|
|
||||||
ip_font_size = 16
|
|
||||||
ip_alignment_horizontal = zcl_excel_style_alignment=>c_horizontal_center
|
|
||||||
ip_alignment_vertical = zcl_excel_style_alignment=>c_vertical_center
|
|
||||||
ip_fill_filltype = zcl_excel_style_fill=>c_fill_solid ).
|
|
||||||
* Color of field
|
|
||||||
colorflag = ( row + col ) MOD 2.
|
|
||||||
IF colorflag = 0.
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_fill_fgcolor_rgb = 'FFB5866A'
|
|
||||||
ip_fill_filltype = zcl_excel_style_fill=>c_fill_gradient_diagonal135 ).
|
|
||||||
ELSE.
|
|
||||||
lo_worksheet->change_cell_style( ip_column = col_alpha
|
|
||||||
ip_row = row
|
|
||||||
ip_fill_fgcolor_rgb = 'FFF5DEBF'
|
|
||||||
ip_fill_filltype = zcl_excel_style_fill=>c_fill_gradient_diagonal45 ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CATCH zcx_excel .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
ENDDO.
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL34</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Static Styles (Chess)</ENTRY>
|
|
||||||
<LENGTH>37</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,170 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL2
|
|
||||||
*& Test Styles for ABAP2XLSX
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel35.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_excel_writer TYPE REF TO zif_excel_writer,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_bold TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_underline TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_filled TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_border TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_button TYPE REF TO zcl_excel_style,
|
|
||||||
lo_border_dark TYPE REF TO zcl_excel_style_border,
|
|
||||||
lo_border_light TYPE REF TO zcl_excel_style_border.
|
|
||||||
|
|
||||||
DATA: lv_style_bold_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_underline_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_filled_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_filled_green_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_border_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_button_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_filled_turquoise_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
DATA: lv_file TYPE xstring,
|
|
||||||
lv_bytecount TYPE i,
|
|
||||||
lt_file_tab TYPE solix_tab.
|
|
||||||
|
|
||||||
DATA: lv_full_path TYPE string,
|
|
||||||
lv_workdir TYPE string,
|
|
||||||
lv_file_separator TYPE c.
|
|
||||||
|
|
||||||
CONSTANTS: lv_default_file_name TYPE string VALUE '35_Static_Styles.xlsx'.
|
|
||||||
|
|
||||||
PARAMETERS: p_path TYPE zexcel_export_dir.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
|
|
||||||
lv_workdir = p_path.
|
|
||||||
cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir
|
|
||||||
CHANGING selected_folder = lv_workdir ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
cl_gui_frontend_services=>get_desktop_directory( CHANGING desktop_directory = lv_workdir ).
|
|
||||||
cl_gui_cfw=>flush( ).
|
|
||||||
p_path = lv_workdir.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
IF p_path IS INITIAL.
|
|
||||||
p_path = lv_workdir.
|
|
||||||
ENDIF.
|
|
||||||
cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
|
|
||||||
CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Create border object
|
|
||||||
CREATE OBJECT lo_border_dark.
|
|
||||||
lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black.
|
|
||||||
lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
CREATE OBJECT lo_border_light.
|
|
||||||
lo_border_light->border_color-rgb = zcl_excel_style_color=>c_gray.
|
|
||||||
lo_border_light->border_style = zcl_excel_style_border=>c_border_thin.
|
|
||||||
" Create a bold / italic style
|
|
||||||
lo_style_bold = lo_excel->add_new_style( ).
|
|
||||||
lo_style_bold->font->bold = abap_true.
|
|
||||||
lo_style_bold->font->italic = abap_true.
|
|
||||||
lo_style_bold->font->name = zcl_excel_style_font=>c_name_arial.
|
|
||||||
lo_style_bold->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_bold->font->color-rgb = zcl_excel_style_color=>c_red.
|
|
||||||
lv_style_bold_guid = lo_style_bold->get_guid( ).
|
|
||||||
" Create an underline double style
|
|
||||||
lo_style_underline = lo_excel->add_new_style( ).
|
|
||||||
lo_style_underline->font->underline = abap_true.
|
|
||||||
lo_style_underline->font->underline_mode = zcl_excel_style_font=>c_underline_double.
|
|
||||||
lo_style_underline->font->name = zcl_excel_style_font=>c_name_roman.
|
|
||||||
lo_style_underline->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_underline->font->family = zcl_excel_style_font=>c_family_roman.
|
|
||||||
lv_style_underline_guid = lo_style_underline->get_guid( ).
|
|
||||||
" Create filled style yellow
|
|
||||||
lo_style_filled = lo_excel->add_new_style( ).
|
|
||||||
lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled->fill->fgcolor-theme = zcl_excel_style_color=>c_theme_accent6.
|
|
||||||
lv_style_filled_guid = lo_style_filled->get_guid( ).
|
|
||||||
" Create border with button effects
|
|
||||||
lo_style_button = lo_excel->add_new_style( ).
|
|
||||||
lo_style_button->borders->right = lo_border_dark.
|
|
||||||
lo_style_button->borders->down = lo_border_dark.
|
|
||||||
lo_style_button->borders->left = lo_border_light.
|
|
||||||
lo_style_button->borders->top = lo_border_light.
|
|
||||||
lv_style_button_guid = lo_style_button->get_guid( ).
|
|
||||||
"Create style with border
|
|
||||||
lo_style_border = lo_excel->add_new_style( ).
|
|
||||||
lo_style_border->borders->allborders = lo_border_dark.
|
|
||||||
lo_style_border->borders->diagonal = lo_border_dark.
|
|
||||||
lo_style_border->borders->diagonal_mode = zcl_excel_style_borders=>c_diagonal_both.
|
|
||||||
lv_style_border_guid = lo_style_border->get_guid( ).
|
|
||||||
" Create filled style green
|
|
||||||
lo_style_filled = lo_excel->add_new_style( ).
|
|
||||||
lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled->fill->fgcolor-rgb = zcl_excel_style_color=>c_green.
|
|
||||||
lo_style_filled->font->name = zcl_excel_style_font=>c_name_cambria.
|
|
||||||
lo_style_filled->font->scheme = zcl_excel_style_font=>c_scheme_major.
|
|
||||||
lv_style_filled_green_guid = lo_style_filled->get_guid( ).
|
|
||||||
|
|
||||||
" Create filled style turquoise using legacy excel ver <= 2003 palette. (https://code.sdn.sap.com/spaces/abap2xlsx/tickets/92)
|
|
||||||
lo_style_filled = lo_excel->add_new_style( ).
|
|
||||||
lo_excel->legacy_palette->set_color( "replace built-in color from palette with out custom RGB turquoise
|
|
||||||
ip_index = 16
|
|
||||||
ip_color = '0040E0D0' ).
|
|
||||||
|
|
||||||
lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
|
|
||||||
lo_style_filled->fill->fgcolor-indexed = 16.
|
|
||||||
lv_style_filled_turquoise_guid = lo_style_filled->get_guid( ).
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Styles' ).
|
|
||||||
lo_worksheet->set_cell( ip_columnrow = 'B2' ip_value = 'Hello world' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Bold text' ip_style = lv_style_bold_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 4 ip_value = 'Underlined text' ip_style = lv_style_underline_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'Filled text' ip_style = lv_style_filled_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = 'Borders' ip_style = lv_style_border_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 7 ip_value = 'I''m not a button :)' ip_style = lv_style_button_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'Modified color for Excel 2003' ip_style = lv_style_filled_turquoise_guid ).
|
|
||||||
" Fill the cell and apply one style
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = 'Filled text' ip_style = lv_style_filled_guid ).
|
|
||||||
" Change the style
|
|
||||||
lo_worksheet->set_cell_style( ip_columnrow = 'B6' ip_style = lv_style_filled_green_guid ).
|
|
||||||
" Add Style to an empty cell to test Fix for Issue
|
|
||||||
"#44 Exception ZCX_EXCEL thrown when style is set for an empty cell
|
|
||||||
" https://code.sdn.sap.com/spaces/abap2xlsx/tickets/44-exception-zcx_excel-thrown-when-style-is-set-for-an-empty-cell
|
|
||||||
lo_worksheet->set_cell_style( ip_column = 'E' ip_row = 6 ip_style = lv_style_filled_green_guid ).
|
|
||||||
|
|
||||||
|
|
||||||
* Demonstrate how to retroactivly change the cellstyle
|
|
||||||
*Filled text and underlinded text
|
|
||||||
lo_worksheet->change_cell_style( ip_columnrow = 'B5'
|
|
||||||
ip_font_bold = abap_true
|
|
||||||
ip_font_italic = abap_true ).
|
|
||||||
|
|
||||||
lo_worksheet->change_cell_style( ip_column = 'D'
|
|
||||||
ip_row = 4
|
|
||||||
ip_font_bold = abap_true
|
|
||||||
ip_font_italic = abap_true ).
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
|
|
||||||
lv_file = lo_excel_writer->write_file( lo_excel ).
|
|
||||||
|
|
||||||
" Convert to binary
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
|
||||||
EXPORTING
|
|
||||||
buffer = lv_file
|
|
||||||
IMPORTING
|
|
||||||
output_length = lv_bytecount
|
|
||||||
TABLES
|
|
||||||
binary_tab = lt_file_tab.
|
|
||||||
|
|
||||||
" Save the file
|
|
||||||
cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
|
|
||||||
filename = lv_full_path
|
|
||||||
filetype = 'BIN'
|
|
||||||
CHANGING data_tab = lt_file_tab ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL35</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: static styles</ENTRY>
|
|
||||||
<LENGTH>33</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,111 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL36
|
|
||||||
REPORT zdemo_excel36.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
col TYPE i.
|
|
||||||
|
|
||||||
DATA: lo_style_arial20 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_times11 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_cambria8red TYPE REF TO zcl_excel_style.
|
|
||||||
|
|
||||||
DATA: lv_style_arial20_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_times11_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_cambria8red_guid TYPE zexcel_cell_style.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '36_DefaultStyles.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Create a bold / italic style
|
|
||||||
lo_style_arial20 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_arial20->font->name = zcl_excel_style_font=>c_name_arial.
|
|
||||||
lo_style_arial20->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_arial20->font->size = 20.
|
|
||||||
lv_style_arial20_guid = lo_style_arial20->get_guid( ).
|
|
||||||
|
|
||||||
lo_style_times11 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_times11->font->name = zcl_excel_style_font=>c_name_roman.
|
|
||||||
lo_style_times11->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_times11->font->size = 11.
|
|
||||||
lv_style_times11_guid = lo_style_times11->get_guid( ).
|
|
||||||
|
|
||||||
lo_style_cambria8red = lo_excel->add_new_style( ).
|
|
||||||
lo_style_cambria8red->font->name = zcl_excel_style_font=>c_name_cambria.
|
|
||||||
lo_style_cambria8red->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_cambria8red->font->size = 8.
|
|
||||||
lo_style_cambria8red->font->color-rgb = zcl_excel_style_color=>c_red.
|
|
||||||
lv_style_cambria8red_guid = lo_style_cambria8red->get_guid( ).
|
|
||||||
|
|
||||||
lo_excel->set_default_style( lv_style_arial20_guid ). " Default for all new worksheets
|
|
||||||
|
|
||||||
* 1st sheet - do not change anything --> defaultstyle from lo_excel should apply
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Style for complete document' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 4 ip_value = 'All cells in this sheet are set to font Arial, fontsize 20' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 5 ip_value = 'because no separate style was passed for this sheet' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 6 ip_value = 'but a default style was set for the complete instance of zcl_excel' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 1 ip_value = space ). " Missing feature "set active cell - use this to simulate that
|
|
||||||
|
|
||||||
|
|
||||||
* 2nd sheet - defaultstyle for this sheet set explicitly ( set to Times New Roman 11 )
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Style for this sheet' ).
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~set_style( lv_style_times11_guid ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 4 ip_value = 'All cells in this sheet are set to font Times New Roman, fontsize 11' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 5 ip_value = 'because this style was passed for this sheet' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 6 ip_value = 'thus the default style from zcl_excel does not apply to this sheet' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 1 ip_value = space ). " Missing feature "set active cell - use this to simulate that
|
|
||||||
|
|
||||||
|
|
||||||
* 3rd sheet - defaultstyle for columns ( set to Times New Roman 11 )
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'Style for 3 columns' ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'B' ).
|
|
||||||
lo_column->set_column_style_by_guid( ip_style_guid = lv_style_times11_guid ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'C' ).
|
|
||||||
lo_column->set_column_style_by_guid( ip_style_guid = lv_style_times11_guid ).
|
|
||||||
lo_column = lo_worksheet->get_column( 'F' ).
|
|
||||||
lo_column->set_column_style_by_guid( ip_style_guid = lv_style_times11_guid ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 4 ip_value = 'The columns B,C and F are set to Times New Roman' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 10 ip_value = 'All other cells in this sheet are set to font Arial, fontsize 20' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 11 ip_value = 'because no separate style was passed for this sheet' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 12 ip_value = 'but a default style was set for the complete instance of zcl_excel' ).
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 8 ip_row = 1 ip_value = 'Of course' ip_style = lv_style_cambria8red_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 8 ip_row = 2 ip_value = 'setting a specific style to a cell' ip_style = lv_style_cambria8red_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 8 ip_row = 3 ip_value = 'takes precedence over all defaults' ip_style = lv_style_cambria8red_guid ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 8 ip_row = 4 ip_value = 'Here: Cambria 8 in red' ip_style = lv_style_cambria8red_guid ).
|
|
||||||
|
|
||||||
|
|
||||||
* Set entry into each of the first 10 columns
|
|
||||||
DO 20 TIMES.
|
|
||||||
col = sy-index.
|
|
||||||
CASE col.
|
|
||||||
WHEN 2 " B
|
|
||||||
OR 3 " C
|
|
||||||
OR 6." F
|
|
||||||
lo_worksheet->set_cell( ip_column = col ip_row = 6 ip_value = 'Times 11' ).
|
|
||||||
WHEN OTHERS.
|
|
||||||
lo_worksheet->set_cell( ip_column = col ip_row = 6 ip_value = 'Arial 20' ).
|
|
||||||
ENDCASE.
|
|
||||||
ENDDO.
|
|
||||||
|
|
||||||
lo_worksheet->set_cell( ip_column = 2 ip_row = 1 ip_value = space ). " Missing feature "set active cell - use this to simulate that
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lo_excel->set_active_sheet_index( 1 ).
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL36</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Default Styles</ENTRY>
|
|
||||||
<LENGTH>31</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,301 +0,0 @@
|
||||||
REPORT zdemo_excel37.
|
|
||||||
|
|
||||||
DATA: excel TYPE REF TO zcl_excel,
|
|
||||||
reader TYPE REF TO zif_excel_reader,
|
|
||||||
go_error TYPE REF TO cx_root,
|
|
||||||
gv_memid_gr8 TYPE text255,
|
|
||||||
gv_message TYPE string,
|
|
||||||
lv_extension TYPE string,
|
|
||||||
gv_error_program_name TYPE syrepid,
|
|
||||||
gv_error_include_name TYPE syrepid,
|
|
||||||
gv_error_line TYPE i.
|
|
||||||
|
|
||||||
DATA: gc_save_file_name TYPE string VALUE '37- Read template and output.&'.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK blx WITH FRAME.
|
|
||||||
PARAMETERS: p_upfile TYPE string LOWER CASE MEMORY ID gr8.
|
|
||||||
PARAMETERS: p_applse AS CHECKBOX.
|
|
||||||
SELECTION-SCREEN END OF BLOCK blx.
|
|
||||||
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK cls WITH FRAME TITLE TEXT-cls.
|
|
||||||
PARAMETERS: lb_read TYPE seoclsname AS LISTBOX VISIBLE LENGTH 40 LOWER CASE OBLIGATORY DEFAULT 'Autodetect'(001).
|
|
||||||
PARAMETERS: lb_write TYPE seoclsname AS LISTBOX VISIBLE LENGTH 40 LOWER CASE OBLIGATORY DEFAULT 'Autodetect'(001).
|
|
||||||
SELECTION-SCREEN END OF BLOCK cls.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK bl_err WITH FRAME TITLE TEXT-err.
|
|
||||||
PARAMETERS: cb_errl AS CHECKBOX DEFAULT 'X'.
|
|
||||||
SELECTION-SCREEN BEGIN OF LINE.
|
|
||||||
PARAMETERS: cb_dump AS CHECKBOX DEFAULT space.
|
|
||||||
SELECTION-SCREEN COMMENT (60) cmt_dump FOR FIELD cb_dump.
|
|
||||||
SELECTION-SCREEN END OF LINE.
|
|
||||||
SELECTION-SCREEN END OF BLOCK bl_err.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
PERFORM setup_listboxes.
|
|
||||||
cmt_dump = TEXT-dum.
|
|
||||||
GET PARAMETER ID 'GR8' FIELD gv_memid_gr8.
|
|
||||||
p_upfile = gv_memid_gr8.
|
|
||||||
|
|
||||||
IF p_upfile IS INITIAL.
|
|
||||||
p_upfile = 'c:\temp\whatever.xlsx'.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upfile.
|
|
||||||
PERFORM f4_p_upfile CHANGING p_upfile.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
IF cb_dump IS INITIAL.
|
|
||||||
TRY.
|
|
||||||
PERFORM read_template.
|
|
||||||
PERFORM write_template.
|
|
||||||
*** Create output
|
|
||||||
CATCH cx_root INTO go_error.
|
|
||||||
MESSAGE 'Error reading excelfile' TYPE 'I'.
|
|
||||||
gv_message = go_error->get_text( ).
|
|
||||||
IF cb_errl = ' '.
|
|
||||||
IF gv_message IS NOT INITIAL.
|
|
||||||
MESSAGE gv_message TYPE 'I'.
|
|
||||||
ENDIF.
|
|
||||||
ELSE.
|
|
||||||
go_error->get_source_position( IMPORTING program_name = gv_error_program_name
|
|
||||||
include_name = gv_error_include_name
|
|
||||||
source_line = gv_error_line ).
|
|
||||||
WRITE:/ 'Errormessage:' ,gv_message.
|
|
||||||
WRITE:/ 'Errorposition:',
|
|
||||||
AT /10 'Program:' ,gv_error_program_name,
|
|
||||||
AT /10 'include_name:' ,gv_error_include_name,
|
|
||||||
AT /10 'source_line:' ,gv_error_line.
|
|
||||||
ENDIF.
|
|
||||||
ENDTRY.
|
|
||||||
ELSE. " This will dump if an error occurs. In some cases the information given in cx_root is not helpful - this will show exactly where the problem is
|
|
||||||
PERFORM read_template.
|
|
||||||
PERFORM write_template.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form F4_P_UPFILE
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
FORM f4_p_upfile CHANGING p_upfile TYPE string.
|
|
||||||
|
|
||||||
DATA: lv_repid TYPE syrepid,
|
|
||||||
lt_fields TYPE dynpread_tabtype,
|
|
||||||
ls_field LIKE LINE OF lt_fields,
|
|
||||||
lt_files TYPE filetable,
|
|
||||||
lv_rc TYPE i,
|
|
||||||
lv_file_filter TYPE string.
|
|
||||||
|
|
||||||
lv_repid = sy-repid.
|
|
||||||
|
|
||||||
CALL FUNCTION 'DYNP_VALUES_READ'
|
|
||||||
EXPORTING
|
|
||||||
dyname = lv_repid
|
|
||||||
dynumb = '1000'
|
|
||||||
request = 'A'
|
|
||||||
TABLES
|
|
||||||
dynpfields = lt_fields
|
|
||||||
EXCEPTIONS
|
|
||||||
invalid_abapworkarea = 01
|
|
||||||
invalid_dynprofield = 02
|
|
||||||
invalid_dynproname = 03
|
|
||||||
invalid_dynpronummer = 04
|
|
||||||
invalid_request = 05
|
|
||||||
no_fielddescription = 06
|
|
||||||
undefind_error = 07.
|
|
||||||
READ TABLE lt_fields INTO ls_field WITH KEY fieldname = 'P_UPFILE'.
|
|
||||||
p_upfile = ls_field-fieldvalue.
|
|
||||||
|
|
||||||
lv_file_filter = 'Excel Files (*.XLSX;*.XLSM)|*.XLSX;*.XLSM'.
|
|
||||||
cl_gui_frontend_services=>file_open_dialog( EXPORTING
|
|
||||||
default_filename = p_upfile
|
|
||||||
file_filter = lv_file_filter
|
|
||||||
CHANGING
|
|
||||||
file_table = lt_files
|
|
||||||
rc = lv_rc
|
|
||||||
EXCEPTIONS
|
|
||||||
OTHERS = 1 ).
|
|
||||||
READ TABLE lt_files INDEX 1 INTO p_upfile.
|
|
||||||
|
|
||||||
ENDFORM. " F4_P_UPFILE
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form SETUP_LISTBOXES
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
FORM setup_listboxes .
|
|
||||||
|
|
||||||
DATA: lv_id TYPE vrm_id,
|
|
||||||
lt_values TYPE vrm_values,
|
|
||||||
lt_implementing_classes TYPE seo_relkeys.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <ls_implementing_class> LIKE LINE OF lt_implementing_classes,
|
|
||||||
<ls_value> LIKE LINE OF lt_values.
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Possible READER-Classes
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
lv_id = 'LB_READ'.
|
|
||||||
APPEND INITIAL LINE TO lt_values ASSIGNING <ls_value>.
|
|
||||||
<ls_value>-key = 'Autodetect'(001).
|
|
||||||
<ls_value>-text = 'Autodetect'(001).
|
|
||||||
|
|
||||||
|
|
||||||
PERFORM get_implementing_classds USING 'ZIF_EXCEL_READER'
|
|
||||||
CHANGING lt_implementing_classes.
|
|
||||||
CLEAR lt_values.
|
|
||||||
LOOP AT lt_implementing_classes ASSIGNING <ls_implementing_class>.
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO lt_values ASSIGNING <ls_value>.
|
|
||||||
<ls_value>-key = <ls_implementing_class>-clsname.
|
|
||||||
<ls_value>-text = <ls_implementing_class>-clsname.
|
|
||||||
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
CALL FUNCTION 'VRM_SET_VALUES'
|
|
||||||
EXPORTING
|
|
||||||
id = lv_id
|
|
||||||
values = lt_values
|
|
||||||
EXCEPTIONS
|
|
||||||
id_illegal_name = 1
|
|
||||||
OTHERS = 2.
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Possible WRITER-Classes
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
lv_id = 'LB_WRITE'.
|
|
||||||
APPEND INITIAL LINE TO lt_values ASSIGNING <ls_value>.
|
|
||||||
<ls_value>-key = 'Autodetect'(001).
|
|
||||||
<ls_value>-text = 'Autodetect'(001).
|
|
||||||
|
|
||||||
|
|
||||||
PERFORM get_implementing_classds USING 'ZIF_EXCEL_WRITER'
|
|
||||||
CHANGING lt_implementing_classes.
|
|
||||||
CLEAR lt_values.
|
|
||||||
LOOP AT lt_implementing_classes ASSIGNING <ls_implementing_class>.
|
|
||||||
|
|
||||||
APPEND INITIAL LINE TO lt_values ASSIGNING <ls_value>.
|
|
||||||
<ls_value>-key = <ls_implementing_class>-clsname.
|
|
||||||
<ls_value>-text = <ls_implementing_class>-clsname.
|
|
||||||
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
CALL FUNCTION 'VRM_SET_VALUES'
|
|
||||||
EXPORTING
|
|
||||||
id = lv_id
|
|
||||||
values = lt_values
|
|
||||||
EXCEPTIONS
|
|
||||||
id_illegal_name = 1
|
|
||||||
OTHERS = 2.
|
|
||||||
|
|
||||||
ENDFORM. " SETUP_LISTBOXES
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form GET_IMPLEMENTING_CLASSDS
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
FORM get_implementing_classds USING iv_interface_name TYPE clike
|
|
||||||
CHANGING ct_implementing_classes TYPE seo_relkeys.
|
|
||||||
|
|
||||||
DATA: lo_oo_interface TYPE REF TO cl_oo_interface,
|
|
||||||
lo_oo_class TYPE REF TO cl_oo_class,
|
|
||||||
lt_implementing_subclasses TYPE seo_relkeys.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <ls_implementing_class> LIKE LINE OF ct_implementing_classes.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
lo_oo_interface ?= cl_oo_interface=>get_instance( iv_interface_name ).
|
|
||||||
CATCH cx_class_not_existent.
|
|
||||||
RETURN.
|
|
||||||
ENDTRY.
|
|
||||||
ct_implementing_classes = lo_oo_interface->get_implementing_classes( ).
|
|
||||||
|
|
||||||
LOOP AT ct_implementing_classes ASSIGNING <ls_implementing_class>.
|
|
||||||
TRY.
|
|
||||||
lo_oo_class ?= cl_oo_class=>get_instance( <ls_implementing_class>-clsname ).
|
|
||||||
lt_implementing_subclasses = lo_oo_class->get_subclasses( ).
|
|
||||||
APPEND LINES OF lt_implementing_subclasses TO ct_implementing_classes.
|
|
||||||
CATCH cx_class_not_existent.
|
|
||||||
ENDTRY.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
|
|
||||||
ENDFORM. " GET_IMPLEMENTING_CLASSDS
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form READ_TEMPLATE
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
FORM read_template RAISING zcx_excel .
|
|
||||||
|
|
||||||
CASE lb_read.
|
|
||||||
WHEN 'Autodetect'(001).
|
|
||||||
FIND REGEX '(\.xlsx|\.xlsm)\s*$' IN p_upfile SUBMATCHES lv_extension.
|
|
||||||
TRANSLATE lv_extension TO UPPER CASE.
|
|
||||||
CASE lv_extension.
|
|
||||||
|
|
||||||
WHEN '.XLSX'.
|
|
||||||
CREATE OBJECT reader TYPE zcl_excel_reader_2007.
|
|
||||||
excel = reader->load_file( i_filename = p_upfile i_from_applserver = p_applse ).
|
|
||||||
"Use template for charts
|
|
||||||
excel->use_template = abap_true.
|
|
||||||
|
|
||||||
WHEN '.XLSM'.
|
|
||||||
CREATE OBJECT reader TYPE zcl_excel_reader_xlsm.
|
|
||||||
excel = reader->load_file( i_filename = p_upfile i_from_applserver = p_applse ).
|
|
||||||
"Use template for charts
|
|
||||||
excel->use_template = abap_true.
|
|
||||||
|
|
||||||
WHEN OTHERS.
|
|
||||||
MESSAGE 'Unsupported filetype' TYPE 'I'.
|
|
||||||
RETURN.
|
|
||||||
|
|
||||||
ENDCASE.
|
|
||||||
|
|
||||||
WHEN OTHERS.
|
|
||||||
CREATE OBJECT reader TYPE (lb_read).
|
|
||||||
excel = reader->load_file( i_filename = p_upfile i_from_applserver = p_applse ).
|
|
||||||
"Use template for charts
|
|
||||||
excel->use_template = abap_true.
|
|
||||||
|
|
||||||
ENDCASE.
|
|
||||||
|
|
||||||
ENDFORM. " READ_TEMPLATE
|
|
||||||
|
|
||||||
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Form WRITE_TEMPLATE
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
FORM write_template RAISING zcx_excel.
|
|
||||||
|
|
||||||
CASE lb_write.
|
|
||||||
|
|
||||||
WHEN 'Autodetect'(001).
|
|
||||||
FIND REGEX '(\.xlsx|\.xlsm)\s*$' IN p_upfile SUBMATCHES lv_extension.
|
|
||||||
TRANSLATE lv_extension TO UPPER CASE.
|
|
||||||
CASE lv_extension.
|
|
||||||
|
|
||||||
WHEN '.XLSX'.
|
|
||||||
REPLACE '&' IN gc_save_file_name WITH 'xlsx'. " Pass extension for standard writer
|
|
||||||
lcl_output=>output( excel ).
|
|
||||||
|
|
||||||
WHEN '.XLSM'.
|
|
||||||
REPLACE '&' IN gc_save_file_name WITH 'xlsm'. " Pass extension for macro-writer
|
|
||||||
lcl_output=>output( cl_excel = excel
|
|
||||||
iv_writerclass_name = 'ZCL_EXCEL_WRITER_XLSM' ).
|
|
||||||
|
|
||||||
WHEN OTHERS.
|
|
||||||
MESSAGE 'Unsupported filetype' TYPE 'I'.
|
|
||||||
RETURN.
|
|
||||||
|
|
||||||
ENDCASE.
|
|
||||||
|
|
||||||
WHEN OTHERS.
|
|
||||||
lcl_output=>output( cl_excel = excel
|
|
||||||
iv_writerclass_name = lb_write ).
|
|
||||||
ENDCASE.
|
|
||||||
|
|
||||||
ENDFORM. " WRITE_TEMPLATE
|
|
|
@ -1,118 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL37</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>DUM</KEY>
|
|
||||||
<ENTRY>Enable dump creation</ENTRY>
|
|
||||||
<LENGTH>40</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Read xlsx-file and output = using templates</ENTRY>
|
|
||||||
<LENGTH>59</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>CB_ERRL</KEY>
|
|
||||||
<ENTRY>Show error location</ENTRY>
|
|
||||||
<LENGTH>27</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>LB_READ</KEY>
|
|
||||||
<ENTRY>Reader class</ENTRY>
|
|
||||||
<LENGTH>20</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>LB_WRITE</KEY>
|
|
||||||
<ENTRY>Writer class</ENTRY>
|
|
||||||
<LENGTH>20</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_APPLSE</KEY>
|
|
||||||
<ENTRY>From Application Server</ENTRY>
|
|
||||||
<LENGTH>31</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_UPFILE</KEY>
|
|
||||||
<ENTRY>Input template</ENTRY>
|
|
||||||
<LENGTH>22</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
<I18N_TPOOL>
|
|
||||||
<item>
|
|
||||||
<LANGUAGE>D</LANGUAGE>
|
|
||||||
<TEXTPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>CLS</KEY>
|
|
||||||
<ENTRY>Auswahl der Reader- und Writerklasse</ENTRY>
|
|
||||||
<LENGTH>70</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>DUM</KEY>
|
|
||||||
<ENTRY>Dump bei unbeh. Exception. Man weiß wenn man das braucht</ENTRY>
|
|
||||||
<LENGTH>60</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>ERR</KEY>
|
|
||||||
<ENTRY>Besondere Schalter</ENTRY>
|
|
||||||
<LENGTH>60</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>Xlsx-Datei lesen und dann wieder ausgeben = Arbeiten mit Templates</ENTRY>
|
|
||||||
<LENGTH>70</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>CB_DUMP</KEY>
|
|
||||||
<ENTRY>Dump bei unbeh. Exceptions</ENTRY>
|
|
||||||
<LENGTH>36</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>CB_ERRL</KEY>
|
|
||||||
<ENTRY>Exceptionposition anzeigen</ENTRY>
|
|
||||||
<LENGTH>34</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>LB_READ</KEY>
|
|
||||||
<ENTRY>Reader-Klasse</ENTRY>
|
|
||||||
<LENGTH>21</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>LB_WRITE</KEY>
|
|
||||||
<ENTRY>Writer-Klasse</ENTRY>
|
|
||||||
<LENGTH>21</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_UPFILE</KEY>
|
|
||||||
<ENTRY>Hochzuladende Datei</ENTRY>
|
|
||||||
<LENGTH>27</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TEXTPOOL>
|
|
||||||
</item>
|
|
||||||
</I18N_TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,106 +0,0 @@
|
||||||
REPORT zdemo_excel38.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column,
|
|
||||||
lo_drawing TYPE REF TO zcl_excel_drawing.
|
|
||||||
|
|
||||||
TYPES: BEGIN OF gty_icon,
|
|
||||||
* name TYPE icon_name, "Fix #228
|
|
||||||
name TYPE iconname, "Fix #228
|
|
||||||
objid TYPE w3objid,
|
|
||||||
END OF gty_icon,
|
|
||||||
gtyt_icon TYPE STANDARD TABLE OF gty_icon WITH NON-UNIQUE DEFAULT KEY.
|
|
||||||
|
|
||||||
DATA: lt_icon TYPE gtyt_icon,
|
|
||||||
lv_row TYPE i,
|
|
||||||
ls_wwwdatatab TYPE wwwdatatab,
|
|
||||||
lt_mimedata TYPE STANDARD TABLE OF w3mime WITH NON-UNIQUE DEFAULT KEY,
|
|
||||||
lv_xstring TYPE xstring.
|
|
||||||
|
|
||||||
FIELD-SYMBOLS: <icon> LIKE LINE OF lt_icon,
|
|
||||||
<mimedata> LIKE LINE OF lt_mimedata.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '38_SAP-Icons.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
TABLES: icon.
|
|
||||||
SELECT-OPTIONS: s_icon FOR icon-name DEFAULT 'ICON_LED_*' OPTION CP.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Demo Icons' ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'A' ).
|
|
||||||
lo_column->set_auto_size( 'X' ).
|
|
||||||
lo_column = lo_worksheet->get_column( ip_column = 'B' ).
|
|
||||||
lo_column->set_auto_size( 'X' ).
|
|
||||||
|
|
||||||
* Get all icons
|
|
||||||
SELECT name
|
|
||||||
INTO TABLE lt_icon
|
|
||||||
FROM icon
|
|
||||||
WHERE name IN s_icon
|
|
||||||
ORDER BY name.
|
|
||||||
LOOP AT lt_icon ASSIGNING <icon>.
|
|
||||||
|
|
||||||
lv_row = sy-tabix.
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Set name of icon
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
lo_worksheet->set_cell( ip_row = lv_row
|
|
||||||
ip_column = 'A'
|
|
||||||
ip_value = <icon>-name ).
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Check whether the mime-repository holds some icondata for us
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
|
|
||||||
* Get key
|
|
||||||
SELECT SINGLE objid
|
|
||||||
INTO <icon>-objid
|
|
||||||
FROM wwwdata
|
|
||||||
WHERE text = <icon>-name.
|
|
||||||
CHECK sy-subrc = 0. " :o(
|
|
||||||
lo_worksheet->set_cell( ip_row = lv_row
|
|
||||||
ip_column = 'B'
|
|
||||||
ip_value = <icon>-objid ).
|
|
||||||
|
|
||||||
* Load mimedata
|
|
||||||
CLEAR lt_mimedata.
|
|
||||||
CLEAR ls_wwwdatatab.
|
|
||||||
ls_wwwdatatab-relid = 'MI' .
|
|
||||||
ls_wwwdatatab-objid = <icon>-objid.
|
|
||||||
CALL FUNCTION 'WWWDATA_IMPORT'
|
|
||||||
EXPORTING
|
|
||||||
key = ls_wwwdatatab
|
|
||||||
TABLES
|
|
||||||
mime = lt_mimedata
|
|
||||||
EXCEPTIONS
|
|
||||||
wrong_object_type = 1
|
|
||||||
import_error = 2
|
|
||||||
OTHERS = 3.
|
|
||||||
CHECK sy-subrc = 0. " :o(
|
|
||||||
|
|
||||||
lo_drawing = lo_excel->add_new_drawing( ).
|
|
||||||
lo_drawing->set_position( ip_from_row = lv_row
|
|
||||||
ip_from_col = 'C' ).
|
|
||||||
CLEAR lv_xstring.
|
|
||||||
LOOP AT lt_mimedata ASSIGNING <mimedata>.
|
|
||||||
CONCATENATE lv_xstring <mimedata>-line INTO lv_xstring IN BYTE MODE.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
lo_drawing->set_media( ip_media = lv_xstring
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_jpg
|
|
||||||
ip_width = 16
|
|
||||||
ip_height = 14 ).
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL38</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Read file and output</ENTRY>
|
|
||||||
<LENGTH>36</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>S_ICON</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,468 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL16
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel39.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_drawing TYPE REF TO zcl_excel_drawing.
|
|
||||||
|
|
||||||
DATA lv_value TYPE i.
|
|
||||||
|
|
||||||
DATA: ls_io TYPE skwf_io.
|
|
||||||
|
|
||||||
DATA: ls_upper TYPE zexcel_drawing_location,
|
|
||||||
ls_lower TYPE zexcel_drawing_location.
|
|
||||||
|
|
||||||
DATA: lo_bar1 TYPE REF TO zcl_excel_graph_bars,
|
|
||||||
lo_bar1_stacked TYPE REF TO zcl_excel_graph_bars,
|
|
||||||
lo_bar2 TYPE REF TO zcl_excel_graph_bars,
|
|
||||||
lo_pie TYPE REF TO zcl_excel_graph_pie,
|
|
||||||
lo_line TYPE REF TO zcl_excel_graph_line.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '39_Charts.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Create a pie chart and series
|
|
||||||
CREATE OBJECT lo_pie.
|
|
||||||
|
|
||||||
CALL METHOD lo_pie->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 0
|
|
||||||
ip_sheet = 'Values'
|
|
||||||
ip_lbl_from_col = 'B'
|
|
||||||
ip_lbl_from_row = '1'
|
|
||||||
ip_lbl_to_col = 'B'
|
|
||||||
ip_lbl_to_row = '3'
|
|
||||||
ip_ref_from_col = 'A'
|
|
||||||
ip_ref_from_row = '1'
|
|
||||||
ip_ref_to_col = 'A'
|
|
||||||
ip_ref_to_row = '3'
|
|
||||||
ip_sername = 'My serie 1'.
|
|
||||||
|
|
||||||
" Set style
|
|
||||||
lo_pie->set_style( zcl_excel_graph=>c_style_15 ).
|
|
||||||
|
|
||||||
" Create a bar chart, series and axes
|
|
||||||
CREATE OBJECT lo_bar1.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 0
|
|
||||||
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
|
||||||
ip_lbl = 'Values!$D$1:$D$3'
|
|
||||||
ip_ref = 'Values!$C$1:$C$3'
|
|
||||||
ip_sername = 'My serie 1'.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 1
|
|
||||||
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
|
||||||
ip_lbl = 'Values!$B$1:$B$3'
|
|
||||||
ip_ref = 'Values!$A$1:$A$3'
|
|
||||||
ip_sername = 'My serie 2'.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1->create_ax
|
|
||||||
EXPORTING
|
|
||||||
* ip_axid =
|
|
||||||
ip_type = zcl_excel_graph_bars=>c_catax
|
|
||||||
* ip_orientation =
|
|
||||||
* ip_delete =
|
|
||||||
* ip_axpos =
|
|
||||||
* ip_formatcode =
|
|
||||||
* ip_sourcelinked =
|
|
||||||
* ip_majortickmark =
|
|
||||||
* ip_minortickmark =
|
|
||||||
* ip_ticklblpos =
|
|
||||||
* ip_crossax =
|
|
||||||
* ip_crosses =
|
|
||||||
* ip_auto =
|
|
||||||
* ip_lblalgn =
|
|
||||||
* ip_lbloffset =
|
|
||||||
* ip_nomultilvllbl =
|
|
||||||
* ip_crossbetween =
|
|
||||||
.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1->create_ax
|
|
||||||
EXPORTING
|
|
||||||
* ip_axid =
|
|
||||||
ip_type = zcl_excel_graph_bars=>c_valax
|
|
||||||
* ip_orientation =
|
|
||||||
* ip_delete =
|
|
||||||
* ip_axpos =
|
|
||||||
* ip_formatcode =
|
|
||||||
* ip_sourcelinked =
|
|
||||||
* ip_majortickmark =
|
|
||||||
* ip_minortickmark =
|
|
||||||
* ip_ticklblpos =
|
|
||||||
* ip_crossax =
|
|
||||||
* ip_crosses =
|
|
||||||
* ip_auto =
|
|
||||||
* ip_lblalgn =
|
|
||||||
* ip_lbloffset =
|
|
||||||
* ip_nomultilvllbl =
|
|
||||||
* ip_crossbetween =
|
|
||||||
.
|
|
||||||
|
|
||||||
" Set style
|
|
||||||
lo_bar1->set_style( zcl_excel_graph=>c_style_default ).
|
|
||||||
lo_bar1->set_title( ip_value = 'TITLE!' ).
|
|
||||||
|
|
||||||
" Set label to none
|
|
||||||
lo_bar1->set_print_lbl( zcl_excel_graph_bars=>c_show_false ).
|
|
||||||
|
|
||||||
* Same barchart - but this time stacked
|
|
||||||
CREATE OBJECT lo_bar1_stacked.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1_stacked->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 0
|
|
||||||
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
|
||||||
ip_lbl = 'Values!$D$1:$D$3'
|
|
||||||
ip_ref = 'Values!$C$1:$C$3'
|
|
||||||
ip_sername = 'My serie 1'.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1_stacked->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 1
|
|
||||||
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_no
|
|
||||||
ip_lbl = 'Values!$B$1:$B$3'
|
|
||||||
ip_ref = 'Values!$A$1:$A$3'
|
|
||||||
ip_sername = 'My serie 2'.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1_stacked->create_ax
|
|
||||||
EXPORTING
|
|
||||||
ip_type = zcl_excel_graph_bars=>c_catax.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar1_stacked->create_ax
|
|
||||||
EXPORTING
|
|
||||||
ip_type = zcl_excel_graph_bars=>c_valax.
|
|
||||||
|
|
||||||
" Set style
|
|
||||||
lo_bar1_stacked->set_style( zcl_excel_graph=>c_style_default ).
|
|
||||||
|
|
||||||
" Set label to none
|
|
||||||
lo_bar1_stacked->set_print_lbl( zcl_excel_graph_bars=>c_show_false ).
|
|
||||||
|
|
||||||
" Make it stacked
|
|
||||||
lo_bar1_stacked->ns_groupingval = zcl_excel_graph_bars=>c_groupingval_stacked.
|
|
||||||
|
|
||||||
|
|
||||||
" Create a bar chart, series and axes
|
|
||||||
CREATE OBJECT lo_bar2.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar2->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 0
|
|
||||||
ip_invertifnegative = zcl_excel_graph_bars=>c_invertifnegative_yes
|
|
||||||
ip_lbl = 'Values!$D$1:$D$3'
|
|
||||||
ip_ref = 'Values!$C$1:$C$3'
|
|
||||||
ip_sername = 'My serie 1'.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar2->create_ax
|
|
||||||
EXPORTING
|
|
||||||
* ip_axid =
|
|
||||||
ip_type = zcl_excel_graph_bars=>c_catax
|
|
||||||
* ip_orientation =
|
|
||||||
* ip_delete =
|
|
||||||
* ip_axpos =
|
|
||||||
* ip_formatcode =
|
|
||||||
* ip_sourcelinked =
|
|
||||||
* ip_majortickmark =
|
|
||||||
* ip_minortickmark =
|
|
||||||
* ip_ticklblpos =
|
|
||||||
* ip_crossax =
|
|
||||||
* ip_crosses =
|
|
||||||
* ip_auto =
|
|
||||||
* ip_lblalgn =
|
|
||||||
* ip_lbloffset =
|
|
||||||
* ip_nomultilvllbl =
|
|
||||||
* ip_crossbetween =
|
|
||||||
.
|
|
||||||
|
|
||||||
CALL METHOD lo_bar2->create_ax
|
|
||||||
EXPORTING
|
|
||||||
* ip_axid =
|
|
||||||
ip_type = zcl_excel_graph_bars=>c_valax
|
|
||||||
* ip_orientation =
|
|
||||||
* ip_delete =
|
|
||||||
* ip_axpos =
|
|
||||||
* ip_formatcode =
|
|
||||||
* ip_sourcelinked =
|
|
||||||
* ip_majortickmark =
|
|
||||||
* ip_minortickmark =
|
|
||||||
* ip_ticklblpos =
|
|
||||||
* ip_crossax =
|
|
||||||
* ip_crosses =
|
|
||||||
* ip_auto =
|
|
||||||
* ip_lblalgn =
|
|
||||||
* ip_lbloffset =
|
|
||||||
* ip_nomultilvllbl =
|
|
||||||
* ip_crossbetween =
|
|
||||||
.
|
|
||||||
|
|
||||||
" Set layout
|
|
||||||
lo_bar2->set_show_legend_key( zcl_excel_graph_bars=>c_show_true ).
|
|
||||||
lo_bar2->set_show_values( zcl_excel_graph_bars=>c_show_true ).
|
|
||||||
lo_bar2->set_show_cat_name( zcl_excel_graph_bars=>c_show_true ).
|
|
||||||
lo_bar2->set_show_ser_name( zcl_excel_graph_bars=>c_show_true ).
|
|
||||||
lo_bar2->set_show_percent( zcl_excel_graph_bars=>c_show_true ).
|
|
||||||
lo_bar2->set_varycolor( zcl_excel_graph_bars=>c_show_true ).
|
|
||||||
|
|
||||||
" Create a line chart, series and axes
|
|
||||||
CREATE OBJECT lo_line.
|
|
||||||
|
|
||||||
CALL METHOD lo_line->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 0
|
|
||||||
ip_symbol = zcl_excel_graph_line=>c_symbol_auto
|
|
||||||
ip_smooth = zcl_excel_graph_line=>c_show_false
|
|
||||||
ip_lbl = 'Values!$D$1:$D$3'
|
|
||||||
ip_ref = 'Values!$C$1:$C$3'
|
|
||||||
ip_sername = 'My serie 1'.
|
|
||||||
|
|
||||||
CALL METHOD lo_line->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 1
|
|
||||||
ip_symbol = zcl_excel_graph_line=>c_symbol_none
|
|
||||||
ip_smooth = zcl_excel_graph_line=>c_show_false
|
|
||||||
ip_lbl = 'Values!$B$1:$B$3'
|
|
||||||
ip_ref = 'Values!$A$1:$A$3'
|
|
||||||
ip_sername = 'My serie 2'.
|
|
||||||
|
|
||||||
CALL METHOD lo_line->create_serie
|
|
||||||
EXPORTING
|
|
||||||
ip_order = 2
|
|
||||||
ip_symbol = zcl_excel_graph_line=>c_symbol_auto
|
|
||||||
ip_smooth = zcl_excel_graph_line=>c_show_false
|
|
||||||
ip_lbl = 'Values!$F$1:$F$3'
|
|
||||||
ip_ref = 'Values!$E$1:$E$3'
|
|
||||||
ip_sername = 'My serie 3'.
|
|
||||||
|
|
||||||
CALL METHOD lo_line->create_ax
|
|
||||||
EXPORTING
|
|
||||||
* ip_axid =
|
|
||||||
ip_type = zcl_excel_graph_line=>c_catax
|
|
||||||
* ip_orientation =
|
|
||||||
* ip_delete =
|
|
||||||
* ip_axpos =
|
|
||||||
* ip_majortickmark =
|
|
||||||
* ip_minortickmark =
|
|
||||||
* ip_ticklblpos =
|
|
||||||
* ip_crossax =
|
|
||||||
* ip_crosses =
|
|
||||||
* ip_auto =
|
|
||||||
* ip_lblalgn =
|
|
||||||
* ip_lbloffset =
|
|
||||||
* ip_nomultilvllbl =
|
|
||||||
* ip_crossbetween =
|
|
||||||
.
|
|
||||||
|
|
||||||
CALL METHOD lo_line->create_ax
|
|
||||||
EXPORTING
|
|
||||||
* ip_axid =
|
|
||||||
ip_type = zcl_excel_graph_line=>c_valax
|
|
||||||
* ip_orientation =
|
|
||||||
* ip_delete =
|
|
||||||
* ip_axpos =
|
|
||||||
* ip_formatcode =
|
|
||||||
* ip_sourcelinked =
|
|
||||||
* ip_majortickmark =
|
|
||||||
* ip_minortickmark =
|
|
||||||
* ip_ticklblpos =
|
|
||||||
* ip_crossax =
|
|
||||||
* ip_crosses =
|
|
||||||
* ip_auto =
|
|
||||||
* ip_lblalgn =
|
|
||||||
* ip_lbloffset =
|
|
||||||
* ip_nomultilvllbl =
|
|
||||||
* ip_crossbetween =
|
|
||||||
.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet (Pie sheet)
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( 'PieChart' ).
|
|
||||||
|
|
||||||
" Create global drawing, set type as pie chart, assign chart, set position and media type
|
|
||||||
lo_drawing = lo_worksheet->excel->add_new_drawing(
|
|
||||||
ip_type = zcl_excel_drawing=>type_chart
|
|
||||||
ip_title = 'CHART PIE' ).
|
|
||||||
lo_drawing->graph = lo_pie.
|
|
||||||
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_pie.
|
|
||||||
|
|
||||||
"Set chart position (anchor 2 cells)
|
|
||||||
ls_lower-row = 30.
|
|
||||||
ls_lower-col = 20.
|
|
||||||
lo_drawing->set_position2(
|
|
||||||
EXPORTING
|
|
||||||
ip_from = ls_upper
|
|
||||||
ip_to = ls_lower ).
|
|
||||||
|
|
||||||
lo_drawing->set_media(
|
|
||||||
EXPORTING
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
" BarChart1 sheet
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'BarChart1' ).
|
|
||||||
|
|
||||||
" Create global drawing, set type as bar chart, assign chart, set position and media type
|
|
||||||
lo_drawing = lo_worksheet->excel->add_new_drawing(
|
|
||||||
ip_type = zcl_excel_drawing=>type_chart
|
|
||||||
ip_title = 'CHART BARS WITH 2 SERIES' ).
|
|
||||||
lo_drawing->graph = lo_bar1.
|
|
||||||
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_bars.
|
|
||||||
|
|
||||||
"Set chart position (anchor 2 cells)
|
|
||||||
ls_upper-row = 0.
|
|
||||||
ls_upper-col = 11.
|
|
||||||
ls_lower-row = 22.
|
|
||||||
ls_lower-col = 21.
|
|
||||||
lo_drawing->set_position2(
|
|
||||||
EXPORTING
|
|
||||||
ip_from = ls_upper
|
|
||||||
ip_to = ls_lower ).
|
|
||||||
|
|
||||||
lo_drawing->set_media(
|
|
||||||
EXPORTING
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
lo_drawing = lo_worksheet->excel->add_new_drawing(
|
|
||||||
ip_type = zcl_excel_drawing=>type_chart
|
|
||||||
ip_title = 'Stacked CHART BARS WITH 2 SER.' ).
|
|
||||||
lo_drawing->graph = lo_bar1_stacked.
|
|
||||||
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_bars.
|
|
||||||
|
|
||||||
"Set chart position (anchor 2 cells)
|
|
||||||
ls_upper-row = 0.
|
|
||||||
ls_upper-col = 1.
|
|
||||||
ls_lower-row = 22.
|
|
||||||
ls_lower-col = 10.
|
|
||||||
lo_drawing->set_position2(
|
|
||||||
EXPORTING
|
|
||||||
ip_from = ls_upper
|
|
||||||
ip_to = ls_lower ).
|
|
||||||
|
|
||||||
lo_drawing->set_media(
|
|
||||||
EXPORTING
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
" BarChart2 sheet
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'BarChart2' ).
|
|
||||||
|
|
||||||
" Create global drawing, set type as bar chart, assign chart, set position and media type
|
|
||||||
lo_drawing = lo_worksheet->excel->add_new_drawing(
|
|
||||||
ip_type = zcl_excel_drawing=>type_chart
|
|
||||||
ip_title = 'CHART BARS WITH 1 SERIE' ).
|
|
||||||
lo_drawing->graph = lo_bar2.
|
|
||||||
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_bars.
|
|
||||||
|
|
||||||
"Set chart position (anchor 2 cells)
|
|
||||||
ls_upper-row = 0.
|
|
||||||
ls_upper-col = 0.
|
|
||||||
ls_lower-row = 30.
|
|
||||||
ls_lower-col = 20.
|
|
||||||
lo_drawing->set_position2(
|
|
||||||
EXPORTING
|
|
||||||
ip_from = ls_upper
|
|
||||||
ip_to = ls_lower ).
|
|
||||||
|
|
||||||
lo_drawing->set_media(
|
|
||||||
EXPORTING
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
" LineChart sheet
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'LineChart' ).
|
|
||||||
|
|
||||||
" Create global drawing, set type as line chart, assign chart, set position and media type
|
|
||||||
lo_drawing = lo_worksheet->excel->add_new_drawing(
|
|
||||||
ip_type = zcl_excel_drawing=>type_chart
|
|
||||||
ip_title = 'CHART LINES' ).
|
|
||||||
lo_drawing->graph = lo_line.
|
|
||||||
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_line.
|
|
||||||
|
|
||||||
"Set chart position (anchor 2 cells)
|
|
||||||
ls_upper-row = 0.
|
|
||||||
ls_upper-col = 0.
|
|
||||||
ls_lower-row = 30.
|
|
||||||
ls_lower-col = 20.
|
|
||||||
lo_drawing->set_position2(
|
|
||||||
EXPORTING
|
|
||||||
ip_from = ls_upper
|
|
||||||
ip_to = ls_lower ).
|
|
||||||
|
|
||||||
lo_drawing->set_media(
|
|
||||||
EXPORTING
|
|
||||||
ip_media_type = zcl_excel_drawing=>c_media_type_xml ).
|
|
||||||
|
|
||||||
lo_worksheet->add_drawing( lo_drawing ).
|
|
||||||
|
|
||||||
" Values sheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Values' ).
|
|
||||||
|
|
||||||
" Set values for chart
|
|
||||||
lv_value = 1.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 1 ip_value = lv_value ).
|
|
||||||
lv_value = 2.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 2 ip_value = lv_value ).
|
|
||||||
lv_value = 3.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'A' ip_row = 3 ip_value = lv_value ).
|
|
||||||
|
|
||||||
" Set labels for chart
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 1 ip_value = 'One' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Two' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'Three' ).
|
|
||||||
|
|
||||||
" Set values for chart
|
|
||||||
lv_value = 3.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 1 ip_value = lv_value ).
|
|
||||||
lv_value = 2.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 2 ip_value = lv_value ).
|
|
||||||
lv_value = -1.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = lv_value ).
|
|
||||||
|
|
||||||
" Set labels for chart
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 3 ip_value = 'One (Minus)' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 2 ip_value = 'Two' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'D' ip_row = 1 ip_value = 'Three' ).
|
|
||||||
|
|
||||||
" Set values for chart
|
|
||||||
lv_value = 3.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = 1 ip_value = lv_value ).
|
|
||||||
lv_value = 1.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = 2 ip_value = lv_value ).
|
|
||||||
lv_value = 2.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'E' ip_row = 3 ip_value = lv_value ).
|
|
||||||
|
|
||||||
" Set labels for chart
|
|
||||||
lo_worksheet->set_cell( ip_column = 'F' ip_row = 3 ip_value = 'Two' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'F' ip_row = 2 ip_value = 'One' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'F' ip_row = 1 ip_value = 'Three' ).
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL39</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Drawings</ENTRY>
|
|
||||||
<LENGTH>24</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>POBJTYPE</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_CLASS</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_OBJID</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,115 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL4
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel4.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
|
||||||
|
|
||||||
lv_tabcolor TYPE zexcel_s_tabcolor,
|
|
||||||
|
|
||||||
ls_header TYPE zexcel_s_worksheet_head_foot,
|
|
||||||
ls_footer TYPE zexcel_s_worksheet_head_foot.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '04_Sheets.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet1' ).
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the first sheet' ).
|
|
||||||
* Set color to tab with sheetname - Red
|
|
||||||
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = 'FF'
|
|
||||||
ip_green = '00'
|
|
||||||
ip_blu = '00' ).
|
|
||||||
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
|
||||||
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet2!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to second sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
|
|
||||||
" Page printing settings
|
|
||||||
lo_worksheet->sheet_setup->set_page_margins( ip_header = '1' ip_footer = '1' ip_unit = 'cm' ).
|
|
||||||
lo_worksheet->sheet_setup->black_and_white = 'X'.
|
|
||||||
lo_worksheet->sheet_setup->fit_to_page = 'X'. " you should turn this on to activate fit_to_height and fit_to_width
|
|
||||||
lo_worksheet->sheet_setup->fit_to_height = 0. " used only if ip_fit_to_page = 'X'
|
|
||||||
lo_worksheet->sheet_setup->fit_to_width = 2. " used only if ip_fit_to_page = 'X'
|
|
||||||
lo_worksheet->sheet_setup->orientation = zcl_excel_sheet_setup=>c_orientation_landscape.
|
|
||||||
lo_worksheet->sheet_setup->page_order = zcl_excel_sheet_setup=>c_ord_downthenover.
|
|
||||||
lo_worksheet->sheet_setup->paper_size = zcl_excel_sheet_setup=>c_papersize_a4.
|
|
||||||
lo_worksheet->sheet_setup->scale = 80. " used only if ip_fit_to_page = SPACE
|
|
||||||
|
|
||||||
" Header and Footer
|
|
||||||
ls_header-right_value = 'print date &D'.
|
|
||||||
ls_header-right_font-size = 8.
|
|
||||||
ls_header-right_font-name = zcl_excel_style_font=>c_name_arial.
|
|
||||||
|
|
||||||
ls_footer-left_value = '&Z&F'. "Path / Filename
|
|
||||||
ls_footer-left_font = ls_header-right_font.
|
|
||||||
ls_footer-right_value = 'page &P of &N'. "page x of y
|
|
||||||
ls_footer-right_font = ls_header-right_font.
|
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header
|
|
||||||
ip_odd_footer = ls_footer ).
|
|
||||||
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet2' ).
|
|
||||||
* Set color to tab with sheetname - Green
|
|
||||||
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = '00'
|
|
||||||
ip_green = 'FF'
|
|
||||||
ip_blu = '00' ).
|
|
||||||
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~selected = zif_excel_sheet_properties=>c_selected.
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'This is the second sheet' ).
|
|
||||||
lo_hyperlink = zcl_excel_hyperlink=>create_internal_link( iv_location = 'Sheet1!B2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'This is link to first sheet' ip_hyperlink = lo_hyperlink ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 4 ip_value = 'Sheet3 is hidden' ).
|
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header
|
|
||||||
ip_odd_footer = ls_footer ).
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet3' ).
|
|
||||||
* Set color to tab with sheetname - Blue
|
|
||||||
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = '00'
|
|
||||||
ip_green = '00'
|
|
||||||
ip_blu = 'FF' ).
|
|
||||||
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_hidden.
|
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header
|
|
||||||
ip_odd_footer = ls_footer ).
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Sheet4' ).
|
|
||||||
* Set color to tab with sheetname - other color
|
|
||||||
lv_tabcolor-rgb = zcl_excel_style_color=>create_new_argb( ip_red = '00'
|
|
||||||
ip_green = 'FF'
|
|
||||||
ip_blu = 'FF' ).
|
|
||||||
lo_worksheet->set_tabcolor( lv_tabcolor ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Cell B3 has value 0' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 0 ).
|
|
||||||
lo_worksheet->zif_excel_sheet_properties~show_zeros = zif_excel_sheet_properties=>c_hidezero.
|
|
||||||
|
|
||||||
lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header
|
|
||||||
ip_odd_footer = ls_footer ).
|
|
||||||
|
|
||||||
lo_excel->set_active_sheet_index_by_name( 'Sheet1' ).
|
|
||||||
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL4</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Create XLXS with multiple sheets</ENTRY>
|
|
||||||
<LENGTH>49</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_PATH</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,63 +0,0 @@
|
||||||
REPORT zdemo_excel40.
|
|
||||||
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_changer TYPE REF TO zif_excel_style_changer.
|
|
||||||
|
|
||||||
DATA: lv_row TYPE zexcel_cell_row,
|
|
||||||
lv_col TYPE i,
|
|
||||||
lv_row_char TYPE char10,
|
|
||||||
lv_value TYPE string,
|
|
||||||
ls_fontcolor TYPE zexcel_style_color_argb.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '40_Printsettings.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Demo Printsettings' ).
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Prepare sheet with trivial data
|
|
||||||
* - first 4 columns will have fontocolor set
|
|
||||||
* - first 3 rows will have fontcolor set
|
|
||||||
* These marked cells will be used for repeatable rows/columns on printpages
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
lo_worksheet->set_area(
|
|
||||||
ip_range = 'A1:T100'
|
|
||||||
ip_formula = 'CHAR(64+COLUMN())&TEXT(ROW(),"????????0")'
|
|
||||||
ip_area = lo_worksheet->c_area-whole ).
|
|
||||||
|
|
||||||
lo_style_changer = zcl_excel_style_changer=>create( lo_excel ).
|
|
||||||
lo_style_changer->set_fill_filltype( zcl_excel_style_fill=>c_fill_solid ).
|
|
||||||
lo_style_changer->set_fill_fgcolor_rgb( zcl_excel_style_color=>c_yellow ).
|
|
||||||
lo_worksheet->change_area_style(
|
|
||||||
ip_range = 'A1:T3'
|
|
||||||
ip_style_changer = lo_style_changer ).
|
|
||||||
|
|
||||||
lo_style_changer = zcl_excel_style_changer=>create( lo_excel ).
|
|
||||||
lo_style_changer->set_font_color_rgb( zcl_excel_style_color=>c_red ).
|
|
||||||
lo_worksheet->change_area_style(
|
|
||||||
ip_range = 'A1:D100'
|
|
||||||
ip_style_changer = lo_style_changer ).
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Printsettings
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
TRY.
|
|
||||||
lo_worksheet->zif_excel_sheet_printsettings~set_print_repeat_columns( iv_columns_from = 'A'
|
|
||||||
iv_columns_to = 'D' ).
|
|
||||||
lo_worksheet->zif_excel_sheet_printsettings~set_print_repeat_rows( iv_rows_from = 1
|
|
||||||
iv_rows_to = 3 ).
|
|
||||||
CATCH zcx_excel .
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL40</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Area and Print settings</ENTRY>
|
|
||||||
<LENGTH>39</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>S_ICON</KEY>
|
|
||||||
<ENTRY>.</ENTRY>
|
|
||||||
<LENGTH>9</LENGTH>
|
|
||||||
<SPLIT>D</SPLIT>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,102 +0,0 @@
|
||||||
REPORT zdemo_excel41.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE 'ABAP2XLSX Inheritance.xlsx'.
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Demo inheritance ZCL_EXCEL1
|
|
||||||
* Variation of ZCL_EXCEL that creates numerous sheets
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
CLASS lcl_my_zcl_excel1 DEFINITION INHERITING FROM zcl_excel.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS: constructor IMPORTING iv_sheetcount TYPE i DEFAULT 5
|
|
||||||
RAISING zcx_excel.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
CLASS lcl_my_zcl_excel1 IMPLEMENTATION.
|
|
||||||
METHOD constructor.
|
|
||||||
DATA: lv_sheets_to_create TYPE i.
|
|
||||||
super->constructor( ).
|
|
||||||
lv_sheets_to_create = iv_sheetcount - 1. " one gets created by standard class
|
|
||||||
DO lv_sheets_to_create TIMES.
|
|
||||||
TRY.
|
|
||||||
me->add_new_worksheet( ).
|
|
||||||
CATCH zcx_excel.
|
|
||||||
ENDTRY.
|
|
||||||
ENDDO.
|
|
||||||
me->set_active_sheet_index( 1 ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
* Demo inheritance ZCL_EXCEL_WORKSHEET
|
|
||||||
* Variation of ZCL_EXCEL_WORKSHEET ( and ZCL_EXCEL that calls the new type of worksheet )
|
|
||||||
* that sets a fixed title
|
|
||||||
*--------------------------------------------------------------------*
|
|
||||||
CLASS lcl_my_zcl_excel2 DEFINITION INHERITING FROM zcl_excel.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS: constructor RAISING zcx_excel.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
CLASS lcl_my_zcl_excel_worksheet DEFINITION INHERITING FROM zcl_excel_worksheet.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
METHODS: constructor IMPORTING ip_excel TYPE REF TO zcl_excel
|
|
||||||
ip_title TYPE zexcel_sheet_title OPTIONAL " Will be ignored - keep parameter for demonstration purpose
|
|
||||||
RAISING zcx_excel.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
CLASS lcl_my_zcl_excel2 IMPLEMENTATION.
|
|
||||||
METHOD constructor.
|
|
||||||
|
|
||||||
DATA: lo_worksheet TYPE REF TO zcl_excel_worksheet.
|
|
||||||
|
|
||||||
super->constructor( ).
|
|
||||||
|
|
||||||
* To use own worksheet we have to remove the standard worksheet
|
|
||||||
lo_worksheet = get_active_worksheet( ).
|
|
||||||
me->worksheets->remove( lo_worksheet ).
|
|
||||||
* and replace it with own version
|
|
||||||
CREATE OBJECT lo_worksheet TYPE lcl_my_zcl_excel_worksheet
|
|
||||||
EXPORTING
|
|
||||||
ip_excel = me
|
|
||||||
ip_title = 'This title will be ignored'.
|
|
||||||
me->worksheets->add( lo_worksheet ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
CLASS lcl_my_zcl_excel_worksheet IMPLEMENTATION.
|
|
||||||
METHOD constructor.
|
|
||||||
super->constructor( ip_excel = ip_excel
|
|
||||||
ip_title = 'Inherited Worksheet' ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
DATA: go_excel1 TYPE REF TO lcl_my_zcl_excel1.
|
|
||||||
DATA: go_excel2 TYPE REF TO lcl_my_zcl_excel2.
|
|
||||||
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK bli WITH FRAME TITLE TEXT-bli.
|
|
||||||
PARAMETERS: rbi_1 RADIOBUTTON GROUP rbi DEFAULT 'X' , " Simple inheritance
|
|
||||||
rbi_2 RADIOBUTTON GROUP rbi.
|
|
||||||
SELECTION-SCREEN END OF BLOCK bli.
|
|
||||||
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
END-OF-SELECTION.
|
|
||||||
|
|
||||||
CASE 'X'.
|
|
||||||
|
|
||||||
WHEN rbi_1. " Simple inheritance of zcl_excel, object created directly
|
|
||||||
CREATE OBJECT go_excel1
|
|
||||||
EXPORTING
|
|
||||||
iv_sheetcount = 5.
|
|
||||||
lcl_output=>output( go_excel1 ).
|
|
||||||
|
|
||||||
WHEN rbi_2. " Inheritance of zcl_excel_worksheet, inheritance of zcl_excel needed to allow this
|
|
||||||
CREATE OBJECT go_excel2.
|
|
||||||
lcl_output=>output( go_excel2 ).
|
|
||||||
|
|
||||||
|
|
||||||
ENDCASE.
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,101 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL42
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel42.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_theme TYPE REF TO zcl_excel_theme,
|
|
||||||
lo_style TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_guid TYPE zexcel_cell_style.
|
|
||||||
DATA: gc_save_file_name TYPE string VALUE '42 Theme Manipulation demo.&'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Create a bold / italic style with usage of major font
|
|
||||||
lo_style = lo_excel->add_new_style( ).
|
|
||||||
lo_style->font->bold = abap_true.
|
|
||||||
lo_style->font->italic = abap_true.
|
|
||||||
lo_style->font->scheme = zcl_excel_style_font=>c_scheme_major.
|
|
||||||
lo_style->font->color-rgb = zcl_excel_style_color=>c_red.
|
|
||||||
lv_style_guid = lo_style->get_guid( ).
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet->set_title( ip_title = 'Styles' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Bold text' ip_style = lv_style_guid ).
|
|
||||||
|
|
||||||
"create theme
|
|
||||||
CREATE OBJECT lo_theme.
|
|
||||||
lo_theme->set_theme_name( iv_name = 'Theme Demo 42 A2X' ).
|
|
||||||
lo_theme->set_color_scheme_name( iv_name = 'Demo 42 A2X' ).
|
|
||||||
|
|
||||||
"set theme colors
|
|
||||||
lo_theme->set_color(
|
|
||||||
EXPORTING
|
|
||||||
iv_type = zcl_excel_theme_color_scheme=>c_dark1
|
|
||||||
iv_srgb = '5F9EA0'
|
|
||||||
* iv_syscolorname =
|
|
||||||
* iv_syscolorlast =
|
|
||||||
).
|
|
||||||
lo_theme->set_color(
|
|
||||||
EXPORTING
|
|
||||||
iv_type = zcl_excel_theme_color_scheme=>c_dark2
|
|
||||||
iv_srgb = 'FFA500'
|
|
||||||
* iv_syscolorname =
|
|
||||||
* iv_syscolorlast =
|
|
||||||
).
|
|
||||||
lo_theme->set_color(
|
|
||||||
EXPORTING
|
|
||||||
iv_type = zcl_excel_theme_color_scheme=>c_light1
|
|
||||||
iv_srgb = '778899'
|
|
||||||
* iv_syscolorname =
|
|
||||||
* iv_syscolorlast =
|
|
||||||
).
|
|
||||||
|
|
||||||
lo_theme->set_color(
|
|
||||||
EXPORTING
|
|
||||||
iv_type = zcl_excel_theme_color_scheme=>c_light1
|
|
||||||
iv_srgb = '9932CC'
|
|
||||||
* iv_syscolorname =
|
|
||||||
* iv_syscolorlast =
|
|
||||||
).
|
|
||||||
lo_theme->set_font_scheme_name( iv_name = 'Demo 42 A2X' ).
|
|
||||||
|
|
||||||
|
|
||||||
"set theme latin fonts - major and minor
|
|
||||||
lo_theme->set_latin_font(
|
|
||||||
EXPORTING
|
|
||||||
iv_type = zcl_excel_theme_font_scheme=>c_major
|
|
||||||
iv_typeface = 'Britannic Bold'
|
|
||||||
* iv_panose =
|
|
||||||
* iv_pitchfamily =
|
|
||||||
* iv_charset =
|
|
||||||
).
|
|
||||||
lo_theme->set_latin_font(
|
|
||||||
EXPORTING
|
|
||||||
iv_type = zcl_excel_theme_font_scheme=>c_minor
|
|
||||||
iv_typeface = 'Broadway'
|
|
||||||
* iv_panose =
|
|
||||||
* iv_pitchfamily =
|
|
||||||
* iv_charset =
|
|
||||||
).
|
|
||||||
"push theme to file
|
|
||||||
lo_excel->set_theme( io_theme = lo_theme ).
|
|
||||||
|
|
||||||
"output
|
|
||||||
lcl_output=>output( cl_excel = lo_excel ).
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL42</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<APPL>*</APPL>
|
|
||||||
<RSTAT>K</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Theme manipulation demo</ENTRY>
|
|
||||||
<LENGTH>39</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,78 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL43
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel43.
|
|
||||||
|
|
||||||
"
|
|
||||||
"Locally created Structure, which should be equal to the excels structure
|
|
||||||
"
|
|
||||||
TYPES: BEGIN OF lty_excel_s,
|
|
||||||
dummy TYPE dummy.
|
|
||||||
TYPES: END OF lty_excel_s.
|
|
||||||
|
|
||||||
DATA lt_tab TYPE TABLE OF lty_excel_s.
|
|
||||||
DATA: lt_filetable TYPE filetable,
|
|
||||||
ls_filetable TYPE file_table.
|
|
||||||
DATA lv_subrc TYPE i.
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_reader TYPE REF TO zif_excel_reader,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_salv TYPE REF TO cl_salv_table.
|
|
||||||
DATA: lo_error TYPE REF TO cx_root.
|
|
||||||
|
|
||||||
PARAMETERS p_file TYPE string LOWER CASE.
|
|
||||||
PARAMETERS p_skip_b AS CHECKBOX.
|
|
||||||
|
|
||||||
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
|
|
||||||
"
|
|
||||||
"Ask User to choose a path
|
|
||||||
"
|
|
||||||
cl_gui_frontend_services=>file_open_dialog( EXPORTING window_title = 'Excel selection'
|
|
||||||
file_filter = '*.xlsx'
|
|
||||||
multiselection = abap_false
|
|
||||||
CHANGING file_table = lt_filetable " Tabelle, die selektierte Dateien enthält
|
|
||||||
rc = lv_subrc
|
|
||||||
EXCEPTIONS file_open_dialog_failed = 1
|
|
||||||
cntl_error = 2
|
|
||||||
error_no_gui = 3
|
|
||||||
not_supported_by_gui = 4
|
|
||||||
OTHERS = 5 ).
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
|
|
||||||
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
|
|
||||||
ENDIF.
|
|
||||||
DELETE lt_filetable FROM 2.
|
|
||||||
READ TABLE lt_filetable INDEX 1 INTO ls_filetable.
|
|
||||||
IF sy-subrc = 0.
|
|
||||||
p_file = ls_filetable-filename.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_reader TYPE zcl_excel_reader_2007.
|
|
||||||
lo_excel = lo_reader->load_file( p_file ).
|
|
||||||
lo_worksheet = lo_excel->get_worksheet_by_index( iv_index = 1 ).
|
|
||||||
lo_worksheet->get_table(
|
|
||||||
EXPORTING
|
|
||||||
iv_skip_bottom_empty_rows = p_skip_b
|
|
||||||
IMPORTING
|
|
||||||
et_table = lt_tab ).
|
|
||||||
|
|
||||||
"
|
|
||||||
"Do the presentation stuff
|
|
||||||
"
|
|
||||||
|
|
||||||
cl_salv_table=>factory( IMPORTING r_salv_table = lo_salv
|
|
||||||
CHANGING t_table = lt_tab ).
|
|
||||||
lo_salv->display( ).
|
|
||||||
|
|
||||||
CATCH cx_root INTO lo_error.
|
|
||||||
MESSAGE lo_error TYPE 'I' DISPLAY LIKE 'E'.
|
|
||||||
ENDTRY.
|
|
|
@ -1,33 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL43</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Demo 43 GET_TABLE</ENTRY>
|
|
||||||
<LENGTH>33</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_FILE</KEY>
|
|
||||||
<ENTRY>Excel file</ENTRY>
|
|
||||||
<LENGTH>18</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_SKIP_B</KEY>
|
|
||||||
<ENTRY>Skip bottom empty rows</ENTRY>
|
|
||||||
<LENGTH>30</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,58 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL44
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
|
|
||||||
REPORT zdemo_excel44.
|
|
||||||
|
|
||||||
DATA: lo_excel_no_line_if_empty TYPE REF TO zcl_excel,
|
|
||||||
lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet_no_line_if_empty TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet.
|
|
||||||
|
|
||||||
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog.
|
|
||||||
|
|
||||||
DATA: gc_save_file_name TYPE string VALUE '44_iTabEmpty.csv'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
SELECTION-SCREEN BEGIN OF BLOCK b44 WITH FRAME TITLE txt_b44.
|
|
||||||
|
|
||||||
* No line if internal table is empty
|
|
||||||
DATA: p_mtyfil TYPE flag VALUE abap_true.
|
|
||||||
|
|
||||||
SELECTION-SCREEN END OF BLOCK b44.
|
|
||||||
|
|
||||||
INITIALIZATION.
|
|
||||||
txt_b44 = 'Testing empty file option'(b44).
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
" Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel_no_line_if_empty.
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Get active sheet
|
|
||||||
lo_worksheet_no_line_if_empty = lo_excel_no_line_if_empty->get_active_worksheet( ).
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
lo_worksheet_no_line_if_empty->set_title( 'Internal table' ).
|
|
||||||
lo_worksheet->set_title( 'Internal table' ).
|
|
||||||
|
|
||||||
DATA lt_test TYPE TABLE OF sflight.
|
|
||||||
|
|
||||||
lo_worksheet_no_line_if_empty->bind_table( ip_table = lt_test
|
|
||||||
iv_no_line_if_empty = p_mtyfil ).
|
|
||||||
|
|
||||||
p_mtyfil = abap_false.
|
|
||||||
lo_worksheet->bind_table( ip_table = lt_test
|
|
||||||
iv_no_line_if_empty = p_mtyfil ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( EXPORTING cl_excel = lo_excel_no_line_if_empty
|
|
||||||
iv_writerclass_name = 'ZCL_EXCEL_WRITER_CSV' ).
|
|
||||||
|
|
||||||
gc_save_file_name = '44_iTabNotEmpty.csv'.
|
|
||||||
lcl_output=>output( EXPORTING cl_excel = lo_excel
|
|
||||||
iv_writerclass_name = 'ZCL_EXCEL_WRITER_CSV' ).
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL44</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RSTAT>T</RSTAT>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>I</ID>
|
|
||||||
<KEY>B44</KEY>
|
|
||||||
<ENTRY>Testing empty file option</ENTRY>
|
|
||||||
<LENGTH>50</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Demo excel 44</ENTRY>
|
|
||||||
<LENGTH>29</LENGTH>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<ID>S</ID>
|
|
||||||
<KEY>P_MTYFIL</KEY>
|
|
||||||
<ENTRY>No data => No empty line</ENTRY>
|
|
||||||
<LENGTH>32</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,66 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL45
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel45.
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
gc_ws_title_validation TYPE zexcel_sheet_title VALUE 'Validation'.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_range TYPE REF TO zcl_excel_range,
|
|
||||||
lv_validation_string TYPE string,
|
|
||||||
lo_data_validation TYPE REF TO zcl_excel_data_validation,
|
|
||||||
lv_row TYPE zexcel_cell_row.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
gc_save_file_name TYPE string VALUE '45_ShowDropdown.xlsx'.
|
|
||||||
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
*** Sheet Admin
|
|
||||||
|
|
||||||
* Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
* Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
|
|
||||||
* Set sheet name "Validation"
|
|
||||||
lo_worksheet->set_title( gc_ws_title_validation ).
|
|
||||||
|
|
||||||
|
|
||||||
* short validations can be entered as string (<254Char)
|
|
||||||
lv_validation_string = '"New York, Rio, Tokyo"'.
|
|
||||||
|
|
||||||
* create validation object
|
|
||||||
lo_data_validation = lo_worksheet->add_new_data_validation( ).
|
|
||||||
|
|
||||||
* create new validation from validation string
|
|
||||||
lo_data_validation->type = zcl_excel_data_validation=>c_type_list.
|
|
||||||
lo_data_validation->formula1 = lv_validation_string.
|
|
||||||
lo_data_validation->cell_row = 2.
|
|
||||||
lo_data_validation->cell_row_to = 4.
|
|
||||||
lo_data_validation->cell_column = 'A'.
|
|
||||||
lo_data_validation->cell_column_to = 'A'.
|
|
||||||
lo_data_validation->allowblank = 'X'.
|
|
||||||
lo_data_validation->showdropdown = 'X'.
|
|
||||||
|
|
||||||
* add some fields with validation
|
|
||||||
lv_row = 2.
|
|
||||||
WHILE lv_row <= 4.
|
|
||||||
lo_worksheet->set_cell( ip_row = lv_row ip_column = 'A' ip_value = 'Select' ).
|
|
||||||
lv_row = lv_row + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL45</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Show Dropdown</ENTRY>
|
|
||||||
<LENGTH>29</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,71 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report ZDEMO_EXCEL46
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel46.
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
gc_ws_title_validation TYPE zexcel_sheet_title VALUE 'Validation'.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_range TYPE REF TO zcl_excel_range,
|
|
||||||
lv_validation_string TYPE string,
|
|
||||||
lo_data_validation TYPE REF TO zcl_excel_data_validation,
|
|
||||||
lv_row TYPE zexcel_cell_row.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
gc_save_file_name TYPE string VALUE '46_ValidationWarning.xlsx'.
|
|
||||||
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
*** Sheet Validation
|
|
||||||
|
|
||||||
* Creates active sheet
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
* Get active sheet
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
|
|
||||||
* Set sheet name "Validation"
|
|
||||||
lo_worksheet->set_title( gc_ws_title_validation ).
|
|
||||||
|
|
||||||
|
|
||||||
* short validations can be entered as string (<254Char)
|
|
||||||
lv_validation_string = '"New York, Rio, Tokyo"'.
|
|
||||||
|
|
||||||
* create validation object
|
|
||||||
lo_data_validation = lo_worksheet->add_new_data_validation( ).
|
|
||||||
|
|
||||||
* create new validation from validation string
|
|
||||||
lo_data_validation->type = zcl_excel_data_validation=>c_type_list.
|
|
||||||
lo_data_validation->formula1 = lv_validation_string.
|
|
||||||
lo_data_validation->cell_row = 2.
|
|
||||||
lo_data_validation->cell_row_to = 4.
|
|
||||||
lo_data_validation->cell_column = 'A'.
|
|
||||||
lo_data_validation->cell_column_to = 'A'.
|
|
||||||
lo_data_validation->allowblank = 'X'.
|
|
||||||
lo_data_validation->showdropdown = 'X'.
|
|
||||||
lo_data_validation->prompttitle = 'Value list available'.
|
|
||||||
lo_data_validation->prompt = 'Please select a value from the value list'.
|
|
||||||
lo_data_validation->errorstyle = zcl_excel_data_validation=>c_style_warning.
|
|
||||||
lo_data_validation->errortitle = 'Warning'.
|
|
||||||
lo_data_validation->error = 'This value does not exist in current value list.'.
|
|
||||||
|
|
||||||
* add some fields with validation
|
|
||||||
lv_row = 2.
|
|
||||||
WHILE lv_row <= 4.
|
|
||||||
lo_worksheet->set_cell( ip_row = lv_row ip_column = 'A' ip_value = 'Select' ).
|
|
||||||
lv_row = lv_row + 1.
|
|
||||||
ENDWHILE.
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL46</NAME>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Validation Style Warning</ENTRY>
|
|
||||||
<LENGTH>40</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,232 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report zdemo_excel47
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*& - BIND_TABLE and Calculated Columns
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel47.
|
|
||||||
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_hyperlink TYPE REF TO zcl_excel_hyperlink,
|
|
||||||
lo_column TYPE REF TO zcl_excel_column.
|
|
||||||
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '47_ColumnFormulas.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
CLASS lcl_app DEFINITION.
|
|
||||||
PUBLIC SECTION.
|
|
||||||
|
|
||||||
METHODS main
|
|
||||||
RAISING
|
|
||||||
zcx_excel.
|
|
||||||
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
CLASS lcl_app IMPLEMENTATION.
|
|
||||||
|
|
||||||
METHOD main.
|
|
||||||
|
|
||||||
TYPES: BEGIN OF ty_tblsheet1_line,
|
|
||||||
carrid TYPE sflight-carrid,
|
|
||||||
connid TYPE sflight-connid,
|
|
||||||
fldate TYPE sflight-fldate,
|
|
||||||
price TYPE sflight-price,
|
|
||||||
formula TYPE string,
|
|
||||||
formula_2 TYPE string,
|
|
||||||
column_formula TYPE string,
|
|
||||||
column_formula_2 TYPE sflight-price,
|
|
||||||
column_formula_3 TYPE sflight-price,
|
|
||||||
column_formula_4 TYPE sflight-price,
|
|
||||||
column_formula_5 TYPE string,
|
|
||||||
column_formula_6 TYPE string,
|
|
||||||
column_formula_7 TYPE string,
|
|
||||||
END OF ty_tblsheet1_line,
|
|
||||||
BEGIN OF ty_tblsheet2_line,
|
|
||||||
carrid TYPE scarr-carrid,
|
|
||||||
carrname TYPE scarr-carrname,
|
|
||||||
END OF ty_tblsheet2_line.
|
|
||||||
DATA: lv_f1 TYPE string,
|
|
||||||
ls_tblsheet1 TYPE ty_tblsheet1_line,
|
|
||||||
lt_tblsheet1 TYPE STANDARD TABLE OF ty_tblsheet1_line,
|
|
||||||
ls_tblsheet2 TYPE ty_tblsheet2_line,
|
|
||||||
lt_tblsheet2 TYPE STANDARD TABLE OF ty_tblsheet2_line,
|
|
||||||
lt_field_catalog TYPE zexcel_t_fieldcatalog,
|
|
||||||
ls_catalog TYPE zexcel_s_fieldcatalog,
|
|
||||||
ls_table_settings TYPE zexcel_s_table_settings,
|
|
||||||
lo_range TYPE REF TO zcl_excel_range.
|
|
||||||
FIELD-SYMBOLS: <ls_field_catalog> TYPE zexcel_s_fieldcatalog.
|
|
||||||
|
|
||||||
*** Initialization
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
" Sheet1
|
|
||||||
lv_f1 = 'TblSheet1[[#This Row],[Airfare]]+100'. " [@Airfare]+100
|
|
||||||
ls_tblsheet1-carrid = `AA`. ls_tblsheet1-connid = '0017'. ls_tblsheet1-fldate = '20180116'. ls_tblsheet1-price = '422.94'. ls_tblsheet1-formula = lv_f1. ls_tblsheet1-formula_2 = lv_f1.
|
|
||||||
APPEND ls_tblsheet1 TO lt_tblsheet1.
|
|
||||||
ls_tblsheet1-carrid = `AZ`. ls_tblsheet1-connid = '0555'. ls_tblsheet1-fldate = '20180116'. ls_tblsheet1-price = '185.00'. ls_tblsheet1-formula = lv_f1.
|
|
||||||
APPEND ls_tblsheet1 TO lt_tblsheet1.
|
|
||||||
ls_tblsheet1-carrid = `LH`. ls_tblsheet1-connid = '0400'. ls_tblsheet1-fldate = '20180119'. ls_tblsheet1-price = '666.00'. ls_tblsheet1-formula = lv_f1. ls_tblsheet1-formula_2 = lv_f1.
|
|
||||||
APPEND ls_tblsheet1 TO lt_tblsheet1.
|
|
||||||
ls_tblsheet1-carrid = `AA`. ls_tblsheet1-connid = '0941'. ls_tblsheet1-fldate = '20180117'. ls_tblsheet1-price = '879.82'. ls_tblsheet1-formula = lv_f1.
|
|
||||||
APPEND ls_tblsheet1 TO lt_tblsheet1.
|
|
||||||
|
|
||||||
" Sheet2
|
|
||||||
ls_tblsheet2-carrid = `AA`. ls_tblsheet2-carrname = 'America Airlines'.
|
|
||||||
APPEND ls_tblsheet2 TO lt_tblsheet2.
|
|
||||||
ls_tblsheet2-carrid = `AZ`. ls_tblsheet2-carrname = 'Alitalia'.
|
|
||||||
APPEND ls_tblsheet2 TO lt_tblsheet2.
|
|
||||||
ls_tblsheet2-carrid = `LH`. ls_tblsheet2-carrname = 'Lufthansa'.
|
|
||||||
APPEND ls_tblsheet2 TO lt_tblsheet2.
|
|
||||||
|
|
||||||
*** Sheet1
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
|
|
||||||
lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = lt_tblsheet1 ).
|
|
||||||
|
|
||||||
LOOP AT lt_field_catalog ASSIGNING <ls_field_catalog>.
|
|
||||||
CASE <ls_field_catalog>-fieldname.
|
|
||||||
WHEN 'CARRID'.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Company ID'.
|
|
||||||
WHEN 'AIRFARE'.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Airfare'.
|
|
||||||
WHEN 'PRICE'.
|
|
||||||
<ls_field_catalog>-totals_function = zcl_excel_table=>totals_function_average.
|
|
||||||
WHEN 'FORMULA'.
|
|
||||||
" Each cell may have a distinct formula, none formula is applied to future new rows
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Formula and aggregate function'.
|
|
||||||
<ls_field_catalog>-formula = abap_true.
|
|
||||||
<ls_field_catalog>-totals_function = zcl_excel_table=>totals_function_sum.
|
|
||||||
WHEN 'FORMULA_2'.
|
|
||||||
" each cell may have a distinct formula, a formula is applied to future new rows
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Formula except 1 cell & aggregate fu.'.
|
|
||||||
<ls_field_catalog>-formula = abap_true.
|
|
||||||
<ls_field_catalog>-column_formula = lv_f1. " to apply to future rows
|
|
||||||
<ls_field_catalog>-totals_function = zcl_excel_table=>totals_function_min.
|
|
||||||
WHEN 'COLUMN_FORMULA'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is NOT shared because a column name is used.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Column formula and aggregate function'.
|
|
||||||
<ls_field_catalog>-column_formula = 'TblSheet1[[#This Row],[Airfare]]+222'. " [@Airfare]+222
|
|
||||||
<ls_field_catalog>-totals_function = zcl_excel_table=>totals_function_min.
|
|
||||||
WHEN 'COLUMN_FORMULA_2'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is shared.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'C2. Column formula'.
|
|
||||||
<ls_field_catalog>-column_formula = 'D2+100'.
|
|
||||||
WHEN 'COLUMN_FORMULA_3'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is shared.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'C3. Column formula & aggregate function'.
|
|
||||||
<ls_field_catalog>-column_formula = 'D2+100'.
|
|
||||||
<ls_field_catalog>-totals_function = zcl_excel_table=>totals_function_max.
|
|
||||||
WHEN 'COLUMN_FORMULA_4'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is shared.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'C4. Column formula array fu./named range'.
|
|
||||||
<ls_field_catalog>-column_formula = 'A1&";"&_xlfn.IFS(TRUE,NamedRange)'. " =A1&";"&@IFS(TRUE,NamedRange)
|
|
||||||
WHEN 'COLUMN_FORMULA_5'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is NOT shared because it refers to a different sheet.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'C5. Column formula refers to other sheet'.
|
|
||||||
<ls_field_catalog>-column_formula = 'OtherSheet!A2'.
|
|
||||||
WHEN 'COLUMN_FORMULA_6'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is NOT shared.
|
|
||||||
" The formula seen in Excel: =FILTER(TblSheet2[Company Name],TblSheet2[Airline ID]=[@Airline],"")
|
|
||||||
<ls_field_catalog>-scrtext_l = 'C6. Column formula array fu./other sheet'.
|
|
||||||
<ls_field_catalog>-column_formula = '_xlfn.FILTER(TblSheet2[Company Name],TblSheet2[Company ID]=TblSheet1[[#This Row],[Company ID]],"")'.
|
|
||||||
WHEN 'COLUMN_FORMULA_7'.
|
|
||||||
" The column formula applies to all rows and to future new rows. Internally, the formula is NOT shared.
|
|
||||||
" The formula seen in Excel: =FILTER(Tbl2_Sheet1[Company Name],Tbl2_Sheet1[Airline ID]=[@Airline],"")
|
|
||||||
<ls_field_catalog>-scrtext_l = 'C7. Column formula array fu./same sheet'.
|
|
||||||
<ls_field_catalog>-column_formula = '_xlfn.FILTER(Tbl2_Sheet1[Company Name],Tbl2_Sheet1[Company ID]=TblSheet1[[#This Row],[Company ID]],"")'.
|
|
||||||
ENDCASE.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
|
|
||||||
ls_table_settings-table_name = 'TblSheet1'.
|
|
||||||
ls_table_settings-top_left_column = 'A'.
|
|
||||||
ls_table_settings-top_left_row = 1.
|
|
||||||
ls_table_settings-show_row_stripes = abap_true.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table(
|
|
||||||
ip_table = lt_tblsheet1
|
|
||||||
it_field_catalog = lt_field_catalog
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
iv_default_descr = 'L' ).
|
|
||||||
|
|
||||||
" Named range for formula 4
|
|
||||||
lo_range = lo_excel->add_new_range( ).
|
|
||||||
lo_range->name = 'NamedRange'.
|
|
||||||
lo_range->set_value( ip_sheet_name = lo_worksheet->get_title( )
|
|
||||||
ip_start_column = 'B'
|
|
||||||
ip_start_row = 1
|
|
||||||
ip_stop_column = 'B'
|
|
||||||
ip_stop_row = 1 ).
|
|
||||||
|
|
||||||
|
|
||||||
" Second table in same sheet
|
|
||||||
lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = lt_tblsheet2 ).
|
|
||||||
|
|
||||||
LOOP AT lt_field_catalog ASSIGNING <ls_field_catalog>.
|
|
||||||
CASE <ls_field_catalog>-fieldname.
|
|
||||||
WHEN 'CARRID'.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Company ID'.
|
|
||||||
WHEN 'CARRNAME'.
|
|
||||||
<ls_field_catalog>-scrtext_l = 'Company Name'.
|
|
||||||
ENDCASE.
|
|
||||||
ENDLOOP.
|
|
||||||
|
|
||||||
CLEAR ls_table_settings.
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
|
|
||||||
ls_table_settings-table_name = 'Tbl2_Sheet1'.
|
|
||||||
ls_table_settings-top_left_column = 'O'.
|
|
||||||
ls_table_settings-top_left_row = 1.
|
|
||||||
ls_table_settings-show_row_stripes = abap_true.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table(
|
|
||||||
ip_table = lt_tblsheet2
|
|
||||||
it_field_catalog = lt_field_catalog
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
iv_default_descr = 'L' ).
|
|
||||||
|
|
||||||
*** Sheet2
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( 'Sheet2' ).
|
|
||||||
|
|
||||||
CLEAR ls_table_settings.
|
|
||||||
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
|
|
||||||
ls_table_settings-table_name = 'TblSheet2'.
|
|
||||||
ls_table_settings-top_left_column = 'A'.
|
|
||||||
ls_table_settings-top_left_row = 1.
|
|
||||||
ls_table_settings-show_row_stripes = abap_true.
|
|
||||||
|
|
||||||
lo_worksheet->bind_table(
|
|
||||||
ip_table = lt_tblsheet2
|
|
||||||
it_field_catalog = lt_field_catalog
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
iv_default_descr = 'L' ).
|
|
||||||
|
|
||||||
*** OtherSheet
|
|
||||||
lo_worksheet = lo_excel->add_new_worksheet( 'OtherSheet' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 1 ip_row = 1 ip_value = 'Title' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 1 ip_row = 2 ip_value = 'A2' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 1 ip_row = 3 ip_value = 'A3' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 1 ip_row = 4 ip_value = 'A4' ).
|
|
||||||
lo_worksheet->set_cell( ip_column = 1 ip_row = 5 ip_value = 'A5' ).
|
|
||||||
|
|
||||||
*** Active sheet = Sheet1
|
|
||||||
lo_excel->set_active_sheet_index_by_name( 'Sheet1' ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( cl_excel = lo_excel iv_info_message = abap_false ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
ENDCLASS.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
DATA: go_app TYPE REF TO lcl_app,
|
|
||||||
go_error TYPE REF TO zcx_excel.
|
|
||||||
TRY.
|
|
||||||
CREATE OBJECT go_app.
|
|
||||||
go_app->main( ).
|
|
||||||
CATCH zcx_excel INTO go_error.
|
|
||||||
MESSAGE go_error TYPE 'I' DISPLAY LIKE 'E'.
|
|
||||||
ENDTRY.
|
|
|
@ -1,24 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL47</NAME>
|
|
||||||
<DBAPL>S</DBAPL>
|
|
||||||
<DBNA>D$</DBNA>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<RLOAD>E</RLOAD>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<LDBNAME>D$S</LDBNAME>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Table Calculated Columns (from Excel 365 or 2019)</ENTRY>
|
|
||||||
<LENGTH>65</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,116 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report zdemo_excel48
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel48.
|
|
||||||
|
|
||||||
DATA:
|
|
||||||
lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
lo_style_1 TYPE REF TO zcl_excel_style,
|
|
||||||
lo_style_2 TYPE REF TO zcl_excel_style,
|
|
||||||
lv_style_1_guid TYPE zexcel_cell_style,
|
|
||||||
lv_style_2_guid TYPE zexcel_cell_style,
|
|
||||||
lv_value TYPE string,
|
|
||||||
ls_rtf TYPE zexcel_s_rtf,
|
|
||||||
lt_rtf TYPE zexcel_t_rtf.
|
|
||||||
|
|
||||||
|
|
||||||
CONSTANTS:
|
|
||||||
gc_save_file_name TYPE string VALUE '48_MultipleStylesInOneCell.xlsx'.
|
|
||||||
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
|
|
||||||
lo_style_1 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_1->font->color-rgb = 'FF000000'.
|
|
||||||
|
|
||||||
lv_value = 'normal red underline normal red-underline bold italic bigger Times-New-Roman'.
|
|
||||||
|
|
||||||
" red
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->color-rgb = 'FFFF0000'.
|
|
||||||
ls_rtf-offset = 7.
|
|
||||||
ls_rtf-length = 3.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
" underline
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->underline = abap_true.
|
|
||||||
lo_style_2->font->underline_mode = lo_style_2->font->c_underline_single.
|
|
||||||
ls_rtf-offset = 11.
|
|
||||||
ls_rtf-length = 9.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
" red and underline
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->color-rgb = 'FFFF0000'.
|
|
||||||
lo_style_2->font->underline = abap_true.
|
|
||||||
lo_style_2->font->underline_mode = lo_style_2->font->c_underline_single.
|
|
||||||
ls_rtf-offset = 28.
|
|
||||||
ls_rtf-length = 13.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
" bold
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->bold = abap_true.
|
|
||||||
ls_rtf-offset = 42.
|
|
||||||
ls_rtf-length = 4.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
" italic
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->italic = abap_true.
|
|
||||||
ls_rtf-offset = 47.
|
|
||||||
ls_rtf-length = 6.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
" bigger
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->size = 28.
|
|
||||||
ls_rtf-offset = 54.
|
|
||||||
ls_rtf-length = 6.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
" Times-New-Roman
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->name = zcl_excel_style_font=>c_name_roman.
|
|
||||||
lo_style_2->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_2->font->family = zcl_excel_style_font=>c_family_roman.
|
|
||||||
|
|
||||||
" Create an underline double style
|
|
||||||
lo_style_2 = lo_excel->add_new_style( ).
|
|
||||||
lo_style_2->font->underline = abap_true.
|
|
||||||
lo_style_2->font->underline_mode = zcl_excel_style_font=>c_underline_double.
|
|
||||||
lo_style_2->font->name = zcl_excel_style_font=>c_name_roman.
|
|
||||||
lo_style_2->font->scheme = zcl_excel_style_font=>c_scheme_none.
|
|
||||||
lo_style_2->font->family = zcl_excel_style_font=>c_family_roman.
|
|
||||||
lv_style_2_guid = lo_style_2->get_guid( ).
|
|
||||||
ls_rtf-offset = 61.
|
|
||||||
ls_rtf-length = 15.
|
|
||||||
ls_rtf-font = lo_style_2->font->get_structure( ).
|
|
||||||
INSERT ls_rtf INTO TABLE lt_rtf.
|
|
||||||
|
|
||||||
lv_style_1_guid = lo_style_1->get_guid( ).
|
|
||||||
lo_worksheet->set_cell(
|
|
||||||
ip_column = 'B'
|
|
||||||
ip_row = 2
|
|
||||||
ip_style = lo_style_1->get_guid( )
|
|
||||||
ip_value = lv_value
|
|
||||||
it_rtf = lt_rtf ).
|
|
||||||
|
|
||||||
*** Create output
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL48</NAME>
|
|
||||||
<DBAPL>S</DBAPL>
|
|
||||||
<DBNA>D$</DBNA>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<LDBNAME>D$S</LDBNAME>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: multiple styles in one cell</ENTRY>
|
|
||||||
<LENGTH>43</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
|
@ -1,41 +0,0 @@
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*& Report zdemo_excel49
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
*&
|
|
||||||
*&---------------------------------------------------------------------*
|
|
||||||
REPORT zdemo_excel49.
|
|
||||||
DATA: lo_excel TYPE REF TO zcl_excel,
|
|
||||||
lo_worksheet TYPE REF TO zcl_excel_worksheet,
|
|
||||||
ls_table_settings TYPE zexcel_s_table_settings,
|
|
||||||
ls_t002t TYPE t002t,
|
|
||||||
lt_t002t TYPE TABLE OF t002t.
|
|
||||||
CONSTANTS: gc_save_file_name TYPE string VALUE '49_Bind_Table_Conversion_Exit.xlsx'.
|
|
||||||
INCLUDE zdemo_excel_outputopt_incl.
|
|
||||||
|
|
||||||
START-OF-SELECTION.
|
|
||||||
ls_t002t-spras = 'D'.
|
|
||||||
ls_t002t-sprsl = 'D'.
|
|
||||||
ls_t002t-sptxt = 'Deutsch'.
|
|
||||||
APPEND ls_t002t TO lt_t002t.
|
|
||||||
ls_t002t-spras = 'D'.
|
|
||||||
ls_t002t-sprsl = 'E'.
|
|
||||||
ls_t002t-sptxt = 'Englisch'.
|
|
||||||
APPEND ls_t002t TO lt_t002t.
|
|
||||||
ls_t002t-spras = 'E'.
|
|
||||||
ls_t002t-sprsl = 'D'.
|
|
||||||
ls_t002t-sptxt = 'German'.
|
|
||||||
APPEND ls_t002t TO lt_t002t.
|
|
||||||
ls_t002t-spras = 'E'.
|
|
||||||
ls_t002t-sprsl = 'E'.
|
|
||||||
ls_t002t-sptxt = 'English'.
|
|
||||||
APPEND ls_t002t TO lt_t002t.
|
|
||||||
|
|
||||||
CREATE OBJECT lo_excel.
|
|
||||||
lo_worksheet = lo_excel->get_active_worksheet( ).
|
|
||||||
ls_table_settings-top_left_column = 'A'.
|
|
||||||
ls_table_settings-top_left_row = 1.
|
|
||||||
lo_worksheet->bind_table(
|
|
||||||
ip_table = lt_t002t
|
|
||||||
is_table_settings = ls_table_settings
|
|
||||||
ip_conv_exit_length = abap_true ).
|
|
||||||
lcl_output=>output( lo_excel ).
|
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
|
|
||||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
||||||
<asx:values>
|
|
||||||
<PROGDIR>
|
|
||||||
<NAME>ZDEMO_EXCEL49</NAME>
|
|
||||||
<DBAPL>S</DBAPL>
|
|
||||||
<SUBC>1</SUBC>
|
|
||||||
<FIXPT>X</FIXPT>
|
|
||||||
<LDBNAME>D$S</LDBNAME>
|
|
||||||
<UCCHECK>X</UCCHECK>
|
|
||||||
</PROGDIR>
|
|
||||||
<TPOOL>
|
|
||||||
<item>
|
|
||||||
<ID>R</ID>
|
|
||||||
<ENTRY>abap2xlsx Demo: Bind Table with field having Conversion Exit</ENTRY>
|
|
||||||
<LENGTH>60</LENGTH>
|
|
||||||
</item>
|
|
||||||
</TPOOL>
|
|
||||||
</asx:values>
|
|
||||||
</asx:abap>
|
|
||||||
</abapGit>
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user