From 6a10206bbc15d68e4e89dfdf438717a6272d85ae Mon Sep 17 00:00:00 2001 From: sandraros Date: Sun, 6 Mar 2022 10:31:10 +0000 Subject: [PATCH 1/3] Delete objects moved to abap2xlsx/demos repository --- ... 89d0c0ce8687b56786306d6dd.sicf.xml | 18 - src/demos/zabap2xlsx_demo_show.prog.abap | 280 - src/demos/zabap2xlsx_demo_show.prog.xml | 22 - src/demos/zangry_birds.prog.abap | 752 --- src/demos/zangry_birds.prog.xml | 29 - src/demos/zdemo_calendar.prog.abap | 380 -- src/demos/zdemo_calendar.prog.xml | 130 - src/demos/zdemo_calendar_classes.prog.abap | 476 -- src/demos/zdemo_calendar_classes.prog.xml | 20 - src/demos/zdemo_excel.prog.abap | 91 - src/demos/zdemo_excel.prog.xml | 28 - src/demos/zdemo_excel1.prog.abap | 64 - src/demos/zdemo_excel1.prog.xml | 34 - src/demos/zdemo_excel10.prog.abap | 144 - src/demos/zdemo_excel10.prog.xml | 29 - src/demos/zdemo_excel11.prog.abap | 372 -- src/demos/zdemo_excel11.prog.xml | 95 - src/demos/zdemo_excel12.prog.abap | 108 - src/demos/zdemo_excel12.prog.xml | 29 - src/demos/zdemo_excel13.prog.abap | 87 - src/demos/zdemo_excel13.prog.xml | 29 - src/demos/zdemo_excel14.prog.abap | 160 - src/demos/zdemo_excel14.prog.xml | 29 - src/demos/zdemo_excel15.prog.abap | 162 - src/demos/zdemo_excel15.prog.xml | 35 - src/demos/zdemo_excel16.prog.abap | 131 - src/demos/zdemo_excel16.prog.xml | 50 - src/demos/zdemo_excel17.prog.abap | 53 - src/demos/zdemo_excel17.prog.xml | 36 - src/demos/zdemo_excel18.prog.abap | 34 - src/demos/zdemo_excel18.prog.xml | 29 - src/demos/zdemo_excel19.prog.abap | 53 - src/demos/zdemo_excel19.prog.xml | 55 - src/demos/zdemo_excel2.prog.abap | 224 - src/demos/zdemo_excel2.prog.xml | 29 - src/demos/zdemo_excel20.prog.abap | 193 - src/demos/zdemo_excel20.prog.xml | 4711 ----------------- src/demos/zdemo_excel21.prog.abap | 123 - src/demos/zdemo_excel21.prog.xml | 29 - src/demos/zdemo_excel22.prog.abap | 176 - src/demos/zdemo_excel22.prog.xml | 29 - src/demos/zdemo_excel23.prog.abap | 88 - src/demos/zdemo_excel23.prog.xml | 22 - src/demos/zdemo_excel24.prog.abap | 109 - src/demos/zdemo_excel24.prog.xml | 22 - src/demos/zdemo_excel25.prog.abap | 169 - src/demos/zdemo_excel25.prog.xml | 29 - src/demos/zdemo_excel26.prog.abap | 207 - src/demos/zdemo_excel26.prog.xml | 991 ---- src/demos/zdemo_excel27.prog.abap | 229 - src/demos/zdemo_excel27.prog.xml | 35 - src/demos/zdemo_excel28.prog.abap | 105 - src/demos/zdemo_excel28.prog.xml | 22 - src/demos/zdemo_excel29.prog.abap | 163 - src/demos/zdemo_excel29.prog.xml | 46 - src/demos/zdemo_excel3.prog.abap | 198 - src/demos/zdemo_excel3.prog.xml | 35 - src/demos/zdemo_excel30.prog.abap | 96 - src/demos/zdemo_excel30.prog.xml | 29 - src/demos/zdemo_excel31.prog.abap | 160 - src/demos/zdemo_excel31.prog.xml | 29 - src/demos/zdemo_excel32.prog.abap | 232 - src/demos/zdemo_excel32.prog.xml | 1941 ------- src/demos/zdemo_excel33.prog.abap | 118 - src/demos/zdemo_excel33.prog.xml | 35 - src/demos/zdemo_excel34.prog.abap | 217 - src/demos/zdemo_excel34.prog.xml | 29 - src/demos/zdemo_excel35.prog.abap | 170 - src/demos/zdemo_excel35.prog.xml | 29 - src/demos/zdemo_excel36.prog.abap | 111 - src/demos/zdemo_excel36.prog.xml | 22 - src/demos/zdemo_excel37.prog.abap | 301 -- src/demos/zdemo_excel37.prog.xml | 118 - src/demos/zdemo_excel38.prog.abap | 106 - src/demos/zdemo_excel38.prog.xml | 29 - src/demos/zdemo_excel39.prog.abap | 468 -- src/demos/zdemo_excel39.prog.xml | 50 - src/demos/zdemo_excel4.prog.abap | 115 - src/demos/zdemo_excel4.prog.xml | 29 - src/demos/zdemo_excel40.prog.abap | 63 - src/demos/zdemo_excel40.prog.xml | 29 - src/demos/zdemo_excel41.prog.abap | 102 - src/demos/zdemo_excel41.prog.xml | 1711 ------ src/demos/zdemo_excel42.prog.abap | 101 - src/demos/zdemo_excel42.prog.xml | 23 - src/demos/zdemo_excel43.prog.abap | 78 - src/demos/zdemo_excel43.prog.xml | 33 - src/demos/zdemo_excel44.prog.abap | 58 - src/demos/zdemo_excel44.prog.xml | 34 - src/demos/zdemo_excel45.prog.abap | 66 - src/demos/zdemo_excel45.prog.xml | 21 - src/demos/zdemo_excel46.prog.abap | 71 - src/demos/zdemo_excel46.prog.xml | 21 - src/demos/zdemo_excel47.prog.abap | 232 - src/demos/zdemo_excel47.prog.xml | 24 - src/demos/zdemo_excel48.prog.abap | 116 - src/demos/zdemo_excel48.prog.xml | 23 - src/demos/zdemo_excel49.prog.abap | 41 - src/demos/zdemo_excel49.prog.xml | 22 - src/demos/zdemo_excel5.prog.abap | 79 - src/demos/zdemo_excel5.prog.xml | 22 - src/demos/zdemo_excel6.prog.abap | 61 - src/demos/zdemo_excel6.prog.xml | 29 - src/demos/zdemo_excel7.prog.abap | 425 -- src/demos/zdemo_excel7.prog.xml | 29 - src/demos/zdemo_excel8.prog.abap | 71 - src/demos/zdemo_excel8.prog.xml | 29 - src/demos/zdemo_excel9.prog.abap | 203 - src/demos/zdemo_excel9.prog.xml | 35 - src/demos/zdemo_excel_checker.prog.abap | 1388 ----- src/demos/zdemo_excel_checker.prog.xml | 22 - src/demos/zdemo_excel_comments.prog.abap | 48 - src/demos/zdemo_excel_comments.prog.xml | 34 - src/demos/zdemo_excel_fill_template.prog.abap | 353 -- src/demos/zdemo_excel_fill_template.prog.xml | 58 - .../zdemo_excel_outputopt_incl.prog.abap | 391 -- src/demos/zdemo_excel_outputopt_incl.prog.xml | 20 - src/demos/zdemo_excel_wda01.wdya.xml | 14 - src/demos/zdemo_excel_wda01.wdyn.xml | 1410 ----- src/demos/zdemo_teched1.prog.abap | 83 - src/demos/zdemo_teched1.prog.xml | 29 - src/demos/zdemo_teched10.prog.abap | 49 - src/demos/zdemo_teched10.prog.xml | 29 - src/demos/zdemo_teched2.prog.abap | 91 - src/demos/zdemo_teched2.prog.xml | 29 - src/demos/zdemo_teched3.prog.abap | 107 - src/demos/zdemo_teched3.prog.xml | 29 - src/demos/zdemo_teched4.prog.abap | 129 - src/demos/zdemo_teched4.prog.xml | 29 - src/demos/zdemo_teched5.prog.abap | 150 - src/demos/zdemo_teched5.prog.xml | 29 - src/demos/zdemo_teched6.prog.abap | 157 - src/demos/zdemo_teched6.prog.xml | 29 - src/demos/zdemo_teched7.prog.abap | 160 - src/demos/zdemo_teched7.prog.xml | 29 - src/demos/zdemo_teched8.prog.abap | 222 - src/demos/zdemo_teched8.prog.xml | 29 - src/demos/zdemo_teched9.prog.abap | 211 - src/demos/zdemo_teched9.prog.xml | 29 - src/demos/zexcel_s_org_rel.tabl.xml | 260 - src/demos/ztest_excel_image_header.prog.abap | 106 - src/demos/ztest_excel_image_header.prog.xml | 32 - 142 files changed, 26099 deletions(-) delete mode 100644 src/demos/npl0018 89d0c0ce8687b56786306d6dd.sicf.xml delete mode 100644 src/demos/zabap2xlsx_demo_show.prog.abap delete mode 100644 src/demos/zabap2xlsx_demo_show.prog.xml delete mode 100644 src/demos/zangry_birds.prog.abap delete mode 100644 src/demos/zangry_birds.prog.xml delete mode 100644 src/demos/zdemo_calendar.prog.abap delete mode 100644 src/demos/zdemo_calendar.prog.xml delete mode 100644 src/demos/zdemo_calendar_classes.prog.abap delete mode 100644 src/demos/zdemo_calendar_classes.prog.xml delete mode 100644 src/demos/zdemo_excel.prog.abap delete mode 100644 src/demos/zdemo_excel.prog.xml delete mode 100644 src/demos/zdemo_excel1.prog.abap delete mode 100644 src/demos/zdemo_excel1.prog.xml delete mode 100644 src/demos/zdemo_excel10.prog.abap delete mode 100644 src/demos/zdemo_excel10.prog.xml delete mode 100644 src/demos/zdemo_excel11.prog.abap delete mode 100644 src/demos/zdemo_excel11.prog.xml delete mode 100644 src/demos/zdemo_excel12.prog.abap delete mode 100644 src/demos/zdemo_excel12.prog.xml delete mode 100644 src/demos/zdemo_excel13.prog.abap delete mode 100644 src/demos/zdemo_excel13.prog.xml delete mode 100644 src/demos/zdemo_excel14.prog.abap delete mode 100644 src/demos/zdemo_excel14.prog.xml delete mode 100644 src/demos/zdemo_excel15.prog.abap delete mode 100644 src/demos/zdemo_excel15.prog.xml delete mode 100644 src/demos/zdemo_excel16.prog.abap delete mode 100644 src/demos/zdemo_excel16.prog.xml delete mode 100644 src/demos/zdemo_excel17.prog.abap delete mode 100644 src/demos/zdemo_excel17.prog.xml delete mode 100644 src/demos/zdemo_excel18.prog.abap delete mode 100644 src/demos/zdemo_excel18.prog.xml delete mode 100644 src/demos/zdemo_excel19.prog.abap delete mode 100644 src/demos/zdemo_excel19.prog.xml delete mode 100644 src/demos/zdemo_excel2.prog.abap delete mode 100644 src/demos/zdemo_excel2.prog.xml delete mode 100644 src/demos/zdemo_excel20.prog.abap delete mode 100644 src/demos/zdemo_excel20.prog.xml delete mode 100644 src/demos/zdemo_excel21.prog.abap delete mode 100644 src/demos/zdemo_excel21.prog.xml delete mode 100644 src/demos/zdemo_excel22.prog.abap delete mode 100644 src/demos/zdemo_excel22.prog.xml delete mode 100644 src/demos/zdemo_excel23.prog.abap delete mode 100644 src/demos/zdemo_excel23.prog.xml delete mode 100644 src/demos/zdemo_excel24.prog.abap delete mode 100644 src/demos/zdemo_excel24.prog.xml delete mode 100644 src/demos/zdemo_excel25.prog.abap delete mode 100644 src/demos/zdemo_excel25.prog.xml delete mode 100644 src/demos/zdemo_excel26.prog.abap delete mode 100644 src/demos/zdemo_excel26.prog.xml delete mode 100644 src/demos/zdemo_excel27.prog.abap delete mode 100644 src/demos/zdemo_excel27.prog.xml delete mode 100644 src/demos/zdemo_excel28.prog.abap delete mode 100644 src/demos/zdemo_excel28.prog.xml delete mode 100644 src/demos/zdemo_excel29.prog.abap delete mode 100644 src/demos/zdemo_excel29.prog.xml delete mode 100644 src/demos/zdemo_excel3.prog.abap delete mode 100644 src/demos/zdemo_excel3.prog.xml delete mode 100644 src/demos/zdemo_excel30.prog.abap delete mode 100644 src/demos/zdemo_excel30.prog.xml delete mode 100644 src/demos/zdemo_excel31.prog.abap delete mode 100644 src/demos/zdemo_excel31.prog.xml delete mode 100644 src/demos/zdemo_excel32.prog.abap delete mode 100644 src/demos/zdemo_excel32.prog.xml delete mode 100644 src/demos/zdemo_excel33.prog.abap delete mode 100644 src/demos/zdemo_excel33.prog.xml delete mode 100644 src/demos/zdemo_excel34.prog.abap delete mode 100644 src/demos/zdemo_excel34.prog.xml delete mode 100644 src/demos/zdemo_excel35.prog.abap delete mode 100644 src/demos/zdemo_excel35.prog.xml delete mode 100644 src/demos/zdemo_excel36.prog.abap delete mode 100644 src/demos/zdemo_excel36.prog.xml delete mode 100644 src/demos/zdemo_excel37.prog.abap delete mode 100644 src/demos/zdemo_excel37.prog.xml delete mode 100644 src/demos/zdemo_excel38.prog.abap delete mode 100644 src/demos/zdemo_excel38.prog.xml delete mode 100644 src/demos/zdemo_excel39.prog.abap delete mode 100644 src/demos/zdemo_excel39.prog.xml delete mode 100644 src/demos/zdemo_excel4.prog.abap delete mode 100644 src/demos/zdemo_excel4.prog.xml delete mode 100644 src/demos/zdemo_excel40.prog.abap delete mode 100644 src/demos/zdemo_excel40.prog.xml delete mode 100644 src/demos/zdemo_excel41.prog.abap delete mode 100644 src/demos/zdemo_excel41.prog.xml delete mode 100644 src/demos/zdemo_excel42.prog.abap delete mode 100644 src/demos/zdemo_excel42.prog.xml delete mode 100644 src/demos/zdemo_excel43.prog.abap delete mode 100644 src/demos/zdemo_excel43.prog.xml delete mode 100644 src/demos/zdemo_excel44.prog.abap delete mode 100644 src/demos/zdemo_excel44.prog.xml delete mode 100644 src/demos/zdemo_excel45.prog.abap delete mode 100644 src/demos/zdemo_excel45.prog.xml delete mode 100644 src/demos/zdemo_excel46.prog.abap delete mode 100644 src/demos/zdemo_excel46.prog.xml delete mode 100644 src/demos/zdemo_excel47.prog.abap delete mode 100644 src/demos/zdemo_excel47.prog.xml delete mode 100644 src/demos/zdemo_excel48.prog.abap delete mode 100644 src/demos/zdemo_excel48.prog.xml delete mode 100644 src/demos/zdemo_excel49.prog.abap delete mode 100644 src/demos/zdemo_excel49.prog.xml delete mode 100644 src/demos/zdemo_excel5.prog.abap delete mode 100644 src/demos/zdemo_excel5.prog.xml delete mode 100644 src/demos/zdemo_excel6.prog.abap delete mode 100644 src/demos/zdemo_excel6.prog.xml delete mode 100644 src/demos/zdemo_excel7.prog.abap delete mode 100644 src/demos/zdemo_excel7.prog.xml delete mode 100644 src/demos/zdemo_excel8.prog.abap delete mode 100644 src/demos/zdemo_excel8.prog.xml delete mode 100644 src/demos/zdemo_excel9.prog.abap delete mode 100644 src/demos/zdemo_excel9.prog.xml delete mode 100644 src/demos/zdemo_excel_checker.prog.abap delete mode 100644 src/demos/zdemo_excel_checker.prog.xml delete mode 100644 src/demos/zdemo_excel_comments.prog.abap delete mode 100644 src/demos/zdemo_excel_comments.prog.xml delete mode 100644 src/demos/zdemo_excel_fill_template.prog.abap delete mode 100644 src/demos/zdemo_excel_fill_template.prog.xml delete mode 100644 src/demos/zdemo_excel_outputopt_incl.prog.abap delete mode 100644 src/demos/zdemo_excel_outputopt_incl.prog.xml delete mode 100644 src/demos/zdemo_excel_wda01.wdya.xml delete mode 100644 src/demos/zdemo_excel_wda01.wdyn.xml delete mode 100644 src/demos/zdemo_teched1.prog.abap delete mode 100644 src/demos/zdemo_teched1.prog.xml delete mode 100644 src/demos/zdemo_teched10.prog.abap delete mode 100644 src/demos/zdemo_teched10.prog.xml delete mode 100644 src/demos/zdemo_teched2.prog.abap delete mode 100644 src/demos/zdemo_teched2.prog.xml delete mode 100644 src/demos/zdemo_teched3.prog.abap delete mode 100644 src/demos/zdemo_teched3.prog.xml delete mode 100644 src/demos/zdemo_teched4.prog.abap delete mode 100644 src/demos/zdemo_teched4.prog.xml delete mode 100644 src/demos/zdemo_teched5.prog.abap delete mode 100644 src/demos/zdemo_teched5.prog.xml delete mode 100644 src/demos/zdemo_teched6.prog.abap delete mode 100644 src/demos/zdemo_teched6.prog.xml delete mode 100644 src/demos/zdemo_teched7.prog.abap delete mode 100644 src/demos/zdemo_teched7.prog.xml delete mode 100644 src/demos/zdemo_teched8.prog.abap delete mode 100644 src/demos/zdemo_teched8.prog.xml delete mode 100644 src/demos/zdemo_teched9.prog.abap delete mode 100644 src/demos/zdemo_teched9.prog.xml delete mode 100644 src/demos/zexcel_s_org_rel.tabl.xml delete mode 100644 src/demos/ztest_excel_image_header.prog.abap delete mode 100644 src/demos/ztest_excel_image_header.prog.xml diff --git a/src/demos/npl0018 89d0c0ce8687b56786306d6dd.sicf.xml b/src/demos/npl0018 89d0c0ce8687b56786306d6dd.sicf.xml deleted file mode 100644 index 000f545d7..000000000 --- a/src/demos/npl0018 89d0c0ce8687b56786306d6dd.sicf.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - /sap/bc/webdynpro/sap/NPL0018/ - - NPL0018 - NPL0018 - ZDEMO_EXCEL_WDA01 - - - NPL0018 - E - Web Dynpro Application ZDEMO_EXCEL_WDA01 / Component ZDEMO_EXCEL_WDA01 - - - - diff --git a/src/demos/zabap2xlsx_demo_show.prog.abap b/src/demos/zabap2xlsx_demo_show.prog.abap deleted file mode 100644 index fcb23a13b..000000000 --- a/src/demos/zabap2xlsx_demo_show.prog.abap +++ /dev/null @@ -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: 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 . - -fieldname = 'PROGNAME'. - -tabname = 'REPOSRC'. - - APPEND INITIAL LINE TO it_fieldcat ASSIGNING . - -fieldname = 'SORT'. - -ref_field = 'PROGNAME'. - -ref_table = 'REPOSRC'. - -tech = abap_true. "No need to display this help field - - APPEND INITIAL LINE TO it_fieldcat ASSIGNING . - -fieldname = 'DESCRIPTION'. - -ref_field = 'REPTI'. - -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 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 . - -* Check if already switched to new outputoptions - READ 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 - -sort = -progname. - REPLACE REGEX '(ZDEMO_EXCEL)(\d\d)\s*$' IN -sort WITH '$1\0$2'. " REPLACE REGEX '(ZDEMO_EXCEL)([^][^])*$' IN -sort WITH '$1$2'.REPLACE REGEX '(ZDEMO_EXCEL)([^][^])*$' IN -sort WITH '$1$2'.REPLACE - - REPLACE REGEX '(ZDEMO_EXCEL)(\d)\s*$' IN -sort WITH '$1\0\0$2'. - -* get report text - READ TEXTPOOL -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 -progname INTO texts LANGUAGE 'E'. - READ TABLE texts INTO description WITH KEY id = 'R'. - ENDIF. - "set report title - -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 diff --git a/src/demos/zabap2xlsx_demo_show.prog.xml b/src/demos/zabap2xlsx_demo_show.prog.xml deleted file mode 100644 index 63222e78a..000000000 --- a/src/demos/zabap2xlsx_demo_show.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZABAP2XLSX_DEMO_SHOW - 1 - T - E - X - X - - - - R - abap2xlsx Demo Show - 19 - - - - - diff --git a/src/demos/zangry_birds.prog.abap b/src/demos/zangry_birds.prog.abap deleted file mode 100644 index 3ad0d17d3..000000000 --- a/src/demos/zangry_birds.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zangry_birds.prog.xml b/src/demos/zangry_birds.prog.xml deleted file mode 100644 index c2860eb60..000000000 --- a/src/demos/zangry_birds.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZANGRY_BIRDS - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Styles - 25 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_calendar.prog.abap b/src/demos/zdemo_calendar.prog.abap deleted file mode 100644 index 53df60ef3..000000000 --- a/src/demos/zdemo_calendar.prog.abap +++ /dev/null @@ -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: 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: 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 . - CONCATENATE -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 . - READ TABLE image_descriptions WITH KEY month_nr = month_nr ASSIGNING . - IF IS ASSIGNED. - value = -descr. - IF p_portr = abap_true. - row = lv_from_row - 3. - ELSE. - row = lv_from_row - 2. - ENDIF. - IF NOT -url IS INITIAL. - lo_hyperlink = zcl_excel_hyperlink=>create_external_link( -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 -photographer IS INITIAL. - value = -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 -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 ). diff --git a/src/demos/zdemo_calendar.prog.xml b/src/demos/zdemo_calendar.prog.xml deleted file mode 100644 index b025e2ee8..000000000 --- a/src/demos/zdemo_calendar.prog.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - ZDEMO_CALENDAR - 1 - T - E - X - X - - - - I - 000 - Orientation - 21 - - - I - 001 - CW - 12 - - - I - 002 - Created with https://github.com/abap2xlsx/abap2xlsx - 132 - - - R - abap2xlsx Demo: Create Calendar with Pictures - 45 - - - S - P_FROM - From - 12 - - - S - P_LANDS - Landscape - 17 - - - S - P_PATH - Path - 12 - - - S - P_PORTR - Portrait - 16 - - - S - P_TO - To - 10 - - - - - D - - - I - 000 - Ausrichtung - 21 - - - I - 001 - KW - 12 - - - I - 002 - Erzeugt mit https://github.com/abap2xlsx/abap2xlsx - 132 - - - R - abap2xlsx Demo: Erzeugen eines Kalenders mit Bildern - 70 - - - S - P_FROM - Von - 38 - - - S - P_LANDS - Querformat - 38 - - - S - P_PATH - Pfad - 38 - - - S - P_PORTR - Hochformat - 38 - - - S - P_TO - Bis - 38 - - - - - - - diff --git a/src/demos/zdemo_calendar_classes.prog.abap b/src/demos/zdemo_calendar_classes.prog.abap deleted file mode 100644 index 106f9a647..000000000 --- a/src/demos/zdemo_calendar_classes.prog.abap +++ /dev/null @@ -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: 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 . - row = i_from_row. - col_int = from_col_int + -wotnr. - col = zcl_excel_common=>convert_column2alpha( col_int ). - value = -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: 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 - WITH KEY wotnr = weekday. - value = -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 diff --git a/src/demos/zdemo_calendar_classes.prog.xml b/src/demos/zdemo_calendar_classes.prog.xml deleted file mode 100644 index bdad86c36..000000000 --- a/src/demos/zdemo_calendar_classes.prog.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - ZDEMO_CALENDAR_CLASSES - I - E - X - - - - R - Include ZDEMO_CALENDAR_CLASSES - 30 - - - - - diff --git a/src/demos/zdemo_excel.prog.abap b/src/demos/zdemo_excel.prog.abap deleted file mode 100644 index f4b64fd02..000000000 --- a/src/demos/zdemo_excel.prog.abap +++ /dev/null @@ -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 diff --git a/src/demos/zdemo_excel.prog.xml b/src/demos/zdemo_excel.prog.xml deleted file mode 100644 index 6efcb281b..000000000 --- a/src/demos/zdemo_excel.prog.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - ZDEMO_EXCEL - 1 - T - E - X - X - - - - R - abap2xlsx Demo: - 15 - - - S - P_PATH - Select output path - 26 - - - - - diff --git a/src/demos/zdemo_excel1.prog.abap b/src/demos/zdemo_excel1.prog.abap deleted file mode 100644 index e1505a11d..000000000 --- a/src/demos/zdemo_excel1.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel1.prog.xml b/src/demos/zdemo_excel1.prog.xml deleted file mode 100644 index 6f74323b9..000000000 --- a/src/demos/zdemo_excel1.prog.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - ZDEMO_EXCEL1 - 1 - T - E - X - X - - - - S - P_PATH - . - 9 - D - - - S - RB_BACK - 17 - - - R - abap2xlsx Demo: Hello World - 28 - - - - - diff --git a/src/demos/zdemo_excel10.prog.abap b/src/demos/zdemo_excel10.prog.abap deleted file mode 100644 index 6393f2b82..000000000 --- a/src/demos/zdemo_excel10.prog.abap +++ /dev/null @@ -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: 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 . - CASE -fieldname. - WHEN 'CARRID'. - -position = 3. - -dynpfld = abap_true. - -totals_function = zcl_excel_table=>totals_function_count. - WHEN 'CONNID'. - -position = 4. - -dynpfld = abap_true. - -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'. - -position = 2. - -dynpfld = abap_true. - WHEN 'PRICE'. - -position = 1. - -dynpfld = abap_true. - -totals_function = zcl_excel_table=>totals_function_sum. - -style_cond = lo_style_cond->get_guid( ). - WHEN OTHERS. - -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: 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_comp = lv_comp + 1. - ENDLOOP. - APPEND ls_test TO ct_test. - ENDLOOP. -ENDFORM. diff --git a/src/demos/zdemo_excel10.prog.xml b/src/demos/zdemo_excel10.prog.xml deleted file mode 100644 index 7ee7b60e5..000000000 --- a/src/demos/zdemo_excel10.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL10 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Format internal table with field catalog - 57 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel11.prog.abap b/src/demos/zdemo_excel11.prog.abap deleted file mode 100644 index 52215d3fb..000000000 --- a/src/demos/zdemo_excel11.prog.abap +++ /dev/null @@ -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: 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: LIKE LINE OF relationships. -DATA: relationship_centraldata TYPE bapibus1006002_central. -DATA: relationship_addresses TYPE TABLE OF bapibus1006002_addresses. -FIELD-SYMBOLS: LIKE LINE OF relationship_addresses. - -DATA: lt_download TYPE TABLE OF zexcel_s_org_rel. -FIELD-SYMBOLS: 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 . - " Read Details of Organization - CALL FUNCTION 'BAPI_BUPA_CENTRAL_GETDETAIL' - EXPORTING - businesspartner = -partner - IMPORTING - centraldataorganization = centraldataorganization. - " Read Standard Address of Organization - CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL' - EXPORTING - businesspartner = -partner - IMPORTING - addressdata = addressdata. - - " Add Organization to Download - APPEND INITIAL LINE TO lt_download ASSIGNING . - " Fill Organization Partner Numbers - CALL FUNCTION 'BAPI_BUPA_GET_NUMBERS' - EXPORTING - businesspartner = -partner - IMPORTING - businesspartnerout = -org_number - businesspartnerguidout = -org_guid. - - MOVE-CORRESPONDING centraldataorganization TO . - MOVE-CORRESPONDING addressdata TO . - CLEAR: addressdata. - - " Read all Relationships - CLEAR: relationships. - CALL FUNCTION 'BAPI_BUPA_RELATIONSHIPS_GET' - EXPORTING - businesspartner = -partner - TABLES - relationships = relationships. - DELETE relationships WHERE relationshipcategory <> 'BUR001'. - LOOP AT relationships ASSIGNING . - " Read details of Contact person - CALL FUNCTION 'BAPI_BUPA_CENTRAL_GETDETAIL' - EXPORTING - businesspartner = -partner2 - IMPORTING - centraldata = centraldata - centraldataperson = centraldataperson. - " Read details of the Relationship - CALL FUNCTION 'BAPI_BUPR_CONTP_GETDETAIL' - EXPORTING - businesspartner = -partner1 - contactperson = -partner2 - IMPORTING - centraldata = relationship_centraldata. - " Read relationship address - CLEAR: relationship_addresses. - - CALL FUNCTION 'BAPI_BUPR_CONTP_ADDRESSES_GET' - EXPORTING - businesspartner = -partner1 - contactperson = -partner2 - TABLES - addresses = relationship_addresses. - - READ TABLE relationship_addresses - ASSIGNING - WITH KEY standardaddress = 'X'. - - IF sy-subrc = 0. - " Read Relationship Address - CLEAR addressdata. - CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL' - EXPORTING - businesspartner = -partner - addressguid = -addressguid - IMPORTING - addressdata = addressdata. - - APPEND INITIAL LINE TO lt_download ASSIGNING . - CALL FUNCTION 'BAPI_BUPA_GET_NUMBERS' - EXPORTING - businesspartner = -partner1 - IMPORTING - businesspartnerout = -org_number - businesspartnerguidout = -org_guid. - - CALL FUNCTION 'BAPI_BUPA_GET_NUMBERS' - EXPORTING - businesspartner = -partner2 - IMPORTING - businesspartnerout = -contpers_number - businesspartnerguidout = -contpers_guid. - - MOVE-CORRESPONDING centraldataorganization TO . - MOVE-CORRESPONDING addressdata TO . - MOVE-CORRESPONDING centraldataperson TO . - MOVE-CORRESPONDING relationship_centraldata TO . - - WRITE: / -partner1, -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: 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 . - CASE -fieldname. - WHEN 'ORG_NUMBER'. - -position = 1. - -dynpfld = abap_true. - WHEN 'CONTPERS_NUMBER'. - -position = 2. - -dynpfld = abap_true. - WHEN 'NAME1'. - -position = 3. - -dynpfld = abap_true. - WHEN 'NAME2'. - -position = 4. - -dynpfld = abap_true. - WHEN 'STREET'. - -position = 5. - -dynpfld = abap_true. - WHEN 'HOUSE_NO'. - -position = 6. - -dynpfld = abap_true. - WHEN 'POSTL_COD1'. - -position = 7. - -dynpfld = abap_true. - WHEN 'CITY'. - -position = 8. - -dynpfld = abap_true. - WHEN 'COUNTRYISO'. - -position = 9. - -dynpfld = abap_true. - WHEN 'FIRSTNAME'. - -position = 10. - -dynpfld = abap_true. - WHEN 'LASTNAME'. - -position = 11. - -dynpfld = abap_true. - WHEN 'FUNCTIONNAME'. - -position = 12. - -dynpfld = abap_true. - WHEN 'DEPARTMENTNAME'. - -position = 13. - -dynpfld = abap_true. - WHEN 'TEL1_NUMBR'. - -position = 14. - -dynpfld = abap_true. - WHEN 'TEL1_EXT'. - -position = 15. - -dynpfld = abap_true. - WHEN 'FAX_NUMBER'. - -position = 16. - -dynpfld = abap_true. - WHEN 'FAX_EXTENS'. - -position = 17. - -dynpfld = abap_true. - WHEN 'E_MAIL'. - -position = 18. - -dynpfld = abap_true. - WHEN OTHERS. - -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 . - row = sy-tabix + 2. - IF NOT -org_number IS INITIAL - AND -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 -org_number IS INITIAL - AND NOT -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 - WHERE position <> '' AND dynpfld = abap_true. - column = -position. - column_alpha = zcl_excel_common=>convert_column2alpha( column ). - value = -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 ). diff --git a/src/demos/zdemo_excel11.prog.xml b/src/demos/zdemo_excel11.prog.xml deleted file mode 100644 index 9044355be..000000000 --- a/src/demos/zdemo_excel11.prog.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - ZDEMO_EXCEL11 - 1 - K - E - X - X - - - - I - 00A - Select by master data - 132 - - - I - 00B - Select by relationship - 132 - - - R - abap2xlsx Demo: Export Organisation and Contact Persons - 55 - - - S - COUNTRY - . - 19 - D - - - S - MAXSEL - . - 27 - D - - - S - MD - Select by master data - 29 - - - S - PARTNER - . - 24 - D - - - S - PARTNERC - . - 19 - D - - - S - POSTLCOD - . - 19 - D - - - S - P_PATH - . - 21 - D - - - S - REL - Select by relationship - 30 - - - S - RELTYP - . - 25 - D - - - - - diff --git a/src/demos/zdemo_excel12.prog.abap b/src/demos/zdemo_excel12.prog.abap deleted file mode 100644 index 541234a19..000000000 --- a/src/demos/zdemo_excel12.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel12.prog.xml b/src/demos/zdemo_excel12.prog.xml deleted file mode 100644 index b11456ffe..000000000 --- a/src/demos/zdemo_excel12.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL12 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hide Columns - 29 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel13.prog.abap b/src/demos/zdemo_excel13.prog.abap deleted file mode 100644 index 514191d08..000000000 --- a/src/demos/zdemo_excel13.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel13.prog.xml b/src/demos/zdemo_excel13.prog.xml deleted file mode 100644 index 985825ad0..000000000 --- a/src/demos/zdemo_excel13.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL13 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Merge cells - 28 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel14.prog.abap b/src/demos/zdemo_excel14.prog.abap deleted file mode 100644 index 2e746c27f..000000000 --- a/src/demos/zdemo_excel14.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel14.prog.xml b/src/demos/zdemo_excel14.prog.xml deleted file mode 100644 index 8a7215684..000000000 --- a/src/demos/zdemo_excel14.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL14 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Alignment - 26 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel15.prog.abap b/src/demos/zdemo_excel15.prog.abap deleted file mode 100644 index 1772aa2d2..000000000 --- a/src/demos/zdemo_excel15.prog.abap +++ /dev/null @@ -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: 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 . - -input = '01_HelloWorld.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '02_Styles.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '03_iTab.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '04_Sheets.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '05_Conditional.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '07_ConditionalAll.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '08_Range.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = '13_MergedCells.xlsx'. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -input = sheet_with_date_formats. - APPEND INITIAL LINE TO lt_files ASSIGNING . - -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 . - CONCATENATE p_path lv_file_separator -input INTO input_file_path. - CONCATENATE p_path lv_file_separator '15_' -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 ', -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 -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. diff --git a/src/demos/zdemo_excel15.prog.xml b/src/demos/zdemo_excel15.prog.xml deleted file mode 100644 index 298e4534a..000000000 --- a/src/demos/zdemo_excel15.prog.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ZDEMO_EXCEL15 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Reader - 22 - - - S - P_NOOUT - Hide output - 19 - - - S - P_PATH - . - 24 - D - - - - - diff --git a/src/demos/zdemo_excel16.prog.abap b/src/demos/zdemo_excel16.prog.abap deleted file mode 100644 index 15368b5da..000000000 --- a/src/demos/zdemo_excel16.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel16.prog.xml b/src/demos/zdemo_excel16.prog.xml deleted file mode 100644 index e67de394b..000000000 --- a/src/demos/zdemo_excel16.prog.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - ZDEMO_EXCEL16 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Drawings - 25 - - - S - POBJTYPE - . - 9 - D - - - S - P_CLASS - . - 9 - D - - - S - P_OBJID - . - 9 - D - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel17.prog.abap b/src/demos/zdemo_excel17.prog.abap deleted file mode 100644 index 78faf87e0..000000000 --- a/src/demos/zdemo_excel17.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel17.prog.xml b/src/demos/zdemo_excel17.prog.xml deleted file mode 100644 index 8968a64b9..000000000 --- a/src/demos/zdemo_excel17.prog.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - ZDEMO_EXCEL17 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Sheet Protection - 33 - - - S - P_PATH - . - 24 - D - - - S - P_PWD - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel18.prog.abap b/src/demos/zdemo_excel18.prog.abap deleted file mode 100644 index 4feafa94b..000000000 --- a/src/demos/zdemo_excel18.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel18.prog.xml b/src/demos/zdemo_excel18.prog.xml deleted file mode 100644 index 5a3c58cfd..000000000 --- a/src/demos/zdemo_excel18.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL18 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Book protection - 32 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel19.prog.abap b/src/demos/zdemo_excel19.prog.abap deleted file mode 100644 index 523c6ed83..000000000 --- a/src/demos/zdemo_excel19.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel19.prog.xml b/src/demos/zdemo_excel19.prog.xml deleted file mode 100644 index cadc1bfff..000000000 --- a/src/demos/zdemo_excel19.prog.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - ZDEMO_EXCEL19 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Set active sheet - 33 - - - S - P_NOOUT - Hide output - 19 - - - S - P_PATH - . - 26 - D - - - - - D - - - S - P_NOOUT - Hide output - 19 - - - S - P_PATH - . - 26 - D - - - - - - - diff --git a/src/demos/zdemo_excel2.prog.abap b/src/demos/zdemo_excel2.prog.abap deleted file mode 100644 index f0a1f2d5a..000000000 --- a/src/demos/zdemo_excel2.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel2.prog.xml b/src/demos/zdemo_excel2.prog.xml deleted file mode 100644 index a36144ed9..000000000 --- a/src/demos/zdemo_excel2.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL2 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Styles - 25 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel20.prog.abap b/src/demos/zdemo_excel20.prog.abap deleted file mode 100644 index 255eca35e..000000000 --- a/src/demos/zdemo_excel20.prog.abap +++ /dev/null @@ -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 diff --git a/src/demos/zdemo_excel20.prog.xml b/src/demos/zdemo_excel20.prog.xml deleted file mode 100644 index 15e7cdc01..000000000 --- a/src/demos/zdemo_excel20.prog.xml +++ /dev/null @@ -1,4711 +0,0 @@ - - - - - - ZDEMO_EXCEL20 - 1 - E - X - X - - - - 000010 - 000010 - - - - ALV_STATUS - D - 000004 - 000004 - 0001 - Standard for General List Output - - - - - %ML - 001 - S - Folder - F - - - %PC - 001 - S - ICON_EXPORT - @49@ - Local File... - L - - - %PC - 002 - S - ICON_EXPORT - @49@ - Local file... - L - - - %SC - 001 - S - ICON_SEARCH - @13@ - Find - N - - - %SC+ - 001 - S - ICON_SEARCH_NEXT - @4E@ - Find Next - - - %SC+ - 002 - S - ICON_SEARCH_NEXT - @4E@ - Find next - - - %SL - 001 - S - ICON_MAIL - @1S@ - Mail Recipient - M - - - %SL - 002 - S - ICON_MAIL - @1S@ - Mail recipient - M - - - &ABC - 001 - S - ICON_ABC - @DL@ - ABC Analysis - A - - - &ALL - 001 - S - ICON_SELECT_ALL - @4B@ - Select All - S - - - &ALL - 002 - S - ICON_SELECT_ALL - @4B@ - Select all - S - - - &AQW - 001 - S - ICON_WORD_PROCESSING - @DK@ - Word Processing... - W - - - &AQW - 002 - S - ICON_WORD_PROCESSING - @DK@ - Word processing... - W - - - &AUF - 001 - S - Define Totals Drilldown... - S - - - &AUF - 002 - S - Define Breakdown... - D - - - &AVE - 001 - S - Saving... - S - - - &AVE - 002 - S - ICON_ALV_VARIANT_SAVE - @DN@ - Save Layout... - - - &AVE - 003 - S - ICON_ALV_VARIANT_SAVE - @DN@ - Save layout... - - - &AVR - 001 - S - Mean Value - M - - - &AVR - 002 - S - Mean value - M - - - &CDF - 001 - S - Unfreeze Columns - U - - - &CDF - 002 - S - Unfreeze - U - - - &CFI - 001 - S - Freeze to Column - F - - - &CFI - 002 - S - Freeze to column - F - - - &COUNT - 001 - S - Count - C - - - &CRB - 001 - S - ICON_TOTAL_LEFT - @0B@ - First Column - - - &CRE - 001 - S - ICON_TOTAL_RIGHT - @0C@ - Last Column - - - &CRE - 002 - S - ICON_TOTAL_RIGHT - @0C@ - Last column - - - &CRL - 001 - S - ICON_COLUMN_LEFT - @0D@ - Column Left - - - &CRL - 002 - S - ICON_COLUMN_LEFT - @0D@ - Column left - - - &CRR - 001 - S - ICON_COLUMN_RIGHT - @0E@ - Column Right - - - &CRR - 002 - S - ICON_COLUMN_RIGHT - @0E@ - Column right - - - &DATA_SAVE - 001 - S - ICON_SYSTEM_SAVE - @2L@ - Save - - - &DAU - 001 - S - Automatic Separator - T - - - &DOF - 001 - S - Separator Always Off - E - - - &DON - 001 - S - Separator Always On - R - - - &EB9 - 001 - S - ICON_TABLE_SETTINGS - @36@ - Call Up Report... - B - - - &EB9 - 002 - S - ICON_TABLE_SETTINGS - @36@ - Call Report... - B - - - &EB9 - 003 - S - ICON_TABLE_SETTINGS - @36@ - Call Up Report - C - - - &ELP - 001 - S - ICON_SYSTEM_HELP - @35@ - Help - - - &ERW - 001 - S - Manage... - M - - - &ERW - 002 - S - Layout Management - L - - - &ETA - 001 - S - ICON_SELECT_DETAIL - @16@ - Details - - - &F03 - 001 - S - Back - B - - - &F12 - 001 - S - ICON_CANCEL - @0W@ - Cancel - A - - - &F15 - 001 - S - Exit - X - - - &F4 - 001 - S - Possible Entries - - - &GRAPH - 001 - S - ICON_GRAPHICS - @0N@ - Graphic - G - - - &IC1 - 001 - S - ICON_SELECT_DETAIL - @16@ - Choose - - - &ILD - 001 - S - ICON_FILTER_UNDO - @GD@ - Delete Filter - L - - - &ILD - 002 - S - Delete Filter - L - - - &ILT - 001 - S - ICON_FILTER - @4G@ - Set Filter - F - - - &ILT - 002 - S - ICON_FILTER - @4G@ - Set filter - F - - - &INFO - 001 - S - ICON_INFORMATION - @0S@ - Information - - - &KOM - 001 - S - ICON_COLLAPSE - @3T@ - Choose... - C - - - &LFO - 001 - S - List status... - L - - - &LFO - 002 - S - ICON_INFORMATION - @0S@ - List Status - - - &LFO - 003 - S - ICON_INFORMATION - @0S@ - List status... - - - &LIS - 001 - S - Basic List - B - - - &MAX - 001 - S - Maximum - A - - - &MIN - 001 - S - Minimum - I - - - &NFO - 001 - S - ICON_INFORMATION - @0S@ - Selections... - Selections - E - - - &NTE - 001 - S - ICON_REFRESH - @42@ - Refresh - - - &NTE - 002 - S - Refresh - - - &OAD - 001 - S - Choose... - H - - - &OAD - 002 - S - ICON_ALV_VARIANT_CHOOSE - @DM@ - Select Layout... - - - &OAD - 003 - S - ICON_ALV_VARIANT_CHOOSE - @DM@ - Select layout... - - - &ODN - 001 - S - ICON_SORT_DOWN - @3F@ - Sort in Descending Order - O - - - &ODN - 002 - S - ICON_SORT_DOWN - @3F@ - Sort in descending order - O - - - &OL0 - 001 - S - ICON_ALV_VARIANTS - @LZ@ - Change Layout... - - - &OL0 - 002 - S - ICON_ALV_VARIANTS - @LZ@ - Change layout... - - - &OLX - 001 - S - ICON_VARIANTS - @0R@ - Change... - C - - - &OMP - 001 - S - ICON_COLLAPSE - @3T@ - Collapse - - - &OPT - 001 - S - Optimize Width - P - - - &OPT - 002 - S - Optimize width - P - - - &OUP - 001 - S - ICON_SORT_UP - @3E@ - Sort in Ascending Order - I - - - &REFRESH - 001 - S - ICON_REFRESH - @42@ - Refresh - - - &RNT - 001 - S - ICON_PRINT - @0X@ - Print - P - - - &RNT_PREV - 001 - S - ICON_LAYOUT_CONTROL - @3G@ - Print Preview - R - - - &RNT_PREV - 002 - S - ICON_LAYOUT_CONTROL - @3G@ - Print preview - R - - - &SAL - 001 - S - ICON_DESELECT_ALL - @4D@ - Deselect All - D - - - &SAL - 002 - S - ICON_DESELECT_ALL - @4D@ - Deselect all - D - - - &SUM - 001 - S - ICON_INTERMEDIATE_SUM - @5V@ - Subtotals... - T - - - &UMC - 001 - S - ICON_SUM - @3Z@ - Total - T - - - &VEXCEL - 001 - S - ICON_XLS - @J2@ - Microsoft Excel - M - - - &VGRID - 001 - S - SAP List Viewer - S - - - &VLOTUS - 001 - S - Lotus 1-2-3 - L - - - &XINT - 001 - S - Additional Functions of SAP Query - E - - - &XML - 001 - S - XML Export - X - - - &XML - 002 - S - XML Export... - X - - - &XPA - 001 - S - ICON_EXPAND - @3S@ - Expand - - - &XXL - 001 - S - ICON_XXL - @DJ@ - Spreadsheet... - A - - - EXCEL - 001 - S - ICON_XLV - @J3@ - Excel - Export to Excel - - - P+ - 001 - S - Next Page - - - P+ - 002 - S - Next page - - - P++ - 001 - S - Last Page - - - P- - 001 - S - Previous Page - - - P-- - 001 - S - First Page - - - - - 000001 - 01 - F - &RNT_PREV - 001 - - - 000001 - 02 - F - &RNT - 001 - - - 000001 - 03 - S - - - 000001 - 04 - M - 000002 - - - 000001 - 05 - M - 000003 - - - 000001 - 06 - S - - - 000001 - 07 - F - &F15 - 001 - - - 000002 - 01 - F - &AQW - 001 - - - 000002 - 02 - F - &XXL - 001 - - - 000002 - 03 - F - %PC - 001 - - - 000002 - 04 - F - &XINT - 001 - - - 000003 - 01 - F - %SL - 001 - - - 000003 - 02 - F - %ML - 001 - - - 000004 - 01 - F - &ALL - 001 - - - 000004 - 02 - F - &SAL - 001 - - - 000004 - 03 - S - - - 000004 - 04 - F - &ILT - 001 - - - 000004 - 05 - F - &ILD - 001 - - - 000004 - 06 - S - - - 000004 - 07 - F - &OUP - 001 - - - 000004 - 08 - F - &ODN - 001 - - - 000004 - 09 - S - - - 000004 - 10 - M - 000005 - - - 000004 - 11 - F - &SUM - 001 - - - 000004 - 12 - S - - - 000004 - 13 - F - %SC - 001 - - - 000004 - 14 - S - - - 000004 - 15 - F - &F12 - 001 - - - 000005 - 01 - F - &UMC - 001 - - - 000005 - 02 - F - &AVR - 001 - - - 000005 - 03 - F - &MIN - 001 - - - 000005 - 04 - F - &MAX - 001 - - - 000005 - 05 - F - &COUNT - 001 - - - 000006 - 01 - F - &ABC - 001 - - - 000006 - 02 - S - - - 000006 - 03 - F - &F03 - 001 - - - 000007 - 01 - F - &VGRID - 001 - - - 000007 - 02 - F - &VEXCEL - 001 - - - 000007 - 03 - F - &VLOTUS - 001 - - - 000007 - 04 - S - - - 000007 - 05 - F - &GRAPH - 001 - - - 000008 - 01 - M - 000009 - - - 000008 - 02 - M - 000010 - - - 000008 - 03 - F - &AUF - 001 - - - 000009 - 01 - F - &OLX - 001 - - - 000009 - 02 - F - &OAD - 001 - - - 000009 - 03 - S - - - 000009 - 04 - F - &AVE - 001 - - - 000009 - 05 - S - - - 000009 - 06 - F - &ERW - 001 - - - 000010 - 01 - F - &OPT - 001 - - - 000010 - 02 - S - - - 000010 - 03 - F - &CFI - 001 - - - 000010 - 04 - F - &CDF - 001 - - - 000011 - 01 - F - &RNT - 001 - - - 000011 - 02 - M - 000012 - - - 000011 - 03 - M - 000013 - - - 000011 - 04 - S - - - 000011 - 05 - F - &F15 - 001 - - - 000012 - 01 - F - &AQW - 001 - - - 000012 - 02 - F - &XXL - 001 - - - 000012 - 03 - F - %PC - 001 - - - 000012 - 04 - F - &XINT - 001 - - - 000012 - 05 - F - &XML - 001 - - - 000013 - 01 - F - %SL - 001 - - - 000013 - 02 - F - %ML - 001 - - - 000014 - 01 - F - &ALL - 001 - - - 000014 - 02 - F - &SAL - 001 - - - 000014 - 03 - S - - - 000014 - 04 - F - &ILT - 001 - - - 000014 - 05 - F - &ILD - 002 - - - 000014 - 06 - S - - - 000014 - 07 - F - &OUP - 001 - - - 000014 - 08 - F - &ODN - 001 - - - 000014 - 09 - S - - - 000014 - 10 - M - 000015 - - - 000014 - 11 - F - &SUM - 001 - - - 000014 - 12 - S - - - 000014 - 13 - F - %SC - 001 - - - 000014 - 14 - S - - - 000014 - 15 - F - &F12 - 001 - - - 000015 - 01 - F - &UMC - 001 - - - 000015 - 02 - F - &AVR - 001 - - - 000015 - 03 - F - &MIN - 001 - - - 000015 - 04 - F - &MAX - 001 - - - 000015 - 05 - F - &COUNT - 001 - - - 000016 - 01 - F - &ABC - 001 - - - 000016 - 02 - S - - - 000016 - 03 - F - &F03 - 001 - - - 000017 - 01 - F - &LIS - 001 - - - 000017 - 02 - S - - - 000017 - 03 - M - 000018 - - - 000017 - 04 - S - - - 000017 - 05 - M - 000019 - - - 000017 - 06 - S - - - 000017 - 07 - M - 000020 - - - 000017 - 08 - S - - - 000017 - 09 - F - &NFO - 001 - - - 000017 - 10 - F - &LFO - 001 - - - 000018 - 01 - F - &OLX - 001 - - - 000018 - 02 - F - &OAD - 001 - - - 000018 - 03 - S - - - 000018 - 04 - F - &AVE - 001 - - - 000018 - 05 - S - - - 000018 - 06 - F - &ERW - 001 - - - 000019 - 01 - F - &KOM - 001 - - - 000019 - 02 - F - &AUF - 002 - - - 000020 - 01 - F - &OPT - 001 - - - 000020 - 02 - S - - - 000020 - 03 - F - &CFI - 001 - - - 000020 - 04 - F - &CDF - 002 - - - 000020 - 05 - S - - - 000020 - 06 - F - &DAU - 001 - - - 000020 - 07 - F - &DON - 001 - - - 000020 - 08 - F - &DOF - 001 - - - 000021 - 01 - F - &RNT_PREV - 001 - - - 000021 - 02 - F - &RNT - 001 - - - 000021 - 03 - S - - - 000021 - 04 - M - 000022 - - - 000021 - 05 - M - 000023 - - - 000021 - 06 - S - - - 000021 - 07 - F - &F15 - 001 - - - 000022 - 01 - F - &AQW - 001 - - - 000022 - 02 - F - &XXL - 001 - - - 000022 - 03 - F - %PC - 001 - - - 000022 - 04 - F - &XINT - 001 - - - 000023 - 01 - F - %SL - 001 - - - 000023 - 02 - F - %ML - 001 - - - 000024 - 01 - F - &ALL - 001 - - - 000024 - 02 - F - &SAL - 001 - - - 000024 - 03 - S - - - 000024 - 04 - F - &ILT - 001 - - - 000024 - 05 - F - &ILD - 001 - - - 000024 - 06 - S - - - 000024 - 07 - F - &OUP - 001 - - - 000024 - 08 - F - &ODN - 001 - - - 000024 - 09 - S - - - 000024 - 10 - M - 000025 - - - 000024 - 11 - F - &SUM - 001 - - - 000024 - 12 - S - - - 000024 - 13 - F - %SC - 001 - - - 000024 - 14 - S - - - 000024 - 15 - F - &F12 - 001 - - - 000025 - 01 - F - &UMC - 001 - - - 000025 - 02 - F - &AVR - 001 - - - 000025 - 03 - F - &MIN - 001 - - - 000025 - 04 - F - &MAX - 001 - - - 000025 - 05 - F - &COUNT - 001 - - - 000026 - 01 - F - &ABC - 001 - - - 000026 - 02 - S - - - 000026 - 03 - F - &F03 - 001 - - - 000027 - 01 - F - &VGRID - 001 - - - 000027 - 02 - F - &VEXCEL - 001 - - - 000027 - 03 - F - &VLOTUS - 001 - - - 000027 - 04 - S - - - 000027 - 05 - F - &GRAPH - 001 - - - 000028 - 01 - M - 000029 - - - 000028 - 02 - M - 000030 - - - 000028 - 03 - F - &AUF - 001 - - - 000029 - 01 - F - &OLX - 001 - - - 000029 - 02 - F - &OAD - 001 - - - 000029 - 03 - S - - - 000029 - 04 - F - &AVE - 001 - - - 000029 - 05 - S - - - 000029 - 06 - F - &ERW - 001 - - - 000030 - 01 - F - &OPT - 001 - - - 000030 - 02 - S - - - 000030 - 03 - F - &CFI - 001 - - - 000030 - 04 - F - &CDF - 001 - - - 000031 - 01 - F - &RNT - 001 - - - 000031 - 02 - M - 000032 - - - 000031 - 03 - M - 000033 - - - 000031 - 04 - S - - - 000031 - 05 - F - &F15 - 001 - - - 000032 - 01 - F - &AQW - 002 - - - 000032 - 02 - F - &XXL - 001 - - - 000032 - 03 - F - %PC - 002 - - - 000032 - 04 - F - &XINT - 001 - - - 000033 - 01 - F - %SL - 002 - - - 000033 - 02 - F - %ML - 001 - - - 000034 - 01 - F - &ALL - 002 - - - 000034 - 02 - F - &SAL - 002 - - - 000034 - 03 - S - - - 000034 - 04 - F - &ILT - 002 - - - 000034 - 05 - F - &ILD - 001 - - - 000034 - 06 - S - - - 000034 - 07 - F - &OUP - 001 - - - 000034 - 08 - F - &ODN - 002 - - - 000034 - 09 - S - - - 000034 - 10 - M - 000035 - - - 000034 - 11 - F - &SUM - 001 - - - 000034 - 12 - S - - - 000034 - 13 - F - %SC - 001 - - - 000034 - 14 - S - - - 000034 - 15 - F - &F12 - 001 - - - 000035 - 01 - F - &UMC - 001 - - - 000035 - 02 - F - &AVR - 002 - - - 000035 - 03 - F - &MIN - 001 - - - 000035 - 04 - F - &MAX - 001 - - - 000035 - 05 - F - &COUNT - 001 - - - 000036 - 01 - F - &ABC - 001 - - - 000036 - 02 - S - - - 000036 - 03 - F - &F03 - 001 - - - 000037 - 01 - F - &LIS - 001 - - - 000037 - 02 - S - - - 000037 - 03 - M - 000038 - - - 000037 - 04 - S - - - 000037 - 05 - M - 000039 - - - 000037 - 06 - S - - - 000037 - 07 - M - 000040 - - - 000037 - 08 - S - - - 000037 - 09 - F - &NFO - 001 - - - 000037 - 10 - F - &LFO - 001 - - - 000038 - 01 - F - &OLX - 001 - - - 000038 - 02 - F - &OAD - 001 - - - 000038 - 03 - S - - - 000038 - 04 - F - &AVE - 001 - - - 000038 - 05 - S - - - 000038 - 06 - F - &ERW - 002 - - - 000039 - 01 - F - &KOM - 001 - - - 000039 - 02 - F - &AUF - 002 - - - 000040 - 01 - F - &OPT - 002 - - - 000040 - 02 - S - - - 000040 - 03 - F - &CFI - 002 - - - 000040 - 04 - F - &CDF - 002 - - - 000040 - 05 - S - - - 000040 - 06 - F - &DAU - 001 - - - 000040 - 07 - F - &DON - 001 - - - 000040 - 08 - F - &DOF - 001 - - - - - 000001 - S - List - L - STANDARD_FULLSCREEN List - - - 000002 - S - Export - E - STANDARD Save - - - 000003 - S - Send To - S - - - 000004 - S - Edit - E - STANDARD - - - 000005 - S - Calculate - C - - - 000006 - S - Goto - G - STANDARD - - - 000007 - S - Views - I - - - 000008 - S - Settings - S - STANDARD_FULLSCREEN - - - 000009 - S - Layout - A - Sub STANDARD - - - 000010 - S - Columns - C - - - 000011 - S - List - L - STANDARD List - - - 000012 - S - Export - E - STANDARD Save - - - 000013 - S - Send To - S - - - 000014 - S - Edit - E - STANDARD - - - 000015 - S - Calculate - C - - - 000016 - S - Goto - G - STANDARD - - - 000017 - S - Settings - S - STANDARD - - - 000018 - S - Layout - A - Sub STANDARD - - - 000019 - S - Summation Levels - S - Sub STANDARD - - - 000020 - S - Columns - C - - - 000021 - S - List - L - STANDARD_FULLSCREEN List - - - 000022 - S - Export - E - STANDARD Save - - - 000023 - S - Send To - S - - - 000024 - S - Edit - E - STANDARD - - - 000025 - S - Calculate - C - - - 000026 - S - Goto - G - STANDARD - - - 000027 - S - Views - I - - - 000028 - S - Settings - S - STANDARD_FULLSCREEN - - - 000029 - S - Layout - A - Sub STANDARD - - - 000030 - S - Columns - C - - - 000031 - S - List - L - STANDARD List - - - 000032 - S - Export - E - STANDARD Save - - - 000033 - S - Send to - S - - - 000034 - S - Edit - E - STANDARD - - - 000035 - S - Calculate - C - - - 000036 - S - Goto - G - STANDARD - - - 000037 - S - Settings - S - STANDARD - - - 000038 - S - Layout - A - Sub STANDARD - - - 000039 - S - Summation levels - S - Sub STANDARD - - - 000040 - S - Columns - C - - - - - 000001 - 01 - 000001 - - - 000001 - 02 - 000004 - - - 000001 - 03 - 000006 - - - 000001 - 04 - 000007 - - - 000001 - 05 - 000008 - - - 000002 - 01 - 000011 - - - 000002 - 02 - 000014 - - - 000002 - 03 - 000016 - - - 000002 - 04 - 000017 - - - 000003 - 01 - 000021 - - - 000003 - 02 - 000024 - - - 000003 - 03 - 000026 - - - 000003 - 04 - 000027 - - - 000003 - 05 - 000028 - - - 000004 - 01 - 000031 - - - 000004 - 02 - 000034 - - - 000004 - 03 - 000036 - - - 000004 - 04 - 000037 - - - - - 000001 - 0001 - 01 - 39 - - - 000001 - 0001 - 02 - 37 - - - 000001 - 0001 - 03 - 08 - - - 000001 - 0001 - 04 - 05 - - - 000001 - 0001 - 05 - 06 - - - 000001 - 0001 - 06 - 28 - - - 000001 - 0001 - 07 - 40 - - - 000001 - 0001 - 08 - 29 - - - 000001 - 0001 - 09 - 38 - - - 000001 - 0001 - 10 - 30 - - - 000001 - 0001 - 11 - 46 - - - 000001 - 0001 - 12 - 43 - - - 000001 - 0001 - 13 - 44 - - - 000001 - 0001 - 14 - 45 - - - 000001 - 0001 - 15 - 31 - - - 000001 - 0001 - 16 - 25 - - - 000001 - 0001 - 17 - 47 - - - 000001 - 0001 - 18 - 32 - - - 000001 - 0001 - 19 - 33 - - - 000001 - 0001 - 20 - 34 - - - 000001 - 0001 - 21 - 36 - - - 000001 - 0001 - 22 - 13 - - - 000002 - 0001 - 01 - 39 - - - 000002 - 0001 - 02 - 37 - - - 000002 - 0001 - 03 - S - - - 000002 - 0001 - 04 - 05 - - - 000002 - 0001 - 05 - 06 - - - 000002 - 0001 - 06 - S - - - 000002 - 0001 - 07 - 28 - - - 000002 - 0001 - 08 - 40 - - - 000002 - 0001 - 09 - 29 - - - 000002 - 0001 - 10 - S - - - 000002 - 0001 - 11 - 30 - - - 000002 - 0001 - 12 - 42 - - - 000002 - 0001 - 13 - 35 - - - 000002 - 0001 - 14 - 47 - - - 000002 - 0001 - 15 - S - - - 000002 - 0001 - 16 - 43 - - - 000002 - 0001 - 17 - 44 - - - 000002 - 0001 - 18 - 45 - - - 000002 - 0001 - 19 - 31 - - - 000002 - 0001 - 20 - 25 - - - 000002 - 0001 - 21 - S - - - 000002 - 0001 - 22 - 32 - - - 000002 - 0001 - 23 - 33 - - - 000002 - 0001 - 24 - 34 - - - 000002 - 0001 - 25 - S - - - 000002 - 0001 - 26 - 41 - - - 000002 - 0001 - 27 - 07 - - - 000002 - 0001 - 28 - S - - - 000002 - 0001 - 29 - 18 - - - 000002 - 0001 - 30 - 26 - - - 000002 - 0001 - 31 - 27 - - - 000002 - 0001 - 32 - 19 - - - 000003 - 0001 - 01 - 39 - - - 000003 - 0001 - 02 - 37 - - - 000003 - 0001 - 03 - 08 - - - 000003 - 0001 - 04 - 05 - - - 000003 - 0001 - 05 - 06 - - - 000003 - 0001 - 06 - 28 - - - 000003 - 0001 - 07 - 40 - - - 000003 - 0001 - 08 - 29 - - - 000003 - 0001 - 09 - 38 - - - 000003 - 0001 - 10 - 30 - - - 000003 - 0001 - 11 - 46 - - - 000003 - 0001 - 12 - 43 - - - 000003 - 0001 - 13 - 44 - - - 000003 - 0001 - 14 - 45 - - - 000003 - 0001 - 15 - 31 - - - 000003 - 0001 - 16 - 25 - - - 000003 - 0001 - 17 - 47 - - - 000003 - 0001 - 18 - 32 - - - 000003 - 0001 - 19 - 33 - - - 000003 - 0001 - 20 - 34 - - - 000003 - 0001 - 21 - 36 - - - 000003 - 0001 - 22 - 13 - - - 000004 - 0001 - 01 - 39 - - - 000004 - 0001 - 02 - 37 - - - 000004 - 0001 - 03 - S - - - 000004 - 0001 - 04 - 05 - - - 000004 - 0001 - 05 - 06 - - - 000004 - 0001 - 06 - S - - - 000004 - 0001 - 07 - 28 - - - 000004 - 0001 - 08 - 40 - - - 000004 - 0001 - 09 - 29 - - - 000004 - 0001 - 10 - 38 - - - 000004 - 0001 - 11 - S - - - 000004 - 0001 - 12 - 30 - - - 000004 - 0001 - 13 - 42 - - - 000004 - 0001 - 14 - S - - - 000004 - 0001 - 15 - 45 - - - 000004 - 0001 - 16 - S - - - 000004 - 0001 - 17 - 32 - - - 000004 - 0001 - 18 - 33 - - - 000004 - 0001 - 19 - 34 - - - 000004 - 0001 - 20 - 09 - - - 000004 - 0001 - 21 - S - - - 000004 - 0001 - 22 - 41 - - - 000004 - 0001 - 23 - 07 - - - 000004 - 0001 - 24 - S - - - 000004 - 0001 - 25 - 18 - - - 000004 - 0001 - 26 - 26 - - - 000004 - 0001 - 27 - 27 - - - 000004 - 0001 - 28 - 19 - - - - - 000001 - 01 - &ELP - 001 - - - 000001 - 02 - &IC1 - 001 - - - 000001 - 03 - &F03 - 001 - - - 000001 - 04 - &F4 - 001 - - - 000001 - 05 - &ALL - 001 - - - 000001 - 06 - &SAL - 001 - - - 000001 - 08 - &REFRESH - 001 - - - 000001 - 11 - &DATA_SAVE - 001 - - - 000001 - 12 - &F12 - 001 - - - 000001 - 13 - EXCEL - 001 - - - 000001 - 15 - &F15 - 001 - - - 000001 - 25 - &ABC - 001 - - - 000001 - 28 - &OUP - 001 - - - 000001 - 29 - &ILT - 001 - - - 000001 - 30 - &UMC - 001 - - - 000001 - 31 - %SL - 001 - - - 000001 - 32 - &OL0 - 001 - - - 000001 - 33 - &OAD - 002 - - - 000001 - 34 - &AVE - 002 - - - 000001 - 36 - &INFO - 001 - - - 000001 - 37 - &EB9 - 001 - - - 000001 - 38 - &ILD - 001 - - - 000001 - 39 - &ETA - 001 - - - 000001 - 40 - &ODN - 001 - - - 000001 - 42 - &SUM - 001 - - - 000001 - 43 - &XXL - 001 - - - 000001 - 44 - &AQW - 001 - - - 000001 - 45 - %PC - 001 - - - 000001 - 46 - &RNT_PREV - 001 - - - 000001 - 47 - &GRAPH - 001 - - - 000001 - 71 - %SC - 001 - - - 000001 - 84 - %SC+ - 001 - - - 000001 - 86 - &RNT - 001 - - - 000002 - 01 - &ELP - 001 - - - 000002 - 02 - &IC1 - 001 - - - 000002 - 03 - &F03 - 001 - - - 000002 - 05 - &ALL - 001 - - - 000002 - 06 - &SAL - 001 - - - 000002 - 07 - &NFO - 001 - - - 000002 - 08 - &NTE - 001 - - - 000002 - 12 - &F12 - 001 - - - 000002 - 15 - &F15 - 001 - - - 000002 - 18 - &CRB - 001 - - - 000002 - 19 - &CRE - 001 - - - 000002 - 21 - P-- - 001 - - - 000002 - 22 - P- - 001 - - - 000002 - 23 - P+ - 001 - - - 000002 - 24 - P++ - 001 - - - 000002 - 25 - &ABC - 001 - - - 000002 - 26 - &CRL - 001 - - - 000002 - 27 - &CRR - 001 - - - 000002 - 28 - &OUP - 001 - - - 000002 - 29 - &ILT - 001 - - - 000002 - 30 - &UMC - 001 - - - 000002 - 31 - %SL - 001 - - - 000002 - 32 - &OL0 - 001 - - - 000002 - 33 - &OAD - 002 - - - 000002 - 34 - &AVE - 002 - - - 000002 - 35 - &XPA - 001 - - - 000002 - 37 - &EB9 - 002 - - - 000002 - 39 - &ETA - 001 - - - 000002 - 40 - &ODN - 001 - - - 000002 - 41 - &LFO - 002 - - - 000002 - 42 - &SUM - 001 - - - 000002 - 43 - &XXL - 001 - - - 000002 - 44 - &AQW - 001 - - - 000002 - 45 - %PC - 001 - - - 000002 - 46 - &RNT_PREV - 001 - - - 000002 - 47 - &OMP - 001 - - - 000002 - 48 - &XML - 001 - - - 000002 - 71 - %SC - 001 - - - 000002 - 80 - P-- - 001 - - - 000002 - 81 - P- - 001 - - - 000002 - 82 - P+ - 001 - - - 000002 - 83 - P++ - 001 - - - 000002 - 84 - %SC+ - 001 - - - 000002 - 86 - &RNT - 001 - - - 000003 - 01 - &ELP - 001 - - - 000003 - 02 - &IC1 - 001 - - - 000003 - 03 - &F03 - 001 - - - 000003 - 04 - &F4 - 001 - - - 000003 - 05 - &ALL - 001 - - - 000003 - 06 - &SAL - 001 - - - 000003 - 08 - &REFRESH - 001 - - - 000003 - 11 - &DATA_SAVE - 001 - - - 000003 - 12 - &F12 - 001 - - - 000003 - 13 - EXCEL - 001 - - - 000003 - 15 - &F15 - 001 - - - 000003 - 25 - &ABC - 001 - - - 000003 - 28 - &OUP - 001 - - - 000003 - 29 - &ILT - 001 - - - 000003 - 30 - &UMC - 001 - - - 000003 - 31 - %SL - 001 - - - 000003 - 32 - &OL0 - 001 - - - 000003 - 33 - &OAD - 002 - - - 000003 - 34 - &AVE - 002 - - - 000003 - 36 - &INFO - 001 - - - 000003 - 37 - &EB9 - 001 - - - 000003 - 38 - &ILD - 001 - - - 000003 - 39 - &ETA - 001 - - - 000003 - 40 - &ODN - 001 - - - 000003 - 42 - &SUM - 001 - - - 000003 - 43 - &XXL - 001 - - - 000003 - 44 - &AQW - 001 - - - 000003 - 45 - %PC - 001 - - - 000003 - 46 - &RNT_PREV - 001 - - - 000003 - 47 - &GRAPH - 001 - - - 000003 - 71 - %SC - 001 - - - 000003 - 84 - %SC+ - 001 - - - 000003 - 86 - &RNT - 001 - - - 000004 - 01 - &ELP - 001 - - - 000004 - 02 - &IC1 - 001 - - - 000004 - 03 - &F03 - 001 - - - 000004 - 05 - &ALL - 002 - - - 000004 - 06 - &SAL - 002 - - - 000004 - 07 - &NFO - 001 - - - 000004 - 08 - &NTE - 002 - - - 000004 - 09 - EXCEL - 001 - - - 000004 - 12 - &F12 - 001 - - - 000004 - 15 - &F15 - 001 - - - 000004 - 18 - &CRB - 001 - - - 000004 - 19 - &CRE - 002 - - - 000004 - 21 - P-- - 001 - - - 000004 - 22 - P- - 001 - - - 000004 - 23 - P+ - 002 - - - 000004 - 24 - P++ - 001 - - - 000004 - 25 - &ABC - 001 - - - 000004 - 26 - &CRL - 002 - - - 000004 - 27 - &CRR - 002 - - - 000004 - 28 - &OUP - 001 - - - 000004 - 29 - &ILT - 002 - - - 000004 - 30 - &UMC - 001 - - - 000004 - 31 - %SL - 002 - - - 000004 - 32 - &OL0 - 002 - - - 000004 - 33 - &OAD - 003 - - - 000004 - 34 - &AVE - 003 - - - 000004 - 35 - &XPA - 001 - - - 000004 - 37 - &EB9 - 003 - - - 000004 - 38 - &ILD - 001 - - - 000004 - 39 - &ETA - 001 - - - 000004 - 40 - &ODN - 002 - - - 000004 - 41 - &LFO - 003 - - - 000004 - 42 - &SUM - 001 - - - 000004 - 43 - &XXL - 001 - - - 000004 - 44 - &AQW - 002 - - - 000004 - 45 - %PC - 002 - - - 000004 - 46 - &RNT_PREV - 002 - - - 000004 - 47 - &OMP - 001 - - - 000004 - 48 - &XML - 002 - - - 000004 - 71 - %SC - 001 - - - 000004 - 80 - P-- - 001 - - - 000004 - 81 - P- - 001 - - - 000004 - 82 - P+ - 002 - - - 000004 - 83 - P++ - 001 - - - 000004 - 84 - %SC+ - 002 - - - 000004 - 86 - &RNT - 001 - - - - - ALV_STATUS - %CH - - - ALV_STATUS - %ML - - - ALV_STATUS - %PC - - - ALV_STATUS - %SC - - - ALV_STATUS - %SC+ - - - ALV_STATUS - %SL - - - ALV_STATUS - &ABC - - - ALV_STATUS - &ALL - - - ALV_STATUS - &AQW - - - ALV_STATUS - &AUF - - - ALV_STATUS - &AVE - - - ALV_STATUS - &AVR - - - ALV_STATUS - &BS - - - ALV_STATUS - &BS+ - - - ALV_STATUS - &BS- - - - ALV_STATUS - &CDF - - - ALV_STATUS - &CFI - - - ALV_STATUS - &COUNT - - - ALV_STATUS - &CRB - - - ALV_STATUS - &CRE - - - ALV_STATUS - &CRL - - - ALV_STATUS - &CRR - - - ALV_STATUS - &DAU - - - ALV_STATUS - &DOF - - - ALV_STATUS - &DON - - - ALV_STATUS - &EB3 - - - ALV_STATUS - &EB9 - - - ALV_STATUS - &ELP - - - ALV_STATUS - &ERW - - - ALV_STATUS - &ETA - - - ALV_STATUS - &F03 - - - ALV_STATUS - &F12 - - - ALV_STATUS - &F15 - - - ALV_STATUS - &IC1 - - - ALV_STATUS - &ILD - - - ALV_STATUS - &ILT - - - ALV_STATUS - &KOM - - - ALV_STATUS - &LFO - - - ALV_STATUS - &LIS - - - ALV_STATUS - &MAX - - - ALV_STATUS - &MIN - - - ALV_STATUS - &NFO - - - ALV_STATUS - &NTE - - - ALV_STATUS - &OAD - - - ALV_STATUS - &ODN - - - ALV_STATUS - &OL0 - - - ALV_STATUS - &OL1 - - - ALV_STATUS - &OLX - - - ALV_STATUS - &OMP - - - ALV_STATUS - &OPT - - - ALV_STATUS - &OUP - - - ALV_STATUS - &RNT - - - ALV_STATUS - &SAL - - - ALV_STATUS - &SUM - - - ALV_STATUS - &UMC - - - ALV_STATUS - &XML - - - ALV_STATUS - &XPA - - - ALV_STATUS - &XXL - - - ALV_STATUS - BAC1 - - - ALV_STATUS - BACK - - - ALV_STATUS - BEB1 - - - ALV_STATUS - BEB2 - - - ALV_STATUS - BEB3 - - - ALV_STATUS - BEB9 - - - ALV_STATUS - BEBN - - - ALV_STATUS - COL0 - - - ALV_STATUS - COLX - - - ALV_STATUS - DETA - - - ALV_STATUS - DRUK - - - ALV_STATUS - DSAL - - - ALV_STATUS - ENTE - - - ALV_STATUS - EXCEL - - - ALV_STATUS - EXIT - - - ALV_STATUS - EXPA - - - ALV_STATUS - FILD - - - ALV_STATUS - FILT - - - ALV_STATUS - GLIS - - - ALV_STATUS - HELP - - - ALV_STATUS - INFO - - - ALV_STATUS - KOMP - - - ALV_STATUS - P+ - - - ALV_STATUS - P++ - - - ALV_STATUS - P- - - - ALV_STATUS - P-- - - - ALV_STATUS - PF09 - - - ALV_STATUS - PF13 - - - ALV_STATUS - PIC1 - - - ALV_STATUS - PICK - - - ALV_STATUS - PRI - - - ALV_STATUS - PRIN - - - ALV_STATUS - PRNT - - - ALV_STATUS - RW - - - ALV_STATUS - SALL - - - ALV_STATUS - SAUF - - - ALV_STATUS - SAVE - - - ALV_STATUS - SCRB - - - ALV_STATUS - SCRE - - - ALV_STATUS - SCRL - - - ALV_STATUS - SCRR - - - ALV_STATUS - SKOM - - - ALV_STATUS - SODN - - - ALV_STATUS - SOUP - - - ALV_STATUS - SUMC - - - ALV_STATUS - ZSUM - - - - - A - 000001 - D - Standard Interface STANDARD_FULLSCREEN - - - P - 000001 - D - X - Standard Maximum Interaction STANDARD_FULLSCREEN - - - B - 000001 - 0001 - STANDARD_FULLSCREEN - - - A - 000002 - D - Standard User Interface STANDARD - - - P - 000002 - D - X - Standard Maximum Interaction - - - B - 000002 - 0001 - D - Standard Maximum Interaction - - - A - 000003 - D - Standard Interface STANDARD_FULLSCREEN - - - P - 000003 - D - X - Standard Maximum Interaction STANDARD_FULLSCREEN - - - B - 000003 - 0001 - STANDARD_FULLSCREEN - - - A - 000004 - D - Standard User Interface STANDARD - - - P - 000004 - D - X - Standard Maximum Interaction - - - B - 000004 - 0001 - D - X - Standard Maximum Interaction - - - - - - R - abap2xlsx Demo: Bind ALV OLE2 - 29 - - - - - diff --git a/src/demos/zdemo_excel21.prog.abap b/src/demos/zdemo_excel21.prog.abap deleted file mode 100644 index 7cebcd91f..000000000 --- a/src/demos/zdemo_excel21.prog.abap +++ /dev/null @@ -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: 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 . - 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 = color. - -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 . - 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 - ip_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. - -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 = -style ). - - ADD 1 TO column. - ENDDO. - ADD '0.1' TO tint. - ADD 1 TO row. - ENDDO. - - - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel21.prog.xml b/src/demos/zdemo_excel21.prog.xml deleted file mode 100644 index ab72a9052..000000000 --- a/src/demos/zdemo_excel21.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL21 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: - 15 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel22.prog.abap b/src/demos/zdemo_excel22.prog.abap deleted file mode 100644 index d54fbf153..000000000 --- a/src/demos/zdemo_excel22.prog.abap +++ /dev/null @@ -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: 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 . - CASE -fieldname. - WHEN 'CARRID'. - -position = 3. - -dynpfld = abap_true. - -style = lo_style->get_guid( ). - WHEN 'CONNID'. - -position = 1. - -dynpfld = abap_true. - -style = lo_style->get_guid( ). - -scrtext_m = |Flight\r\nNumber|. " Demonstrates header on 2 lines - WHEN 'FLDATE'. - -position = 2. - -dynpfld = abap_true. - -style = lo_style_date->get_guid( ). - WHEN 'PRICE'. - -position = 4. - -dynpfld = abap_true. - -style = lo_style_editable->get_guid( ). - -totals_function = zcl_excel_table=>totals_function_sum. - WHEN OTHERS. - -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: 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_comp = lv_comp + 1. - ENDLOOP. - APPEND ls_test TO ct_test. - ENDLOOP. -ENDFORM. diff --git a/src/demos/zdemo_excel22.prog.xml b/src/demos/zdemo_excel22.prog.xml deleted file mode 100644 index 30cbc8ca7..000000000 --- a/src/demos/zdemo_excel22.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL22 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Export internal table - 38 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel23.prog.abap b/src/demos/zdemo_excel23.prog.abap deleted file mode 100644 index 9716d620c..000000000 --- a/src/demos/zdemo_excel23.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel23.prog.xml b/src/demos/zdemo_excel23.prog.xml deleted file mode 100644 index 0ee77472d..000000000 --- a/src/demos/zdemo_excel23.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL23 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Multiple sheets with and w/o grid lines, print options - 70 - - - - - diff --git a/src/demos/zdemo_excel24.prog.abap b/src/demos/zdemo_excel24.prog.abap deleted file mode 100644 index 2bdee7f7c..000000000 --- a/src/demos/zdemo_excel24.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel24.prog.xml b/src/demos/zdemo_excel24.prog.xml deleted file mode 100644 index 48326ff37..000000000 --- a/src/demos/zdemo_excel24.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL24 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Multiple sheets with different default date formats - 70 - - - - - diff --git a/src/demos/zdemo_excel25.prog.abap b/src/demos/zdemo_excel25.prog.abap deleted file mode 100644 index e6677815e..000000000 --- a/src/demos/zdemo_excel25.prog.abap +++ /dev/null @@ -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. diff --git a/src/demos/zdemo_excel25.prog.xml b/src/demos/zdemo_excel25.prog.xml deleted file mode 100644 index 708b1e384..000000000 --- a/src/demos/zdemo_excel25.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL25 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Write Hello World using Logical Path on the App Server - 70 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel26.prog.abap b/src/demos/zdemo_excel26.prog.abap deleted file mode 100644 index 2b830e94a..000000000 --- a/src/demos/zdemo_excel26.prog.abap +++ /dev/null @@ -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 diff --git a/src/demos/zdemo_excel26.prog.xml b/src/demos/zdemo_excel26.prog.xml deleted file mode 100644 index a1772c249..000000000 --- a/src/demos/zdemo_excel26.prog.xml +++ /dev/null @@ -1,991 +0,0 @@ - - - - - - ZDEMO_EXCEL26 - 1 - T - E - X - X - - - - 000010 - 000010 - - - - ALV_STATUS - D - 000001 - 000001 - 0001 - Standard for General List Output - - - - - %PC - 001 - S - ICON_EXPORT - @49@ - Local file... - - - %SC - 001 - S - ICON_SEARCH - @13@ - Find - - - %SC+ - 001 - S - ICON_SEARCH_NEXT - @4E@ - Find next - - - %SL - 001 - S - Mail recipient - - - &ABC - 001 - S - ABC Analysis - - - &ALL - 001 - S - ICON_SELECT_ALL - @4B@ - Select all - - - &AQW - 001 - S - Word processing... - - - &AVE - 001 - S - ICON_ALV_VARIANT_SAVE - @DN@ - Save layout... - - - &CRB - 001 - S - ICON_TOTAL_LEFT - @0B@ - First Column - - - &CRE - 001 - S - ICON_TOTAL_RIGHT - @0C@ - Last column - - - &CRL - 001 - S - ICON_COLUMN_LEFT - @0D@ - Column left - - - &CRR - 001 - S - ICON_COLUMN_RIGHT - @0E@ - Column right - - - &EB9 - 001 - S - ICON_TABLE_SETTINGS - @36@ - Call Up Report - - - &ETA - 001 - S - ICON_SELECT_DETAIL - @16@ - Details - - - &F03 - 001 - S - Back - - - &F12 - 001 - S - ICON_CANCEL - @0W@ - Cancel - - - &F15 - 001 - S - Exit - - - &IC1 - 001 - S - ICON_SELECT_DETAIL - @16@ - Choose - S - - - &ILD - 001 - S - ICON_FILTER_UNDO - @GD@ - Delete Filter - - - &ILT - 001 - S - ICON_FILTER - @4G@ - Set filter - - - &LFO - 001 - S - ICON_INFORMATION - @0S@ - List status... - - - &NFO - 001 - S - ICON_INFORMATION - @0S@ - Selections... - Selections - - - &NTE - 001 - S - Refresh - - - &OAD - 001 - S - ICON_ALV_VARIANT_CHOOSE - @DM@ - Select layout... - - - &ODN - 001 - S - ICON_SORT_DOWN - @3F@ - Sort in descendin. - - - &OL0 - 001 - S - ICON_ALV_VARIANTS - @LZ@ - Change layout... - - - &OMP - 001 - S - Collapse - - - &OUP - 001 - S - ICON_SORT_UP - @3E@ - Sort in Ascending... - - - &RNT - 001 - S - ICON_PRINT - @0X@ - Print - - - &RNT_PREV - 001 - S - Print preview - - - &SAL - 001 - S - ICON_DESELECT_ALL - @4D@ - Deselect all - - - &SUM - 001 - S - ICON_INTERMEDIATE_SUM - @5V@ - Subtotals... - - - &UMC - 001 - S - ICON_SUM - @3Z@ - Total - - - &XML - 001 - S - XML Export... - - - &XPA - 001 - S - Expand - - - &XXL - 001 - S - Spreadsheet... - - - EXCEL - 001 - S - ICON_XLV - @J3@ - Excel - Export to Excel - Export to Excel - - - P - 001 - S - First Page - - - P+ - 001 - S - ICON_NEXT_PAGE - @30@ - Next page - - - P++ - 001 - S - ICON_LAST_PAGE - @31@ - Last Page - - - P- - 001 - S - ICON_PREVIOUS_PAGE - @2Z@ - Previous Page - - - P-- - 001 - S - ICON_FIRST_PAGE - @2Y@ - First Page - - - - - 000001 - S - List - - - 000002 - S - Edit - - - 000003 - S - Goto - - - 000004 - S - Settings - - - - - 000001 - 01 - 000001 - - - 000001 - 02 - 000002 - - - 000001 - 03 - 000003 - - - 000001 - 04 - 000004 - - - - - 000001 - 0001 - 01 - 39 - - - 000001 - 0001 - 02 - 37 - - - 000001 - 0001 - 04 - 05 - - - 000001 - 0001 - 05 - 06 - - - 000001 - 0001 - 07 - 28 - - - 000001 - 0001 - 08 - 40 - - - 000001 - 0001 - 09 - 29 - - - 000001 - 0001 - 10 - 38 - - - 000001 - 0001 - 12 - 30 - - - 000001 - 0001 - 13 - 42 - - - 000001 - 0001 - 15 - 45 - - - 000001 - 0001 - 17 - 32 - - - 000001 - 0001 - 18 - 33 - - - 000001 - 0001 - 19 - 34 - - - 000001 - 0001 - 20 - 09 - - - 000001 - 0001 - 22 - 41 - - - 000001 - 0001 - 23 - 07 - - - 000001 - 0001 - 25 - 18 - - - 000001 - 0001 - 26 - 26 - - - 000001 - 0001 - 27 - 27 - - - 000001 - 0001 - 28 - 19 - - - - - 000001 - 02 - &IC1 - 001 - - - 000001 - 03 - &F03 - 001 - - - 000001 - 05 - &ALL - 001 - - - 000001 - 06 - &SAL - 001 - - - 000001 - 07 - &NFO - 001 - - - 000001 - 08 - &NTE - 001 - - - 000001 - 09 - EXCEL - 001 - - - 000001 - 12 - &F12 - 001 - - - 000001 - 15 - &F15 - 001 - - - 000001 - 18 - &CRB - 001 - - - 000001 - 19 - &CRE - 001 - - - 000001 - 21 - P - 001 - - - 000001 - 22 - P- - 001 - - - 000001 - 23 - P+ - 001 - - - 000001 - 24 - P++ - 001 - - - 000001 - 25 - &ABC - 001 - - - 000001 - 26 - &CRL - 001 - - - 000001 - 27 - &CRR - 001 - - - 000001 - 28 - &OUP - 001 - - - 000001 - 29 - &ILT - 001 - - - 000001 - 30 - &UMC - 001 - - - 000001 - 31 - %SL - 001 - - - 000001 - 32 - &OL0 - 001 - - - 000001 - 33 - &OAD - 001 - - - 000001 - 34 - &AVE - 001 - - - 000001 - 35 - &XPA - 001 - - - 000001 - 37 - &EB9 - 001 - - - 000001 - 38 - &ILD - 001 - - - 000001 - 39 - &ETA - 001 - - - 000001 - 40 - &ODN - 001 - - - 000001 - 41 - &LFO - 001 - - - 000001 - 42 - &SUM - 001 - - - 000001 - 43 - &XXL - 001 - - - 000001 - 44 - &AQW - 001 - - - 000001 - 45 - %PC - 001 - - - 000001 - 46 - &RNT_PREV - 001 - - - 000001 - 47 - &OMP - 001 - - - 000001 - 48 - &XML - 001 - - - 000001 - 71 - %SC - 001 - - - 000001 - 80 - P-- - 001 - - - 000001 - 81 - P- - 001 - - - 000001 - 82 - P+ - 001 - - - 000001 - 83 - P++ - 001 - - - 000001 - 84 - %SC+ - 001 - - - 000001 - 86 - &RNT - 001 - - - - - ALV_STATUS - %PC - - - ALV_STATUS - %SC - - - ALV_STATUS - %SC+ - - - ALV_STATUS - %SL - - - ALV_STATUS - &ABC - - - ALV_STATUS - &ALL - - - ALV_STATUS - &AQW - - - ALV_STATUS - &AVE - - - ALV_STATUS - &CRB - - - ALV_STATUS - &CRE - - - ALV_STATUS - &CRL - - - ALV_STATUS - &CRR - - - ALV_STATUS - &EB9 - - - ALV_STATUS - &ETA - - - ALV_STATUS - &F03 - - - ALV_STATUS - &F12 - - - ALV_STATUS - &F15 - - - ALV_STATUS - &IC1 - - - ALV_STATUS - &ILD - - - ALV_STATUS - &ILT - - - ALV_STATUS - &LFO - - - ALV_STATUS - &NFO - - - ALV_STATUS - &NTE - - - ALV_STATUS - &OAD - - - ALV_STATUS - &ODN - - - ALV_STATUS - &OL0 - - - ALV_STATUS - &OMP - - - ALV_STATUS - &OUP - - - ALV_STATUS - &RNT - - - ALV_STATUS - &RNT_PREV - - - ALV_STATUS - &SAL - - - ALV_STATUS - &SUM - - - ALV_STATUS - &UMC - - - ALV_STATUS - &XML - - - ALV_STATUS - &XPA - - - ALV_STATUS - &XXL - - - ALV_STATUS - EXCEL - - - ALV_STATUS - P - - - ALV_STATUS - P+ - - - ALV_STATUS - P++ - - - ALV_STATUS - P- - - - ALV_STATUS - P-- - - - - - A - 000001 - D - Standard for General List Output - - - P - 000001 - D - Standard for General List Output - - - B - 000001 - 0001 - D - Standard for General List Output - - - - - - R - abap2xlsx Demo: Test Excel Reader (Now in ZDEMO_EXCEL15) - 56 - - - - - diff --git a/src/demos/zdemo_excel27.prog.abap b/src/demos/zdemo_excel27.prog.abap deleted file mode 100644 index 8ffbeb150..000000000 --- a/src/demos/zdemo_excel27.prog.abap +++ /dev/null @@ -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. diff --git a/src/demos/zdemo_excel27.prog.xml b/src/demos/zdemo_excel27.prog.xml deleted file mode 100644 index df5b9d2b7..000000000 --- a/src/demos/zdemo_excel27.prog.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ZDEMO_EXCEL27 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Data conditional formatting with styles - 56 - - - S - P_PATH - . - 24 - D - - - S - P_READER - Write back after using Reader - 37 - - - - - diff --git a/src/demos/zdemo_excel28.prog.abap b/src/demos/zdemo_excel28.prog.abap deleted file mode 100644 index 2cd4ec0f3..000000000 --- a/src/demos/zdemo_excel28.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel28.prog.xml b/src/demos/zdemo_excel28.prog.xml deleted file mode 100644 index 88151f5dc..000000000 --- a/src/demos/zdemo_excel28.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL28 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: export in CSV - 29 - - - - - diff --git a/src/demos/zdemo_excel29.prog.abap b/src/demos/zdemo_excel29.prog.abap deleted file mode 100644 index c5a092df1..000000000 --- a/src/demos/zdemo_excel29.prog.abap +++ /dev/null @@ -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. diff --git a/src/demos/zdemo_excel29.prog.xml b/src/demos/zdemo_excel29.prog.xml deleted file mode 100644 index 70525a564..000000000 --- a/src/demos/zdemo_excel29.prog.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - ZDEMO_EXCEL29 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Macro-Enabled workbook - 38 - - - S - P_FILE - Load template from file - 31 - - - S - P_OBJID - Object ID - 17 - - - S - P_PATH - Macro-enabled Workbook - 30 - - - S - P_SMW0 - Load template from SMW0 - 31 - - - - - diff --git a/src/demos/zdemo_excel3.prog.abap b/src/demos/zdemo_excel3.prog.abap deleted file mode 100644 index 1c4f24ee4..000000000 --- a/src/demos/zdemo_excel3.prog.abap +++ /dev/null @@ -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: 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 . - lo_worksheet->set_cell( ip_row = row ip_column = 'A' ip_value = -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: - TYPE simple, - TYPE any. - - CREATE DATA lv_ref_line LIKE LINE OF ct_data. - ASSIGN lv_ref_line->* TO . - - LOOP AT it_data INTO lv_line. - CLEAR . - SPLIT lv_line AT ';' INTO TABLE lt_fields. - lv_comp = 2. - LOOP AT lt_fields INTO lv_field. - ASSIGN COMPONENT lv_comp OF STRUCTURE TO . - = lv_field. - lv_comp = lv_comp + 1. - ENDLOOP. - APPEND 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. diff --git a/src/demos/zdemo_excel3.prog.xml b/src/demos/zdemo_excel3.prog.xml deleted file mode 100644 index bb1a054fd..000000000 --- a/src/demos/zdemo_excel3.prog.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ZDEMO_EXCEL3 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Export internal table - 38 - - - S - P_EMPTY - Leave Table Empty - 25 - - - S - P_PATH - . - 24 - D - - - - - diff --git a/src/demos/zdemo_excel30.prog.abap b/src/demos/zdemo_excel30.prog.abap deleted file mode 100644 index d36baf8a2..000000000 --- a/src/demos/zdemo_excel30.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel30.prog.xml b/src/demos/zdemo_excel30.prog.xml deleted file mode 100644 index c686fa3b7..000000000 --- a/src/demos/zdemo_excel30.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL30 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: ABAP Cell data types - 37 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel31.prog.abap b/src/demos/zdemo_excel31.prog.abap deleted file mode 100644 index dfcae8eb4..000000000 --- a/src/demos/zdemo_excel31.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel31.prog.xml b/src/demos/zdemo_excel31.prog.xml deleted file mode 100644 index e11aa28d7..000000000 --- a/src/demos/zdemo_excel31.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL31 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Autosize Column with different Font sizes - 58 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel32.prog.abap b/src/demos/zdemo_excel32.prog.abap deleted file mode 100644 index 0a16bca55..000000000 --- a/src/demos/zdemo_excel32.prog.abap +++ /dev/null @@ -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 diff --git a/src/demos/zdemo_excel32.prog.xml b/src/demos/zdemo_excel32.prog.xml deleted file mode 100644 index 40161af17..000000000 --- a/src/demos/zdemo_excel32.prog.xml +++ /dev/null @@ -1,1941 +0,0 @@ - - - - - - ZDEMO_EXCEL32 - 1 - E - X - X - - - - 000010 - 000010 - - - - ALV_STATUS - D - 000001 - 000001 - 0001 - Standard for General List Output - - - - - %ML - 001 - S - Folder - F - - - %PC - 001 - S - ICON_EXPORT - @49@ - Local file... - L - - - %SC - 001 - S - ICON_SEARCH - @13@ - Find - N - - - %SC+ - 001 - S - ICON_SEARCH_NEXT - @4E@ - Find next - - - %SL - 001 - S - ICON_MAIL - @1S@ - Mail recipient - M - - - &ABC - 001 - S - ICON_ABC - @DL@ - ABC Analysis - A - - - &ALL - 001 - S - ICON_SELECT_ALL - @4B@ - Select all - S - - - &AQW - 001 - S - ICON_WORD_PROCESSING - @DK@ - Word processing... - W - - - &AUF - 001 - S - Define Breakdown... - D - - - &AVE - 001 - S - Saving... - S - - - &AVE - 002 - S - ICON_ALV_VARIANT_SAVE - @DN@ - Save layout... - - - &AVR - 001 - S - Mean value - M - - - &CDF - 001 - S - Unfreeze - U - - - &CFI - 001 - S - Freeze to column - F - - - &COUNT - 001 - S - Count - C - - - &CRB - 001 - S - ICON_TOTAL_LEFT - @0B@ - First Column - - - &CRE - 001 - S - ICON_TOTAL_RIGHT - @0C@ - Last column - - - &CRL - 001 - S - ICON_COLUMN_LEFT - @0D@ - Column left - - - &CRR - 001 - S - ICON_COLUMN_RIGHT - @0E@ - Column right - - - &DAU - 001 - S - Automatic Separator - T - - - &DOF - 001 - S - Separator Always Off - E - - - &DON - 001 - S - Separator Always On - R - - - &EB9 - 001 - S - ICON_TABLE_SETTINGS - @36@ - Call Up Report - C - - - &ELP - 001 - S - ICON_SYSTEM_HELP - @35@ - Help - - - &ERW - 001 - S - Layout Management - L - - - &ETA - 001 - S - ICON_SELECT_DETAIL - @16@ - Details - - - &F03 - 001 - S - Back - B - - - &F12 - 001 - S - ICON_CANCEL - @0W@ - Cancel - A - - - &F15 - 001 - S - Exit - X - - - &IC1 - 001 - S - ICON_SELECT_DETAIL - @16@ - Choose - - - &ILD - 001 - S - ICON_FILTER_UNDO - @GD@ - Delete Filter - L - - - &ILT - 001 - S - ICON_FILTER - @4G@ - Set filter - F - - - &KOM - 001 - S - ICON_COLLAPSE - @3T@ - Choose... - C - - - &LFO - 001 - S - List status... - L - - - &LFO - 002 - S - ICON_INFORMATION - @0S@ - List status... - - - &LIS - 001 - S - Basic List - B - - - &MAX - 001 - S - Maximum - A - - - &MIN - 001 - S - Minimum - I - - - &NFO - 001 - S - ICON_INFORMATION - @0S@ - Selections... - Selections - E - - - &NTE - 001 - S - Refresh - - - &OAD - 001 - S - Choose... - H - - - &OAD - 002 - S - ICON_ALV_VARIANT_CHOOSE - @DM@ - Select layout... - - - &ODN - 001 - S - ICON_SORT_DOWN - @3F@ - Sort in descending order - O - - - &OL0 - 001 - S - ICON_ALV_VARIANTS - @LZ@ - Change layout... - - - &OLX - 001 - S - ICON_VARIANTS - @0R@ - Change... - C - - - &OMP - 001 - S - ICON_COLLAPSE - @3T@ - Collapse - - - &OPT - 001 - S - Optimize width - P - - - &OUP - 001 - S - ICON_SORT_UP - @3E@ - Sort in Ascending Order - I - - - &RNT - 001 - S - ICON_PRINT - @0X@ - Print - P - - - &RNT_PREV - 001 - S - ICON_LAYOUT_CONTROL - @3G@ - Print preview - R - - - &SAL - 001 - S - ICON_DESELECT_ALL - @4D@ - Deselect all - D - - - &SUM - 001 - S - ICON_INTERMEDIATE_SUM - @5V@ - Subtotals... - T - - - &UMC - 001 - S - ICON_SUM - @3Z@ - Total - T - - - &XINT - 001 - S - Additional Functions of SAP Query - E - - - &XML - 001 - S - XML Export... - X - - - &XPA - 001 - S - ICON_EXPAND - @3S@ - Expand - - - &XXL - 001 - S - ICON_XXL - @DJ@ - Spreadsheet... - A - - - EXCEL - 001 - S - ICON_XLV - @J3@ - Excel - Export to Excel - - - EXCELBIND - 001 - S - ICON_XLS - @J2@ - Excel bind - Excel bind - - - EXCELCELL - 001 - S - ICON_XXL - @DJ@ - Excel converter - - - EXCELCONV - 001 - S - @DJ@ - Excel converter - Excel converter - - - P+ - 001 - S - Next page - - - P++ - 001 - S - Last Page - - - P- - 001 - S - Previous Page - - - P-- - 001 - S - First Page - - - - - 000001 - 01 - F - &RNT - 001 - - - 000001 - 02 - M - 000002 - - - 000001 - 03 - M - 000003 - - - 000001 - 04 - S - - - 000001 - 05 - F - &F15 - 001 - - - 000002 - 01 - F - &AQW - 001 - - - 000002 - 02 - F - &XXL - 001 - - - 000002 - 03 - F - %PC - 001 - - - 000002 - 04 - F - &XINT - 001 - - - 000003 - 01 - F - %SL - 001 - - - 000003 - 02 - F - %ML - 001 - - - 000004 - 01 - F - &ALL - 001 - - - 000004 - 02 - F - &SAL - 001 - - - 000004 - 03 - S - - - 000004 - 04 - F - &ILT - 001 - - - 000004 - 05 - F - &ILD - 001 - - - 000004 - 06 - S - - - 000004 - 07 - F - &OUP - 001 - - - 000004 - 08 - F - &ODN - 001 - - - 000004 - 09 - S - - - 000004 - 10 - M - 000005 - - - 000004 - 11 - F - &SUM - 001 - - - 000004 - 12 - S - - - 000004 - 13 - F - %SC - 001 - - - 000004 - 14 - S - - - 000004 - 15 - F - &F12 - 001 - - - 000005 - 01 - F - &UMC - 001 - - - 000005 - 02 - F - &AVR - 001 - - - 000005 - 03 - F - &MIN - 001 - - - 000005 - 04 - F - &MAX - 001 - - - 000005 - 05 - F - &COUNT - 001 - - - 000006 - 01 - F - &ABC - 001 - - - 000006 - 02 - S - - - 000006 - 03 - F - &F03 - 001 - - - 000007 - 01 - F - &LIS - 001 - - - 000007 - 02 - S - - - 000007 - 03 - M - 000008 - - - 000007 - 04 - S - - - 000007 - 05 - M - 000009 - - - 000007 - 06 - S - - - 000007 - 07 - M - 000010 - - - 000007 - 08 - S - - - 000007 - 09 - F - &NFO - 001 - - - 000007 - 10 - F - &LFO - 001 - - - 000008 - 01 - F - &OLX - 001 - - - 000008 - 02 - F - &OAD - 001 - - - 000008 - 03 - S - - - 000008 - 04 - F - &AVE - 001 - - - 000008 - 05 - S - - - 000008 - 06 - F - &ERW - 001 - - - 000009 - 01 - F - &KOM - 001 - - - 000009 - 02 - F - &AUF - 001 - - - 000010 - 01 - F - &OPT - 001 - - - 000010 - 02 - S - - - 000010 - 03 - F - &CFI - 001 - - - 000010 - 04 - F - &CDF - 001 - - - 000010 - 05 - S - - - 000010 - 06 - F - &DAU - 001 - - - 000010 - 07 - F - &DON - 001 - - - 000010 - 08 - F - &DOF - 001 - - - - - 000001 - S - List - L - STANDARD List - - - 000002 - S - Export - E - STANDARD Save - - - 000003 - S - Send to - S - - - 000004 - S - Edit - E - STANDARD - - - 000005 - S - Calculate - C - - - 000006 - S - Goto - G - STANDARD - - - 000007 - S - Settings - S - STANDARD - - - 000008 - S - Layout - A - Sub STANDARD - - - 000009 - S - Summation levels - S - Sub STANDARD - - - 000010 - S - Columns - C - - - - - 000001 - 01 - 000001 - - - 000001 - 02 - 000004 - - - 000001 - 03 - 000006 - - - 000001 - 04 - 000007 - - - - - 000001 - 0001 - 01 - 39 - - - 000001 - 0001 - 02 - 37 - - - 000001 - 0001 - 03 - S - - - 000001 - 0001 - 04 - 05 - - - 000001 - 0001 - 05 - 06 - - - 000001 - 0001 - 06 - S - - - 000001 - 0001 - 07 - 28 - - - 000001 - 0001 - 08 - 40 - - - 000001 - 0001 - 09 - 29 - - - 000001 - 0001 - 10 - 38 - - - 000001 - 0001 - 11 - S - - - 000001 - 0001 - 12 - 30 - - - 000001 - 0001 - 13 - 42 - - - 000001 - 0001 - 14 - S - - - 000001 - 0001 - 15 - 45 - - - 000001 - 0001 - 16 - S - - - 000001 - 0001 - 17 - 32 - - - 000001 - 0001 - 18 - 33 - - - 000001 - 0001 - 19 - 34 - - - 000001 - 0001 - 20 - 09 - - - 000001 - 0001 - 21 - 13 - - - 000001 - 0001 - 22 - S - - - 000001 - 0001 - 23 - 41 - - - 000001 - 0001 - 24 - 07 - - - 000001 - 0001 - 25 - S - - - 000001 - 0001 - 26 - 18 - - - 000001 - 0001 - 27 - 26 - - - 000001 - 0001 - 28 - 27 - - - 000001 - 0001 - 29 - 19 - - - - - 000001 - 01 - &ELP - 001 - - - 000001 - 02 - &IC1 - 001 - - - 000001 - 03 - &F03 - 001 - - - 000001 - 05 - &ALL - 001 - - - 000001 - 06 - &SAL - 001 - - - 000001 - 07 - &NFO - 001 - - - 000001 - 08 - &NTE - 001 - - - 000001 - 09 - EXCELBIND - 001 - - - 000001 - 12 - &F12 - 001 - - - 000001 - 13 - EXCELCONV - 001 - - - 000001 - 15 - &F15 - 001 - - - 000001 - 18 - &CRB - 001 - - - 000001 - 19 - &CRE - 001 - - - 000001 - 21 - P-- - 001 - - - 000001 - 22 - P- - 001 - - - 000001 - 23 - P+ - 001 - - - 000001 - 24 - P++ - 001 - - - 000001 - 25 - &ABC - 001 - - - 000001 - 26 - &CRL - 001 - - - 000001 - 27 - &CRR - 001 - - - 000001 - 28 - &OUP - 001 - - - 000001 - 29 - &ILT - 001 - - - 000001 - 30 - &UMC - 001 - - - 000001 - 31 - %SL - 001 - - - 000001 - 32 - &OL0 - 001 - - - 000001 - 33 - &OAD - 002 - - - 000001 - 34 - &AVE - 002 - - - 000001 - 35 - &XPA - 001 - - - 000001 - 37 - &EB9 - 001 - - - 000001 - 38 - &ILD - 001 - - - 000001 - 39 - &ETA - 001 - - - 000001 - 40 - &ODN - 001 - - - 000001 - 41 - &LFO - 002 - - - 000001 - 42 - &SUM - 001 - - - 000001 - 43 - &XXL - 001 - - - 000001 - 44 - &AQW - 001 - - - 000001 - 45 - %PC - 001 - - - 000001 - 46 - &RNT_PREV - 001 - - - 000001 - 47 - &OMP - 001 - - - 000001 - 48 - &XML - 001 - - - 000001 - 71 - %SC - 001 - - - 000001 - 80 - P-- - 001 - - - 000001 - 81 - P- - 001 - - - 000001 - 82 - P+ - 001 - - - 000001 - 83 - P++ - 001 - - - 000001 - 84 - %SC+ - 001 - - - 000001 - 86 - &RNT - 001 - - - - - ALV_STATUS - %CH - - - ALV_STATUS - %ML - - - ALV_STATUS - %PC - - - ALV_STATUS - %SC - - - ALV_STATUS - %SC+ - - - ALV_STATUS - %SL - - - ALV_STATUS - &ABC - - - ALV_STATUS - &ALL - - - ALV_STATUS - &AQW - - - ALV_STATUS - &AUF - - - ALV_STATUS - &AVE - - - ALV_STATUS - &AVR - - - ALV_STATUS - &BS - - - ALV_STATUS - &BS+ - - - ALV_STATUS - &BS- - - - ALV_STATUS - &CDF - - - ALV_STATUS - &CFI - - - ALV_STATUS - &COUNT - - - ALV_STATUS - &CRB - - - ALV_STATUS - &CRE - - - ALV_STATUS - &CRL - - - ALV_STATUS - &CRR - - - ALV_STATUS - &DAU - - - ALV_STATUS - &DOF - - - ALV_STATUS - &DON - - - ALV_STATUS - &EB3 - - - ALV_STATUS - &EB9 - - - ALV_STATUS - &ELP - - - ALV_STATUS - &ERW - - - ALV_STATUS - &ETA - - - ALV_STATUS - &F03 - - - ALV_STATUS - &F12 - - - ALV_STATUS - &F15 - - - ALV_STATUS - &IC1 - - - ALV_STATUS - &ILD - - - ALV_STATUS - &ILT - - - ALV_STATUS - &KOM - - - ALV_STATUS - &LFO - - - ALV_STATUS - &LIS - - - ALV_STATUS - &MAX - - - ALV_STATUS - &MIN - - - ALV_STATUS - &NFO - - - ALV_STATUS - &NTE - - - ALV_STATUS - &OAD - - - ALV_STATUS - &ODN - - - ALV_STATUS - &OL0 - - - ALV_STATUS - &OL1 - - - ALV_STATUS - &OLX - - - ALV_STATUS - &OMP - - - ALV_STATUS - &OPT - - - ALV_STATUS - &OUP - - - ALV_STATUS - &RNT - - - ALV_STATUS - &SAL - - - ALV_STATUS - &SUM - - - ALV_STATUS - &UMC - - - ALV_STATUS - &XML - - - ALV_STATUS - &XPA - - - ALV_STATUS - &XXL - - - ALV_STATUS - BAC1 - - - ALV_STATUS - BACK - - - ALV_STATUS - BEB1 - - - ALV_STATUS - BEB2 - - - ALV_STATUS - BEB3 - - - ALV_STATUS - BEB9 - - - ALV_STATUS - BEBN - - - ALV_STATUS - COL0 - - - ALV_STATUS - COLX - - - ALV_STATUS - DETA - - - ALV_STATUS - DRUK - - - ALV_STATUS - DSAL - - - ALV_STATUS - ENTE - - - ALV_STATUS - EXCEL - - - ALV_STATUS - EXCELBIND - - - ALV_STATUS - EXCELCELL - - - ALV_STATUS - EXCELCONV - - - ALV_STATUS - EXIT - - - ALV_STATUS - EXPA - - - ALV_STATUS - FILD - - - ALV_STATUS - FILT - - - ALV_STATUS - GLIS - - - ALV_STATUS - HELP - - - ALV_STATUS - INFO - - - ALV_STATUS - KOMP - - - ALV_STATUS - P+ - - - ALV_STATUS - P++ - - - ALV_STATUS - P- - - - ALV_STATUS - P-- - - - ALV_STATUS - PF09 - - - ALV_STATUS - PF13 - - - ALV_STATUS - PIC1 - - - ALV_STATUS - PICK - - - ALV_STATUS - PRI - - - ALV_STATUS - PRIN - - - ALV_STATUS - PRNT - - - ALV_STATUS - RW - - - ALV_STATUS - SALL - - - ALV_STATUS - SAUF - - - ALV_STATUS - SAVE - - - ALV_STATUS - SCRB - - - ALV_STATUS - SCRE - - - ALV_STATUS - SCRL - - - ALV_STATUS - SCRR - - - ALV_STATUS - SKOM - - - ALV_STATUS - SODN - - - ALV_STATUS - SOUP - - - ALV_STATUS - SUMC - - - ALV_STATUS - ZSUM - - - - - A - 000001 - D - Standard User Interface STANDARD - - - P - 000001 - D - X - Standard Maximum Interaction - - - B - 000001 - 0001 - D - Standard Maximum Interaction - - - - - - R - abap2xlsx Demo: Export ALV - 26 - - - - - diff --git a/src/demos/zdemo_excel33.prog.abap b/src/demos/zdemo_excel33.prog.abap deleted file mode 100644 index 832ce64ca..000000000 --- a/src/demos/zdemo_excel33.prog.abap +++ /dev/null @@ -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: 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_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. diff --git a/src/demos/zdemo_excel33.prog.xml b/src/demos/zdemo_excel33.prog.xml deleted file mode 100644 index 9ef5f5fcc..000000000 --- a/src/demos/zdemo_excel33.prog.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ZDEMO_EXCEL33 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Autofilter - 26 - - - S - P_CONVEX - Output length for conv. exits - 37 - - - S - P_PATH - . - 24 - D - - - - - diff --git a/src/demos/zdemo_excel34.prog.abap b/src/demos/zdemo_excel34.prog.abap deleted file mode 100644 index 8d8b0f322..000000000 --- a/src/demos/zdemo_excel34.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel34.prog.xml b/src/demos/zdemo_excel34.prog.xml deleted file mode 100644 index 741632bf3..000000000 --- a/src/demos/zdemo_excel34.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL34 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Static Styles (Chess) - 37 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel35.prog.abap b/src/demos/zdemo_excel35.prog.abap deleted file mode 100644 index 124122922..000000000 --- a/src/demos/zdemo_excel35.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel35.prog.xml b/src/demos/zdemo_excel35.prog.xml deleted file mode 100644 index a8a3fb5e4..000000000 --- a/src/demos/zdemo_excel35.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL35 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: static styles - 33 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel36.prog.abap b/src/demos/zdemo_excel36.prog.abap deleted file mode 100644 index 22112363d..000000000 --- a/src/demos/zdemo_excel36.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel36.prog.xml b/src/demos/zdemo_excel36.prog.xml deleted file mode 100644 index c957dc488..000000000 --- a/src/demos/zdemo_excel36.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL36 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Default Styles - 31 - - - - - diff --git a/src/demos/zdemo_excel37.prog.abap b/src/demos/zdemo_excel37.prog.abap deleted file mode 100644 index b9eaf812f..000000000 --- a/src/demos/zdemo_excel37.prog.abap +++ /dev/null @@ -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: LIKE LINE OF lt_implementing_classes, - LIKE LINE OF lt_values. - -*--------------------------------------------------------------------* -* Possible READER-Classes -*--------------------------------------------------------------------* - lv_id = 'LB_READ'. - APPEND INITIAL LINE TO lt_values ASSIGNING . - -key = 'Autodetect'(001). - -text = 'Autodetect'(001). - - - PERFORM get_implementing_classds USING 'ZIF_EXCEL_READER' - CHANGING lt_implementing_classes. - CLEAR lt_values. - LOOP AT lt_implementing_classes ASSIGNING . - - APPEND INITIAL LINE TO lt_values ASSIGNING . - -key = -clsname. - -text = -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 . - -key = 'Autodetect'(001). - -text = 'Autodetect'(001). - - - PERFORM get_implementing_classds USING 'ZIF_EXCEL_WRITER' - CHANGING lt_implementing_classes. - CLEAR lt_values. - LOOP AT lt_implementing_classes ASSIGNING . - - APPEND INITIAL LINE TO lt_values ASSIGNING . - -key = -clsname. - -text = -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: 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 . - TRY. - lo_oo_class ?= cl_oo_class=>get_instance( -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 diff --git a/src/demos/zdemo_excel37.prog.xml b/src/demos/zdemo_excel37.prog.xml deleted file mode 100644 index 7894aefea..000000000 --- a/src/demos/zdemo_excel37.prog.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - ZDEMO_EXCEL37 - 1 - T - E - X - X - - - - I - DUM - Enable dump creation - 40 - - - R - abap2xlsx Demo: Read xlsx-file and output = using templates - 59 - - - S - CB_ERRL - Show error location - 27 - - - S - LB_READ - Reader class - 20 - - - S - LB_WRITE - Writer class - 20 - - - S - P_APPLSE - From Application Server - 31 - - - S - P_UPFILE - Input template - 22 - - - - - D - - - I - CLS - Auswahl der Reader- und Writerklasse - 70 - - - I - DUM - Dump bei unbeh. Exception. Man weiß wenn man das braucht - 60 - - - I - ERR - Besondere Schalter - 60 - - - R - Xlsx-Datei lesen und dann wieder ausgeben = Arbeiten mit Templates - 70 - - - S - CB_DUMP - Dump bei unbeh. Exceptions - 36 - - - S - CB_ERRL - Exceptionposition anzeigen - 34 - - - S - LB_READ - Reader-Klasse - 21 - - - S - LB_WRITE - Writer-Klasse - 21 - - - S - P_UPFILE - Hochzuladende Datei - 27 - - - - - - - diff --git a/src/demos/zdemo_excel38.prog.abap b/src/demos/zdemo_excel38.prog.abap deleted file mode 100644 index 2a59f9de9..000000000 --- a/src/demos/zdemo_excel38.prog.abap +++ /dev/null @@ -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: LIKE LINE OF lt_icon, - 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 . - - lv_row = sy-tabix. -*--------------------------------------------------------------------* -* Set name of icon -*--------------------------------------------------------------------* - lo_worksheet->set_cell( ip_row = lv_row - ip_column = 'A' - ip_value = -name ). -*--------------------------------------------------------------------* -* Check whether the mime-repository holds some icondata for us -*--------------------------------------------------------------------* - -* Get key - SELECT SINGLE objid - INTO -objid - FROM wwwdata - WHERE text = -name. - CHECK sy-subrc = 0. " :o( - lo_worksheet->set_cell( ip_row = lv_row - ip_column = 'B' - ip_value = -objid ). - -* Load mimedata - CLEAR lt_mimedata. - CLEAR ls_wwwdatatab. - ls_wwwdatatab-relid = 'MI' . - ls_wwwdatatab-objid = -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 . - CONCATENATE lv_xstring -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 ). diff --git a/src/demos/zdemo_excel38.prog.xml b/src/demos/zdemo_excel38.prog.xml deleted file mode 100644 index d4f0b8749..000000000 --- a/src/demos/zdemo_excel38.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL38 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Read file and output - 36 - - - S - S_ICON - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel39.prog.abap b/src/demos/zdemo_excel39.prog.abap deleted file mode 100644 index 81688ddec..000000000 --- a/src/demos/zdemo_excel39.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel39.prog.xml b/src/demos/zdemo_excel39.prog.xml deleted file mode 100644 index fe9f92fda..000000000 --- a/src/demos/zdemo_excel39.prog.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - ZDEMO_EXCEL39 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Drawings - 24 - - - S - POBJTYPE - . - 9 - D - - - S - P_CLASS - . - 9 - D - - - S - P_OBJID - . - 9 - D - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel4.prog.abap b/src/demos/zdemo_excel4.prog.abap deleted file mode 100644 index 5b5f020f4..000000000 --- a/src/demos/zdemo_excel4.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel4.prog.xml b/src/demos/zdemo_excel4.prog.xml deleted file mode 100644 index 3e3c34968..000000000 --- a/src/demos/zdemo_excel4.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL4 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Create XLXS with multiple sheets - 49 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel40.prog.abap b/src/demos/zdemo_excel40.prog.abap deleted file mode 100644 index 57ddf89a5..000000000 --- a/src/demos/zdemo_excel40.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel40.prog.xml b/src/demos/zdemo_excel40.prog.xml deleted file mode 100644 index d9e5dff11..000000000 --- a/src/demos/zdemo_excel40.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL40 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Area and Print settings - 39 - - - S - S_ICON - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel41.prog.abap b/src/demos/zdemo_excel41.prog.abap deleted file mode 100644 index c88be71b0..000000000 --- a/src/demos/zdemo_excel41.prog.abap +++ /dev/null @@ -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. diff --git a/src/demos/zdemo_excel41.prog.xml b/src/demos/zdemo_excel41.prog.xml deleted file mode 100644 index 7f16d3045..000000000 --- a/src/demos/zdemo_excel41.prog.xml +++ /dev/null @@ -1,1711 +0,0 @@ - - - - - - ZDEMO_EXCEL41 - 1 - T - E - X - X - - - -
- ZDEMO_EXCEL41 - 9000 - E - 9000 - N - 9000 - 027 - 120 -
- - - SCREEN - SCREEN - - - CUST_CTRL - CC_9000 - SCREEN - 001 - 001 - 120 - 027 - - - - - SCREEN - SCREEN - OKCODE - OK_CODE - ____________________ - 020 - 020 - 001 - CHAR - X - - - - - PROCESS BEFORE OUTPUT. - - - MODULE STATUS_9000. - - - - PROCESS AFTER INPUT. - - - MODULE USER_COMMAND_9000 AT EXIT-COMMAND. - - - MODULE USER_COMMAND_9000. - - -
-
- - - 000010 - 000010 - - - - 9000 - D - 000006 - 000006 - 0001 - 9000 - - - TEST - D - 000005 - 000005 - 0001 - test - - - - - %EX - 001 - S - Exit - X - - - %PC - 001 - S - File... - F - - - %PRI - 001 - S - ICON_PRINT - @0X@ - Print - - - %SC - 001 - S - ICON_SEARCH - @13@ - Find... - F - - - %SC - 002 - S - ICON_SEARCH - @13@ - Find - S - - - %SC+ - 001 - S - ICON_SEARCH_NEXT - @4E@ - Find next - X - - - %SL - 001 - S - Office - E - - - %ST - 001 - S - Report tree - R - - - ABBR - 001 - S - ICON_CANCEL - @0W@ - Cancel - - - ASDF - 001 - S - Asdf - - - BACK - 001 - S - ICON_OKAY - @0V@ - Back - B - - - ENTER - 001 - S - ICON_OKAY - @0V@ - Enter - Enter - - - ENTER2 - 001 - S - Enter2 - - - EXIT - 001 - E - S - Exit - - - HUGO - 001 - S - Hugp - - - OKAY - 001 - S - ICON_OKAY - @0V@ - Okay - OKAY - - - P+ - 001 - S - Next page - - - P++ - 001 - S - Last Page - - - P- - 001 - S - Previous Page - - - P-- - 001 - S - First Page - - - PICK - 001 - S - ICON_SELECT_DETAIL - @16@ - Choose - S - - - PRI - 001 - S - ICON_PRINT - @0X@ - Print - P - - - RW - 001 - S - ICON_CANCEL - @0W@ - Cancel - A - - - - - 000001 - 01 - F - PRI - 001 - - - 000001 - 02 - M - 000002 - - - 000001 - 03 - F - %EX - 001 - - - 000002 - 01 - F - %SL - 001 - - - 000002 - 02 - F - %ST - 001 - - - 000002 - 03 - F - %PC - 001 - - - 000003 - 01 - F - PICK - 001 - - - 000003 - 02 - F - %SC - 001 - - - 000003 - 03 - F - %SC+ - 001 - - - 000003 - 04 - F - RW - 001 - - - 000004 - 01 - F - BACK - 001 - - - 000005 - 01 - F - PRI - 001 - - - 000005 - 02 - M - 000006 - - - 000005 - 03 - F - %EX - 001 - - - 000006 - 01 - F - %SL - 001 - - - 000006 - 02 - F - %ST - 001 - - - 000006 - 03 - F - %PC - 001 - - - 000007 - 01 - F - PICK - 001 - - - 000007 - 02 - F - %SC - 001 - - - 000007 - 03 - F - %SC+ - 001 - - - 000007 - 04 - F - RW - 001 - - - 000008 - 01 - F - BACK - 001 - - - 000009 - 01 - F - PRI - 001 - - - 000009 - 02 - M - 000010 - - - 000009 - 03 - F - %EX - 001 - - - 000010 - 01 - F - %SL - 001 - - - 000010 - 02 - F - %ST - 001 - - - 000010 - 03 - F - %PC - 001 - - - 000011 - 01 - F - PICK - 001 - - - 000011 - 02 - F - %SC - 001 - - - 000011 - 03 - F - %SC+ - 001 - - - 000011 - 04 - F - RW - 001 - - - 000012 - 01 - F - BACK - 001 - - - 000013 - 01 - F - PRI - 001 - - - 000013 - 02 - M - 000014 - - - 000013 - 03 - F - %EX - 001 - - - 000014 - 01 - F - %SL - 001 - - - 000014 - 02 - F - %ST - 001 - - - 000014 - 03 - F - %PC - 001 - - - 000015 - 01 - F - PICK - 001 - - - 000015 - 02 - F - %SC - 001 - - - 000015 - 03 - F - %SC+ - 001 - - - 000015 - 04 - F - RW - 001 - - - 000016 - 01 - F - BACK - 001 - - - 000017 - 01 - F - PRI - 001 - - - 000017 - 02 - M - 000018 - - - 000017 - 03 - F - %EX - 001 - - - 000018 - 01 - F - %SL - 001 - - - 000018 - 02 - F - %ST - 001 - - - 000018 - 03 - F - %PC - 001 - - - 000019 - 01 - F - PICK - 001 - - - 000019 - 02 - F - %SC - 001 - - - 000019 - 03 - F - %SC+ - 001 - - - 000019 - 04 - F - RW - 001 - - - 000020 - 01 - F - BACK - 001 - - - - - 000001 - S - List - L - - - 000002 - S - Save/Send - S - - - 000003 - S - Edit - E - - - 000004 - S - Goto - G - - - 000005 - S - List - L - - - 000006 - S - Save/Send - S - - - 000007 - S - Edit - E - - - 000008 - S - Goto - G - - - 000009 - S - List - L - - - 000010 - S - Save/Send - S - - - 000011 - S - Edit - E - - - 000012 - S - Goto - G - - - 000013 - S - List - L - - - 000014 - S - Save/Send - S - - - 000015 - S - Edit - E - - - 000016 - S - Goto - G - - - 000017 - S - List - L - - - 000018 - S - Save/Send - S - - - 000019 - S - Edit - E - - - 000020 - S - Goto - G - - - - - 000001 - 01 - 000001 - - - 000001 - 02 - 000003 - - - 000001 - 03 - 000004 - - - 000002 - 01 - 000005 - - - 000002 - 02 - 000007 - - - 000002 - 03 - 000008 - - - 000003 - 01 - 000009 - - - 000003 - 02 - 000011 - - - 000003 - 03 - 000012 - - - 000004 - 01 - 000013 - - - 000004 - 02 - 000015 - - - 000004 - 03 - 000016 - - - 000005 - 01 - 000017 - - - 000005 - 02 - 000019 - - - 000005 - 03 - 000020 - - - - - 000001 - 0001 - 01 - 02 - - - 000001 - 0001 - 02 - 86 - - - 000001 - 0001 - 03 - 71 - - - 000001 - 0001 - 04 - 84 - - - 000001 - 0001 - 05 - 12 - - - 000001 - 0001 - 06 - 06 - - - 000001 - 0001 - 07 - 03 - - - 000001 - 0001 - 08 - 05 - - - 000002 - 0001 - 01 - 02 - - - 000002 - 0001 - 02 - 86 - - - 000002 - 0001 - 03 - 71 - - - 000002 - 0001 - 04 - 84 - - - 000002 - 0001 - 05 - 12 - - - 000002 - 0001 - 06 - 05 - - - 000002 - 0001 - 07 - 00 - - - 000003 - 0001 - 01 - 02 - - - 000003 - 0001 - 02 - 86 - - - 000003 - 0001 - 03 - 71 - - - 000003 - 0001 - 04 - 84 - - - 000003 - 0001 - 05 - 12 - - - 000003 - 0001 - 06 - 00 - - - 000003 - 0001 - 07 - 05 - - - 000004 - 0001 - 01 - 02 - - - 000004 - 0001 - 02 - 86 - - - 000004 - 0001 - 03 - 71 - - - 000004 - 0001 - 04 - 84 - - - 000004 - 0001 - 05 - 12 - - - 000004 - 0001 - 06 - 05 - - - 000005 - 0001 - 01 - 02 - - - 000005 - 0001 - 02 - 86 - - - 000005 - 0001 - 03 - 71 - - - 000005 - 0001 - 04 - 84 - - - 000005 - 0001 - 05 - 12 - - - 000005 - 0001 - 15 - 13 - - - 000006 - 0001 - 01 - 13 - - - - - 000001 - 00 - ENTER - 001 - - - 000001 - 02 - PICK - 001 - - - 000001 - 03 - BACK - 001 - - - 000001 - 05 - ENTER - 001 - - - 000001 - 06 - ENTER2 - 001 - - - 000001 - 12 - RW - 001 - - - 000001 - 15 - %EX - 001 - - - 000001 - 71 - %SC - 002 - - - 000001 - 80 - P-- - 001 - - - 000001 - 81 - P- - 001 - - - 000001 - 82 - P+ - 001 - - - 000001 - 83 - P++ - 001 - - - 000001 - 84 - %SC+ - 001 - - - 000001 - 86 - %PRI - 001 - - - 000002 - 00 - OKAY - 001 - - - 000002 - 02 - PICK - 001 - - - 000002 - 03 - BACK - 001 - - - 000002 - 05 - OKAY - 001 - - - 000002 - 12 - RW - 001 - - - 000002 - 15 - %EX - 001 - - - 000002 - 71 - %SC - 002 - - - 000002 - 80 - P-- - 001 - - - 000002 - 81 - P- - 001 - - - 000002 - 82 - P+ - 001 - - - 000002 - 83 - P++ - 001 - - - 000002 - 84 - %SC+ - 001 - - - 000002 - 86 - %PRI - 001 - - - 000003 - 00 - OKAY - 001 - - - 000003 - 02 - PICK - 001 - - - 000003 - 03 - BACK - 001 - - - 000003 - 05 - OKAY - 001 - - - 000003 - 12 - RW - 001 - - - 000003 - 15 - %EX - 001 - - - 000003 - 71 - %SC - 002 - - - 000003 - 80 - P-- - 001 - - - 000003 - 81 - P- - 001 - - - 000003 - 82 - P+ - 001 - - - 000003 - 83 - P++ - 001 - - - 000003 - 84 - %SC+ - 001 - - - 000003 - 86 - %PRI - 001 - - - 000004 - 00 - OKAY - 001 - - - 000004 - 02 - PICK - 001 - - - 000004 - 03 - BACK - 001 - - - 000004 - 05 - OKAY - 001 - - - 000004 - 12 - RW - 001 - - - 000004 - 15 - %EX - 001 - - - 000004 - 71 - %SC - 002 - - - 000004 - 80 - P-- - 001 - - - 000004 - 81 - P- - 001 - - - 000004 - 82 - P+ - 001 - - - 000004 - 83 - P++ - 001 - - - 000004 - 84 - %SC+ - 001 - - - 000004 - 86 - %PRI - 001 - - - 000005 - 00 - HUGO - 001 - - - 000005 - 02 - PICK - 001 - - - 000005 - 03 - BACK - 001 - - - 000005 - 12 - RW - 001 - - - 000005 - 13 - HUGO - 001 - - - 000005 - 15 - %EX - 001 - - - 000005 - 71 - %SC - 002 - - - 000005 - 80 - P-- - 001 - - - 000005 - 81 - P- - 001 - - - 000005 - 82 - P+ - 001 - - - 000005 - 83 - P++ - 001 - - - 000005 - 84 - %SC+ - 001 - - - 000005 - 86 - %PRI - 001 - - - 000006 - 03 - BACK - 001 - - - 000006 - 12 - ABBR - 001 - - - 000006 - 13 - ASDF - 001 - - - 000006 - 15 - EXIT - 001 - - - - - 9000 - ABBR - - - 9000 - ASDF - - - 9000 - BACK - - - 9000 - EXIT - - - TEST - %EX - - - TEST - %PC - - - TEST - %PRI - - - TEST - %PRN - - - TEST - %SC - - - TEST - %SC+ - - - TEST - %SL - - - TEST - %ST - - - TEST - BACK - - - TEST - HUGO - - - TEST - P+ - - - TEST - P++ - - - TEST - P- - - - TEST - P-- - - - TEST - PICK - - - TEST - PRI - - - TEST - RW - - - - - A - 000001 - D - Line Selection List - - - P - 000001 - D - Line Selection List - - - B - 000001 - 0001 - Line Selection List - - - A - 000002 - D - Line Selection List - - - P - 000002 - D - Line Selection List - - - B - 000002 - 0001 - D - Line Selection List - - - A - 000003 - D - Line Selection List - - - P - 000003 - D - jhg - - - B - 000003 - 0001 - D - jhg - - - A - 000004 - D - Line Selection List - - - P - 000004 - D - okay - - - B - 000004 - 0001 - D - okay - - - A - 000005 - D - Line Selection List - - - P - 000005 - D - Line Selection List - - - B - 000005 - 0001 - D - Line Selection List - - - A - 000006 - D - 9000 - - - P - 000006 - D - 9000 - - - B - 000006 - 0001 - D - 9000 - - - - - - R - abap2xlsx Demo: - 15 - - - S - RBI_1 - ZCL_EXCEL - 17 - - - S - RBI_2 - ZCL_EXCEL_WORKSHEET - 27 - - -
-
-
diff --git a/src/demos/zdemo_excel42.prog.abap b/src/demos/zdemo_excel42.prog.abap deleted file mode 100644 index ebfaada30..000000000 --- a/src/demos/zdemo_excel42.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel42.prog.xml b/src/demos/zdemo_excel42.prog.xml deleted file mode 100644 index 224a8c93d..000000000 --- a/src/demos/zdemo_excel42.prog.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - ZDEMO_EXCEL42 - 1 - * - K - E - X - X - - - - R - abap2xlsx Demo: Theme manipulation demo - 39 - - - - - diff --git a/src/demos/zdemo_excel43.prog.abap b/src/demos/zdemo_excel43.prog.abap deleted file mode 100644 index b39eaf532..000000000 --- a/src/demos/zdemo_excel43.prog.abap +++ /dev/null @@ -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. diff --git a/src/demos/zdemo_excel43.prog.xml b/src/demos/zdemo_excel43.prog.xml deleted file mode 100644 index 2e95fa3ea..000000000 --- a/src/demos/zdemo_excel43.prog.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - ZDEMO_EXCEL43 - 1 - E - X - X - - - - R - abap2xlsx Demo: Demo 43 GET_TABLE - 33 - - - S - P_FILE - Excel file - 18 - - - S - P_SKIP_B - Skip bottom empty rows - 30 - - - - - diff --git a/src/demos/zdemo_excel44.prog.abap b/src/demos/zdemo_excel44.prog.abap deleted file mode 100644 index da052a473..000000000 --- a/src/demos/zdemo_excel44.prog.abap +++ /dev/null @@ -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' ). diff --git a/src/demos/zdemo_excel44.prog.xml b/src/demos/zdemo_excel44.prog.xml deleted file mode 100644 index f58e91908..000000000 --- a/src/demos/zdemo_excel44.prog.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - ZDEMO_EXCEL44 - 1 - T - E - X - X - - - - I - B44 - Testing empty file option - 50 - - - R - abap2xlsx Demo: Demo excel 44 - 29 - - - S - P_MTYFIL - No data => No empty line - 32 - - - - - diff --git a/src/demos/zdemo_excel45.prog.abap b/src/demos/zdemo_excel45.prog.abap deleted file mode 100644 index 4f9bb7767..000000000 --- a/src/demos/zdemo_excel45.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel45.prog.xml b/src/demos/zdemo_excel45.prog.xml deleted file mode 100644 index 59ff64768..000000000 --- a/src/demos/zdemo_excel45.prog.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - ZDEMO_EXCEL45 - 1 - E - X - X - - - - R - abap2xlsx Demo: Show Dropdown - 29 - - - - - diff --git a/src/demos/zdemo_excel46.prog.abap b/src/demos/zdemo_excel46.prog.abap deleted file mode 100644 index 9191d6cab..000000000 --- a/src/demos/zdemo_excel46.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel46.prog.xml b/src/demos/zdemo_excel46.prog.xml deleted file mode 100644 index 3451d5719..000000000 --- a/src/demos/zdemo_excel46.prog.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - ZDEMO_EXCEL46 - 1 - E - X - X - - - - R - abap2xlsx Demo: Validation Style Warning - 40 - - - - - diff --git a/src/demos/zdemo_excel47.prog.abap b/src/demos/zdemo_excel47.prog.abap deleted file mode 100644 index 539890a37..000000000 --- a/src/demos/zdemo_excel47.prog.abap +++ /dev/null @@ -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: 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 . - CASE -fieldname. - WHEN 'CARRID'. - -scrtext_l = 'Company ID'. - WHEN 'AIRFARE'. - -scrtext_l = 'Airfare'. - WHEN 'PRICE'. - -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 - -scrtext_l = 'Formula and aggregate function'. - -formula = abap_true. - -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 - -scrtext_l = 'Formula except 1 cell & aggregate fu.'. - -formula = abap_true. - -column_formula = lv_f1. " to apply to future rows - -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. - -scrtext_l = 'Column formula and aggregate function'. - -column_formula = 'TblSheet1[[#This Row],[Airfare]]+222'. " [@Airfare]+222 - -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. - -scrtext_l = 'C2. Column formula'. - -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. - -scrtext_l = 'C3. Column formula & aggregate function'. - -column_formula = 'D2+100'. - -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. - -scrtext_l = 'C4. Column formula array fu./named range'. - -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. - -scrtext_l = 'C5. Column formula refers to other sheet'. - -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],"") - -scrtext_l = 'C6. Column formula array fu./other sheet'. - -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],"") - -scrtext_l = 'C7. Column formula array fu./same sheet'. - -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 . - CASE -fieldname. - WHEN 'CARRID'. - -scrtext_l = 'Company ID'. - WHEN 'CARRNAME'. - -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. diff --git a/src/demos/zdemo_excel47.prog.xml b/src/demos/zdemo_excel47.prog.xml deleted file mode 100644 index 3469526ff..000000000 --- a/src/demos/zdemo_excel47.prog.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - ZDEMO_EXCEL47 - S - D$ - 1 - E - X - D$S - X - - - - R - abap2xlsx Demo: Table Calculated Columns (from Excel 365 or 2019) - 65 - - - - - diff --git a/src/demos/zdemo_excel48.prog.abap b/src/demos/zdemo_excel48.prog.abap deleted file mode 100644 index 17924f22e..000000000 --- a/src/demos/zdemo_excel48.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel48.prog.xml b/src/demos/zdemo_excel48.prog.xml deleted file mode 100644 index 6e6c3c23c..000000000 --- a/src/demos/zdemo_excel48.prog.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - ZDEMO_EXCEL48 - S - D$ - 1 - X - D$S - X - - - - R - abap2xlsx Demo: multiple styles in one cell - 43 - - - - - diff --git a/src/demos/zdemo_excel49.prog.abap b/src/demos/zdemo_excel49.prog.abap deleted file mode 100644 index 00dfc8c94..000000000 --- a/src/demos/zdemo_excel49.prog.abap +++ /dev/null @@ -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 ). diff --git a/src/demos/zdemo_excel49.prog.xml b/src/demos/zdemo_excel49.prog.xml deleted file mode 100644 index 12490241a..000000000 --- a/src/demos/zdemo_excel49.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL49 - S - 1 - X - D$S - X - - - - R - abap2xlsx Demo: Bind Table with field having Conversion Exit - 60 - - - - - diff --git a/src/demos/zdemo_excel5.prog.abap b/src/demos/zdemo_excel5.prog.abap deleted file mode 100644 index cb87e2a37..000000000 --- a/src/demos/zdemo_excel5.prog.abap +++ /dev/null @@ -1,79 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_EXCEL5 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_excel5. - -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. - -DATA: ls_iconset TYPE zexcel_conditional_iconset. - - - -CONSTANTS: gc_save_file_name TYPE string VALUE '05_Conditional.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - - -START-OF-SELECTION. - - CREATE OBJECT lo_excel. - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - - - ls_iconset-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights2. - 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 = '33'. - ls_iconset-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset-cfvo3_value = '66'. - ls_iconset-showvalue = zcl_excel_style_cond=>c_showvalue_true. - - lo_style_cond->mode_iconset = ls_iconset. - lo_style_cond->set_range( ip_start_column = 'C' - ip_start_row = 4 - ip_stop_column = 'C' - ip_stop_row = 8 ). - - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 100 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 1000 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 150 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 500 ). - - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights2. - ls_iconset-showvalue = zcl_excel_style_cond=>c_showvalue_false. - lo_style_cond->mode_iconset = ls_iconset. - lo_style_cond->set_range( ip_start_column = 'E' - ip_start_row = 4 - ip_stop_column = 'E' - ip_stop_row = 8 ). - - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = 100 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'E' ip_value = 1000 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'E' ip_value = 150 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'E' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'E' ip_value = 500 ). - - - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel5.prog.xml b/src/demos/zdemo_excel5.prog.xml deleted file mode 100644 index 313bf335f..000000000 --- a/src/demos/zdemo_excel5.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL5 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Conditinal formating - 37 - - - - - diff --git a/src/demos/zdemo_excel6.prog.abap b/src/demos/zdemo_excel6.prog.abap deleted file mode 100644 index 9486b5662..000000000 --- a/src/demos/zdemo_excel6.prog.abap +++ /dev/null @@ -1,61 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_EXCEL6 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_excel6. - -DATA: lo_excel TYPE REF TO zcl_excel, - lo_worksheet TYPE REF TO zcl_excel_worksheet, - lv_row TYPE i, - lv_formula TYPE string. - - -CONSTANTS: gc_save_file_name TYPE string VALUE '06_Formulas.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - - -START-OF-SELECTION. - - CREATE OBJECT lo_excel. - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - -*--------------------------------------------------------------------* -* Get some testdata -*--------------------------------------------------------------------* - lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 100 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 1000 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 150 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = -10 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 500 ). - - -*--------------------------------------------------------------------* -* Demonstrate using formulas -*--------------------------------------------------------------------* - lo_worksheet->set_cell( ip_row = 9 ip_column = 'C' ip_formula = 'SUM(C4:C8)' ). - - -*--------------------------------------------------------------------* -* Demonstrate standard EXCEL-behaviour when copying a formula to another cell -* by calculating the resulting formula to put into another cell -*--------------------------------------------------------------------* - DO 10 TIMES. - - lv_formula = zcl_excel_common=>shift_formula( iv_reference_formula = 'SUM(C4:C8)' - iv_shift_cols = 0 " Offset in Columns - here we copy in same column --> 0 - iv_shift_rows = sy-index ). " Offset in Row - here we copy downward --> sy-index - lv_row = 9 + sy-index. " Absolute row = sy-index rows below reference cell - lo_worksheet->set_cell( ip_row = lv_row ip_column = 'C' ip_formula = lv_formula ). - - ENDDO. - -*--------------------------------------------------------------------* -*** Create output -*--------------------------------------------------------------------* - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel6.prog.xml b/src/demos/zdemo_excel6.prog.xml deleted file mode 100644 index fcefb97b9..000000000 --- a/src/demos/zdemo_excel6.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL6 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Formulas - 25 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel7.prog.abap b/src/demos/zdemo_excel7.prog.abap deleted file mode 100644 index 3900a3210..000000000 --- a/src/demos/zdemo_excel7.prog.abap +++ /dev/null @@ -1,425 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_EXCEL7 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_excel7. - -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. - -DATA: ls_iconset3 TYPE zexcel_conditional_iconset, - ls_iconset4 TYPE zexcel_conditional_iconset, - ls_iconset5 TYPE zexcel_conditional_iconset, - ls_databar TYPE zexcel_conditional_databar, - ls_colorscale2 TYPE zexcel_conditional_colorscale, - ls_colorscale3 TYPE zexcel_conditional_colorscale. - -CONSTANTS: gc_save_file_name TYPE string VALUE '07_ConditionalAll.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - - -START-OF-SELECTION. - - CREATE OBJECT lo_excel. - - ls_iconset3-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset3-cfvo1_value = '0'. - ls_iconset3-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset3-cfvo2_value = '33'. - ls_iconset3-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset3-cfvo3_value = '66'. - ls_iconset3-showvalue = zcl_excel_style_cond=>c_showvalue_true. - - ls_iconset4-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset4-cfvo1_value = '0'. - ls_iconset4-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset4-cfvo2_value = '25'. - ls_iconset4-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset4-cfvo3_value = '50'. - ls_iconset4-cfvo4_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset4-cfvo4_value = '75'. - ls_iconset4-showvalue = zcl_excel_style_cond=>c_showvalue_true. - - ls_iconset5-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset5-cfvo1_value = '0'. - ls_iconset5-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset5-cfvo2_value = '20'. - ls_iconset5-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset5-cfvo3_value = '40'. - ls_iconset5-cfvo4_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset5-cfvo4_value = '60'. - ls_iconset5-cfvo5_type = zcl_excel_style_cond=>c_cfvo_type_percent. - ls_iconset5-cfvo5_value = '80'. - ls_iconset5-showvalue = zcl_excel_style_cond=>c_showvalue_true. - - ls_databar-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_min. - ls_databar-cfvo1_value = '0'. - ls_databar-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_max. - ls_databar-cfvo2_value = '0'. - ls_databar-colorrgb = 'FF638EC6'. - - ls_colorscale2-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_min. - ls_colorscale2-cfvo1_value = '0'. - ls_colorscale2-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percentile. - ls_colorscale2-cfvo2_value = '50'. - ls_colorscale2-colorrgb1 = 'FFF8696B'. - ls_colorscale2-colorrgb2 = 'FF63BE7B'. - - ls_colorscale3-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_min. - ls_colorscale3-cfvo1_value = '0'. - ls_colorscale3-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percentile. - ls_colorscale3-cfvo2_value = '50'. - ls_colorscale3-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_max. - ls_colorscale3-cfvo3_value = '0'. - ls_colorscale3-colorrgb1 = 'FFF8696B'. - ls_colorscale3-colorrgb2 = 'FFFFEB84'. - ls_colorscale3-colorrgb3 = 'FF63BE7B'. - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - -* ICONSET - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3arrows. - - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'B' - ip_start_row = 5 - ip_stop_column = 'B' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'C_ICONSET_3ARROWS' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'B' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'B' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'B' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'B' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3arrowsgray. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'C' - ip_start_row = 5 - ip_stop_column = 'C' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'C_ICONSET_3ARROWSGRAY' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'C' ip_value = 50 ). - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3flags. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'D' - ip_start_row = 5 - ip_stop_column = 'D' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = 'C_ICONSET_3FLAGS' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'D' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'D' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'D' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'D' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'D' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'E' - ip_start_row = 5 - ip_stop_column = 'E' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = 'C_ICONSET_3TRAFFICLIGHTS' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'E' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'E' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'E' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'E' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'E' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights2. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'F' - ip_start_row = 5 - ip_stop_column = 'F' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'F' ip_value = 'C_ICONSET_3TRAFFICLIGHTS2' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'F' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'F' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'F' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'F' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'F' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3signs. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'G' - ip_start_row = 5 - ip_stop_column = 'G' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'G' ip_value = 'C_ICONSET_3SIGNS' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'G' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'G' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'G' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'G' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'G' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3symbols. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'H' - ip_start_row = 5 - ip_stop_column = 'H' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'H' ip_value = 'C_ICONSET_3SYMBOLS' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'H' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'H' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'H' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'H' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'H' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3symbols2. - lo_style_cond->mode_iconset = ls_iconset3. - lo_style_cond->set_range( ip_start_column = 'I' - ip_start_row = 5 - ip_stop_column = 'I' - ip_stop_row = 9 ). - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'I' ip_value = 'C_ICONSET_3SYMBOLS2' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'I' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'I' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'I' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'I' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 9 ip_column = 'I' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4arrows. - lo_style_cond->mode_iconset = ls_iconset4. - lo_style_cond->set_range( ip_start_column = 'B' - ip_start_row = 12 - ip_stop_column = 'B' - ip_stop_row = 16 ). - - lo_worksheet->set_cell( ip_row = 11 ip_column = 'B' ip_value = 'C_ICONSET_4ARROWS' ). - lo_worksheet->set_cell( ip_row = 12 ip_column = 'B' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 13 ip_column = 'B' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 14 ip_column = 'B' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 15 ip_column = 'B' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 16 ip_column = 'B' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4arrowsgray. - lo_style_cond->mode_iconset = ls_iconset4. - lo_style_cond->set_range( ip_start_column = 'C' - ip_start_row = 12 - ip_stop_column = 'C' - ip_stop_row = 16 ). - - lo_worksheet->set_cell( ip_row = 11 ip_column = 'C' ip_value = 'C_ICONSET_4ARROWSGRAY' ). - lo_worksheet->set_cell( ip_row = 12 ip_column = 'C' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 13 ip_column = 'C' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 14 ip_column = 'C' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 15 ip_column = 'C' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 16 ip_column = 'C' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4redtoblack. - lo_style_cond->mode_iconset = ls_iconset4. - lo_style_cond->set_range( ip_start_column = 'D' - ip_start_row = 12 - ip_stop_column = 'D' - ip_stop_row = 16 ). - - lo_worksheet->set_cell( ip_row = 11 ip_column = 'D' ip_value = 'C_ICONSET_4REDTOBLACK' ). - lo_worksheet->set_cell( ip_row = 12 ip_column = 'D' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 13 ip_column = 'D' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 14 ip_column = 'D' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 15 ip_column = 'D' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 16 ip_column = 'D' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4rating. - lo_style_cond->mode_iconset = ls_iconset4. - lo_style_cond->set_range( ip_start_column = 'E' - ip_start_row = 12 - ip_stop_column = 'E' - ip_stop_row = 16 ). - - lo_worksheet->set_cell( ip_row = 11 ip_column = 'E' ip_value = 'C_ICONSET_4RATING' ). - lo_worksheet->set_cell( ip_row = 12 ip_column = 'E' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 13 ip_column = 'E' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 14 ip_column = 'E' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 15 ip_column = 'E' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 16 ip_column = 'E' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4trafficlights. - lo_style_cond->mode_iconset = ls_iconset4. - lo_style_cond->set_range( ip_start_column = 'F' - ip_start_row = 12 - ip_stop_column = 'F' - ip_stop_row = 16 ). - - lo_worksheet->set_cell( ip_row = 11 ip_column = 'F' ip_value = 'C_ICONSET_4TRAFFICLIGHTS' ). - lo_worksheet->set_cell( ip_row = 12 ip_column = 'F' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 13 ip_column = 'F' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 14 ip_column = 'F' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 15 ip_column = 'F' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 16 ip_column = 'F' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5arrows. - lo_style_cond->mode_iconset = ls_iconset5. - lo_style_cond->set_range( ip_start_column = 'B' - ip_start_row = 19 - ip_stop_column = 'B' - ip_stop_row = 23 ). - - lo_worksheet->set_cell( ip_row = 18 ip_column = 'B' ip_value = 'C_ICONSET_5ARROWS' ). - lo_worksheet->set_cell( ip_row = 19 ip_column = 'B' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 20 ip_column = 'B' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 21 ip_column = 'B' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 22 ip_column = 'B' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 23 ip_column = 'B' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5arrowsgray. - lo_style_cond->mode_iconset = ls_iconset5. - lo_style_cond->set_range( ip_start_column = 'C' - ip_start_row = 19 - ip_stop_column = 'C' - ip_stop_row = 23 ). - - lo_worksheet->set_cell( ip_row = 18 ip_column = 'C' ip_value = 'C_ICONSET_5ARROWSGRAY' ). - lo_worksheet->set_cell( ip_row = 19 ip_column = 'C' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 20 ip_column = 'C' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 21 ip_column = 'C' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 22 ip_column = 'C' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 23 ip_column = 'C' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5rating. - lo_style_cond->mode_iconset = ls_iconset5. - lo_style_cond->set_range( ip_start_column = 'D' - ip_start_row = 19 - ip_stop_column = 'D' - ip_stop_row = 23 ). - - lo_worksheet->set_cell( ip_row = 18 ip_column = 'D' ip_value = 'C_ICONSET_5RATING' ). - lo_worksheet->set_cell( ip_row = 19 ip_column = 'D' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 20 ip_column = 'D' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 21 ip_column = 'D' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 22 ip_column = 'D' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 23 ip_column = 'D' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. - lo_style_cond->priority = 1. - ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5quarters. - lo_style_cond->mode_iconset = ls_iconset5. - lo_style_cond->set_range( ip_start_column = 'E' - ip_start_row = 19 - ip_stop_column = 'E' - ip_stop_row = 23 ). - -* DATABAR - - lo_worksheet->set_cell( ip_row = 25 ip_column = 'B' ip_value = 'DATABAR' ). - lo_worksheet->set_cell( ip_row = 26 ip_column = 'B' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 27 ip_column = 'B' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 28 ip_column = 'B' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 29 ip_column = 'B' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 30 ip_column = 'B' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_databar. - lo_style_cond->priority = 1. - lo_style_cond->mode_databar = ls_databar. - lo_style_cond->set_range( ip_start_column = 'B' - ip_start_row = 26 - ip_stop_column = 'B' - ip_stop_row = 30 ). - -* COLORSCALE - - lo_worksheet->set_cell( ip_row = 25 ip_column = 'C' ip_value = 'COLORSCALE 2 COLORS' ). - lo_worksheet->set_cell( ip_row = 26 ip_column = 'C' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 27 ip_column = 'C' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 28 ip_column = 'C' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 29 ip_column = 'C' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 30 ip_column = 'C' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_colorscale. - lo_style_cond->priority = 1. - lo_style_cond->mode_colorscale = ls_colorscale2. - lo_style_cond->set_range( ip_start_column = 'C' - ip_start_row = 26 - ip_stop_column = 'C' - ip_stop_row = 30 ). - - - lo_worksheet->set_cell( ip_row = 25 ip_column = 'D' ip_value = 'COLORSCALE 3 COLORS' ). - lo_worksheet->set_cell( ip_row = 26 ip_column = 'D' ip_value = 10 ). - lo_worksheet->set_cell( ip_row = 27 ip_column = 'D' ip_value = 20 ). - lo_worksheet->set_cell( ip_row = 28 ip_column = 'D' ip_value = 30 ). - lo_worksheet->set_cell( ip_row = 29 ip_column = 'D' ip_value = 40 ). - lo_worksheet->set_cell( ip_row = 30 ip_column = 'D' ip_value = 50 ). - - lo_style_cond = lo_worksheet->add_new_style_cond( ). - lo_style_cond->rule = zcl_excel_style_cond=>c_rule_colorscale. - lo_style_cond->priority = 1. - lo_style_cond->mode_colorscale = ls_colorscale3. - lo_style_cond->set_range( ip_start_column = 'D' - ip_start_row = 26 - ip_stop_column = 'D' - ip_stop_row = 30 ). - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel7.prog.xml b/src/demos/zdemo_excel7.prog.xml deleted file mode 100644 index 1b639d3cc..000000000 --- a/src/demos/zdemo_excel7.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL7 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: All conditional formating possibilities - 56 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel8.prog.abap b/src/demos/zdemo_excel8.prog.abap deleted file mode 100644 index 3c92f3cb0..000000000 --- a/src/demos/zdemo_excel8.prog.abap +++ /dev/null @@ -1,71 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_EXCEL8 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_excel8. - -DATA: lo_excel TYPE REF TO zcl_excel, - lo_worksheet TYPE REF TO zcl_excel_worksheet, - lo_range TYPE REF TO zcl_excel_range. - -DATA: lv_title TYPE zexcel_sheet_title. - -CONSTANTS: gc_save_file_name TYPE string VALUE '08_Range.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - - -START-OF-SELECTION. - - CREATE OBJECT lo_excel. - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lv_title = 'Sheet1'. - lo_worksheet->set_title( lv_title ). - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'range'. - lo_range->set_value( ip_sheet_name = lv_title - ip_start_column = 'C' - ip_start_row = 4 - ip_stop_column = 'C' - ip_stop_row = 8 ). - - - lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'Apple' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 'Banana' ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 'Blueberry' ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Ananas' ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Grapes' ). - - " Define another Range with a name longer than 40 characters that - " tests the fix of issue #168 ranges namescan be only up to 20 chars - - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'A_range_with_a_name_that_is_longer_than_20_characters'. - lo_range->set_value( ip_sheet_name = lv_title - ip_start_column = 'D' - ip_start_row = 4 - ip_stop_column = 'D' - ip_stop_row = 5 ). - lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = 'Range Value 1' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'D' ip_value = 'Range Value 2' ). - - " issue #163 - " Define another Range with sheet visibility - lo_range = lo_worksheet->add_new_range( ). - lo_range->name = 'A_range_with_sheet_visibility'. - lo_range->set_value( ip_sheet_name = lv_title - ip_start_column = 'E' - ip_start_row = 4 - ip_stop_column = 'E' - ip_stop_row = 5 ). - lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = 'Range Value 3' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'E' ip_value = 'Range Value 4' ). - " issue #163 - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel8.prog.xml b/src/demos/zdemo_excel8.prog.xml deleted file mode 100644 index 568f5570f..000000000 --- a/src/demos/zdemo_excel8.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_EXCEL8 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Define a range - 31 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_excel9.prog.abap b/src/demos/zdemo_excel9.prog.abap deleted file mode 100644 index feb6d7955..000000000 --- a/src/demos/zdemo_excel9.prog.abap +++ /dev/null @@ -1,203 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_EXCEL9 -*& -*&---------------------------------------------------------------------* -*& abap2xlsx Demo: Data validations -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_excel9. - -CONSTANTS: c_fruits TYPE string VALUE 'Fruits', - c_vegetables TYPE string VALUE 'Vegetables', - c_meat TYPE string VALUE 'Meat', - c_fish TYPE string VALUE 'Fish'. - -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. - -DATA: row TYPE zexcel_cell_row. - - -DATA: lv_title TYPE zexcel_sheet_title. - - -CONSTANTS: gc_save_file_name TYPE string VALUE '09_DataValidation.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - -PARAMETERS: p_sbook TYPE flag. - - -START-OF-SELECTION. - - " Creates active sheet - CREATE OBJECT lo_excel. - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lv_title = 'Data Validation'. - 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 ). - - lo_worksheet->set_cell( ip_row = 2 ip_column = 'B' ip_value = c_meat ). - lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'Pork' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 'Beef' ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'B' ip_value = 'Chicken' ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'B' ip_value = 'Turkey' ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = c_meat. - lo_range->set_value( ip_sheet_name = lv_title - ip_start_column = 'B' - ip_start_row = 4 - ip_stop_column = 'B' - ip_stop_row = 7 ). - - lo_worksheet->set_cell( ip_row = 2 ip_column = 'C' ip_value = c_fruits ). - lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'Apple' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 'Banana' ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 'Blueberry' ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Ananas' ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Grapes' ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = c_fruits. - lo_range->set_value( ip_sheet_name = lv_title - ip_start_column = 'C' - ip_start_row = 4 - ip_stop_column = 'C' - ip_stop_row = 8 ). - - lo_worksheet->set_cell( ip_row = 2 ip_column = 'D' ip_value = c_vegetables ). - lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = 'Cucumber' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'D' ip_value = 'Sweet pepper ' ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'D' ip_value = 'Lettuce' ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = c_vegetables. - lo_range->set_value( ip_sheet_name = lv_title - ip_start_column = 'D' - ip_start_row = 4 - ip_stop_column = 'D' - ip_stop_row = 6 ). - - lo_worksheet = lo_excel->add_new_worksheet( ). - lv_title = 'Table with Data Validation'. - lo_worksheet->set_title( lv_title ). - - " Maximum Text length - lo_worksheet->set_cell( ip_row = 1 ip_column = 'A' ip_value = 'Validate Maximum Text length of <= 10 in Cell A2:' ). - lo_worksheet->set_cell( ip_row = 2 ip_column = 'A' ip_value = 'abcdefghij' ). - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_textlength. - lo_data_validation->operator = zcl_excel_data_validation=>c_operator_lessthanorequal. - lo_data_validation->formula1 = 10. - lo_data_validation->cell_row = 2. - lo_data_validation->cell_column = 'A'. - - " Integer Value between 1 and 10 - lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 'Validate Integer Value between 1 and 10 in Cell A5:' ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = '5' ). - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_whole. - lo_data_validation->operator = zcl_excel_data_validation=>c_operator_between. - lo_data_validation->formula1 = 1. - lo_data_validation->formula2 = 10. - lo_data_validation->prompttitle = 'Range'. - lo_data_validation->prompt = 'Enter a value between 1 and 10'. - lo_data_validation->errortitle = 'Error'. - lo_data_validation->error = 'You have entered a wrong value. Please use only numbers between 1 and 10.'. - lo_data_validation->cell_row = 5. - lo_data_validation->cell_column = 'A'. - - " Evaluation by Formula from issue #161 - lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 'Validate if B8 contains a "-":' ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 'Text' ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'B' ip_value = '-' ). - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_custom. - lo_data_validation->formula1 = '"IF(B8<>"""";INDIRECT(LEFT(B8;SEARCH(""-"";B8;1)));EMPTY)"'. - lo_data_validation->cell_row = 8. - lo_data_validation->cell_column = 'A'. - - " There was an error when data validation was combined with cell merges this should test that: - lo_worksheet->set_cell( ip_row = 10 ip_column = 'A' ip_value = 'Demo for data validation with a dropdown list' ). - lo_worksheet->set_merge( ip_row = 10 ip_column_start = 'A' ip_column_end = 'F' ). - - " Headlines - lo_worksheet->set_cell( ip_row = 11 ip_column = 'A' ip_value = c_fruits ). - lo_worksheet->set_cell( ip_row = 11 ip_column = 'B' ip_value = c_vegetables ). - - row = 12. - WHILE row < 20. " Starting with 14500 the data validation is dropped 14000 are still ok - " 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_fruits. - lo_data_validation->cell_row = row. - lo_data_validation->cell_column = 'A'. - lo_worksheet->set_cell( ip_row = row ip_column = 'A' ip_value = 'Select a value' ). - " 2nd - 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_vegetables. - lo_data_validation->cell_row = row. - lo_data_validation->cell_column = 'B'. - lo_worksheet->set_cell( ip_row = row ip_column = 'B' ip_value = 'Select a value' ). - " 3rd - 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_meat. - lo_data_validation->cell_row = row. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = row ip_column = 'C' ip_value = 'Select a value' ). - " 4th - 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 = row. - lo_data_validation->cell_column = 'D'. - lo_worksheet->set_cell( ip_row = row ip_column = 'D' ip_value = 'Select a value' ). - " Increment row - row = row + 1. - ENDWHILE. - - IF p_sbook = abap_true. - DATA: bookings TYPE TABLE OF sbook. - - lo_worksheet = lo_excel->add_new_worksheet( ). - lv_title = 'SBOOK'. - lo_worksheet->set_title( lv_title ). - - SELECT * FROM sbook INTO TABLE bookings UP TO 4000 ROWS. - - lo_worksheet->bind_table( - EXPORTING - ip_table = bookings -* it_field_catalog = " Table binding field catalog -* is_table_settings = " Excel table binding settings -* IMPORTING -* es_table_settings = " Excel table binding settings - ). - ENDIF. - - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel9.prog.xml b/src/demos/zdemo_excel9.prog.xml deleted file mode 100644 index dbde53ee3..000000000 --- a/src/demos/zdemo_excel9.prog.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - ZDEMO_EXCEL9 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Data validations - 33 - - - S - P_PATH - . - 24 - D - - - S - P_SBOOK - Export SBOOK to Excel? - 30 - - - - - diff --git a/src/demos/zdemo_excel_checker.prog.abap b/src/demos/zdemo_excel_checker.prog.abap deleted file mode 100644 index ec4d8b6c1..000000000 --- a/src/demos/zdemo_excel_checker.prog.abap +++ /dev/null @@ -1,1388 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report zdemo_excel_checker -*&---------------------------------------------------------------------* -*& -*&---------------------------------------------------------------------* -REPORT zdemo_excel_checker. - -CLASS lcl_zip_cleanup_for_diff DEFINITION - CREATE PUBLIC . - - PUBLIC SECTION. - - TYPES : BEGIN OF ty_zip_structure, - ref_to_structure TYPE REF TO data, - ref_to_x TYPE REF TO data, - length TYPE i, - view TYPE REF TO cl_abap_view_offlen, - charset_bit TYPE i, - conv_in_utf8 TYPE REF TO cl_abap_conv_in_ce, - conv_in_ibm437 TYPE REF TO cl_abap_conv_in_ce, - conv_out_utf8 TYPE REF TO cl_abap_conv_out_ce, - conv_out_ibm437 TYPE REF TO cl_abap_conv_out_ce, - END OF ty_zip_structure. - - METHODS run - IMPORTING - zip_xstring TYPE xstring - RETURNING - VALUE(result) TYPE xstring - RAISING - zcx_excel. - - PRIVATE SECTION. - - METHODS init_structure - IMPORTING - length TYPE i - charset_bit TYPE i - structure TYPE any - RETURNING - VALUE(result) TYPE ty_zip_structure. - - METHODS write_zip - IMPORTING - offset TYPE i - CHANGING - zip_structure TYPE ty_zip_structure - zip_xstring TYPE xstring. - - METHODS read_zip - IMPORTING - zip_xstring TYPE xstring - offset TYPE i - CHANGING - zip_structure TYPE ty_zip_structure. - -ENDCLASS. - - -CLASS lcl_xlsx_cleanup_for_diff DEFINITION - CREATE PUBLIC . - - PUBLIC SECTION. - - METHODS run - IMPORTING - xstring TYPE xstring - - RETURNING - VALUE(result) TYPE xstring - RAISING - zcx_excel. - -ENDCLASS. - - -CLASS lcl_app DEFINITION. - - PUBLIC SECTION. - - METHODS at_selection_screen. - - METHODS at_selection_screen_on_exit. - - METHODS at_selection_screen_output. - - METHODS set_sscrfields - CHANGING - sscrfields TYPE sscrfields. - - PRIVATE SECTION. - - TYPES : BEGIN OF ty_demo, - program TYPE trdir-name, - objid TYPE wwwdata-objid, - text TYPE wwwdata-text, - filename TYPE string, - END OF ty_demo, - ty_demos TYPE STANDARD TABLE OF ty_demo WITH DEFAULT KEY, - BEGIN OF ty_check_result, - diff TYPE abap_bool, - xlsx_just_now TYPE xstring, - xlsx_reference TYPE xstring, - compare_xlsx_just_now TYPE xstring, - compare_xlsx_reference TYPE xstring, - END OF ty_check_result, - BEGIN OF ty_alv_line, - status_icon TYPE string, - xlsx_diff TYPE string, - write_smw0 TYPE string, - objid TYPE wwwdata-objid, - obj_text TYPE wwwdata-text, - program TYPE trdir-name, - prog_text TYPE trdirt-text, - filename TYPE string, - xlsx_just_now TYPE xstring, - xlsx_reference TYPE xstring, - compare_xlsx_just_now TYPE xstring, - compare_xlsx_reference TYPE xstring, - cell_types TYPE salv_t_int4_column, - END OF ty_alv_line, - ty_alv_table TYPE STANDARD TABLE OF ty_alv_line WITH DEFAULT KEY, - ty_popup_confirm_question TYPE c LENGTH 400. - - METHODS at_selection_screen_output1000. - - METHODS at_selection_screen_output1001 - RAISING - zcx_excel - cx_salv_data_error - cx_salv_not_found - cx_salv_msg. - - METHODS check_regression - IMPORTING - demo TYPE ty_demo - RETURNING - VALUE(result) TYPE ty_check_result - RAISING - zcx_excel. - - METHODS get_list_of_demo_files - RETURNING - VALUE(result) TYPE ty_demos. - - METHODS gui_upload - IMPORTING - file_name TYPE string - RETURNING - VALUE(result) TYPE xstring - RAISING - zcx_excel. - - METHODS load_alv_table - RAISING - zcx_excel. - - METHODS on_link_clicked FOR EVENT link_click OF cl_salv_events_table IMPORTING column row. - - METHODS popup_confirm - IMPORTING - question TYPE ty_popup_confirm_question - RAISING - zcx_excel. - - METHODS read_screen_fields. - - METHODS read_xlsx_from_web_repository - IMPORTING - objid TYPE wwwdata-objid - RETURNING - VALUE(result) TYPE xstring - RAISING - zcx_excel. - - METHODS screen_1001_pbo_first_time - RAISING - cx_salv_data_error - cx_salv_msg - cx_salv_not_found - zcx_excel . - - METHODS write_screen_fields. - - METHODS write_xlsx_to_web_repository - IMPORTING - objid TYPE wwwdata-objid - text TYPE wwwdata-text - xstring TYPE xstring - filename TYPE clike - RAISING - zcx_excel. - - DATA: ref_sscrfields TYPE REF TO sscrfields, - p_path TYPE zexcel_export_dir, - splitter TYPE REF TO cl_gui_splitter_container, - alv_container TYPE REF TO cl_gui_container, - zip_diff_container TYPE REF TO cl_gui_container, - viewer TYPE REF TO object, - salv TYPE REF TO cl_salv_table, - alv_table TYPE ty_alv_table, - lv_filesep TYPE c LENGTH 1. - -ENDCLASS. - - - -CLASS lcl_zip_cleanup_for_diff IMPLEMENTATION. - - - METHOD run. - - TYPES : BEGIN OF ty_local_file_header, - local_file_header_signature TYPE x LENGTH 4, " 04034b50 - version_needed_to_extract TYPE x LENGTH 2, - general_purpose_bit_flag TYPE x LENGTH 2, - compression_method TYPE x LENGTH 2, - last_mod_file_time TYPE int2, - last_mod_file_date TYPE int2, - crc_32 TYPE x LENGTH 4, - compressed_size TYPE i, - uncompressed_size TYPE i, - file_name_length TYPE int2, - extra_field_length TYPE int2, - " file name (variable size) - " extra field (variable size) - END OF ty_local_file_header, - BEGIN OF ty_central_file_header, - central_file_header_signature TYPE x LENGTH 4, " 02014b50 - version_made_by TYPE x LENGTH 2, - version_needed_to_extract TYPE x LENGTH 2, - general_purpose_bit_flag TYPE x LENGTH 2, - compression_method TYPE x LENGTH 2, - last_mod_file_time TYPE int2, - last_mod_file_date TYPE int2, - crc_32 TYPE x LENGTH 4, - compressed_size TYPE i, - uncompressed_size TYPE i, - file_name_length TYPE int2, " field 12 - extra_field_length TYPE int2, " field 13 - file_comment_length TYPE int2, " field 14 - disk_number_start TYPE int2, - internal_file_attributes TYPE x LENGTH 2, - external_file_attributes TYPE x LENGTH 4, - rel_offset_of_local_header TYPE x LENGTH 4, - " file name (variable size defined in 12) - " extra field (variable size defined in 13) - " file comment (variable size defined in 14) - END OF ty_central_file_header, - BEGIN OF ty_end_of_central_dir, - signature TYPE x LENGTH 4, " 0x06054b50 - number_of_this_disk TYPE int2, - disk_num_start_of_central_dir TYPE int2, - n_of_entries_in_central_dir_dk TYPE int2, - n_of_entries_in_central_dir TYPE int2, - size_of_central_dir TYPE i, - offset_start_of_central_dir TYPE i, - file_comment_length TYPE int2, - END OF ty_end_of_central_dir. - - FIELD-SYMBOLS: - TYPE x, - TYPE x, - TYPE x, - TYPE ty_local_file_header, - TYPE ty_central_file_header, - TYPE ty_end_of_central_dir. - CONSTANTS: - local_file_header_signature TYPE x LENGTH 4 VALUE '504B0304', - central_file_header_signature TYPE x LENGTH 4 VALUE '504B0102', - end_of_central_dir_signature TYPE x LENGTH 4 VALUE '504B0506'. - DATA: - dummy_local_file_header TYPE ty_local_file_header, - dummy_central_file_header TYPE ty_central_file_header, - dummy_end_of_central_dir TYPE ty_end_of_central_dir, - local_file_header TYPE ty_zip_structure, - central_file_header TYPE ty_zip_structure, - end_of_central_dir TYPE ty_zip_structure, - offset TYPE i, - max_offset TYPE i. - - - - local_file_header = init_structure( length = 30 charset_bit = 60 structure = dummy_local_file_header ). - ASSIGN local_file_header-ref_to_structure->* TO . - ASSIGN local_file_header-ref_to_x->* TO . - - central_file_header = init_structure( length = 46 charset_bit = 76 structure = dummy_central_file_header ). - ASSIGN central_file_header-ref_to_structure->* TO . - ASSIGN central_file_header-ref_to_x->* TO . - - end_of_central_dir = init_structure( length = 22 charset_bit = 0 structure = dummy_end_of_central_dir ). - ASSIGN end_of_central_dir-ref_to_structure->* TO . - ASSIGN end_of_central_dir-ref_to_x->* TO . - - result = zip_xstring. - - offset = 0. - max_offset = xstrlen( result ) - 4. - WHILE offset <= max_offset. - - CASE result+offset(4). - - WHEN local_file_header_signature. - - read_zip( EXPORTING zip_xstring = result offset = offset CHANGING zip_structure = local_file_header ). - - CLEAR -last_mod_file_date. - CLEAR -last_mod_file_time. - - write_zip( EXPORTING offset = offset CHANGING zip_structure = local_file_header zip_xstring = result ). - - offset = offset + local_file_header-length + -file_name_length + -extra_field_length + -compressed_size. - - WHEN central_file_header_signature. - - read_zip( EXPORTING zip_xstring = result offset = offset CHANGING zip_structure = central_file_header ). - - CLEAR -last_mod_file_date. - CLEAR -last_mod_file_time. - - write_zip( EXPORTING offset = offset CHANGING zip_structure = central_file_header zip_xstring = result ). - - offset = offset + central_file_header-length + -file_name_length + -extra_field_length + -file_comment_length. - - WHEN end_of_central_dir_signature. - - read_zip( EXPORTING zip_xstring = result offset = offset CHANGING zip_structure = end_of_central_dir ). - - offset = offset + end_of_central_dir-length + -file_comment_length. - - WHEN OTHERS. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'Invalid ZIP file'. - - ENDCASE. - - ENDWHILE. - - ENDMETHOD. - - - METHOD init_structure. - - DATA: - offset TYPE i, - rtts_struct TYPE REF TO cl_abap_structdescr. - FIELD-SYMBOLS: - TYPE abap_compdescr. - - CREATE DATA result-ref_to_structure LIKE structure. - result-length = length. - result-charset_bit = charset_bit. - CREATE DATA result-ref_to_x TYPE x LENGTH length. - - result-view = cl_abap_view_offlen=>create( ). - offset = 0. - rtts_struct ?= cl_abap_typedescr=>describe_by_data( structure ). - LOOP AT rtts_struct->components ASSIGNING . - result-view->append( off = offset len = -length ). - offset = offset + -length. - ENDLOOP. - - ENDMETHOD. - - - METHOD read_zip. - - DATA: - charset TYPE i. - FIELD-SYMBOLS: - TYPE x, - TYPE any. - - ASSIGN zip_structure-ref_to_x->* TO . - ASSIGN zip_structure-ref_to_structure->* TO . - - = zip_xstring+offset. - - IF zip_structure-charset_bit >= 1. - GET BIT zip_structure-charset_bit OF INTO charset. - ENDIF. - - IF charset = 0. - IF zip_structure-conv_in_ibm437 IS NOT BOUND. - zip_structure-conv_in_ibm437 = cl_abap_conv_in_ce=>create( - encoding = '1107' - endian = 'L' ). - ENDIF. - zip_structure-conv_in_ibm437->convert_struc( - EXPORTING input = - view = zip_structure-view - IMPORTING data = ). - ELSE. - IF zip_structure-conv_in_utf8 IS NOT BOUND. - zip_structure-conv_in_utf8 = cl_abap_conv_in_ce=>create( - encoding = '4110' - endian = 'L' ). - ENDIF. - zip_structure-conv_in_utf8->convert_struc( - EXPORTING input = - view = zip_structure-view - IMPORTING data = ). - ENDIF. - - ENDMETHOD. - - - METHOD write_zip. - - DATA: - charset TYPE i. - FIELD-SYMBOLS: - TYPE x, - TYPE any. - - ASSIGN zip_structure-ref_to_x->* TO . - ASSIGN zip_structure-ref_to_structure->* TO . - - IF zip_structure-charset_bit >= 1. - GET BIT zip_structure-charset_bit OF INTO charset. - ENDIF. - - IF charset = 0. - IF zip_structure-conv_out_ibm437 IS NOT BOUND. - zip_structure-conv_out_ibm437 = cl_abap_conv_out_ce=>create( - encoding = '1107' - endian = 'L' ). - ENDIF. - zip_structure-conv_out_ibm437->convert_struc( - EXPORTING data = - view = zip_structure-view - IMPORTING buffer = ). - ELSE. - IF zip_structure-conv_out_utf8 IS NOT BOUND. - zip_structure-conv_out_utf8 = cl_abap_conv_out_ce=>create( - encoding = '4110' - endian = 'L' ). - ENDIF. - zip_structure-conv_out_utf8->convert_struc( - EXPORTING data = - view = zip_structure-view - IMPORTING buffer = ). - ENDIF. - - REPLACE SECTION OFFSET offset LENGTH zip_structure-length OF zip_xstring WITH IN BYTE MODE. - - ENDMETHOD. - - -ENDCLASS. - - -CLASS lcl_xlsx_cleanup_for_diff IMPLEMENTATION. - - METHOD run. - - TYPES: BEGIN OF ty_docprops_core, - creator TYPE string, - description TYPE string, - last_modified_by TYPE string, - created TYPE string, - modified TYPE string, - END OF ty_docprops_core. - TYPES: BEGIN OF ty_file, - name TYPE string, - content TYPE xstring, - END OF ty_file. - DATA: zip TYPE REF TO cl_abap_zip, - content TYPE xstring, - docprops_core TYPE ty_docprops_core, - ls_file TYPE ty_file, - lt_file TYPE TABLE OF ty_file, - lo_ixml TYPE REF TO if_ixml, - lo_streamfactory TYPE REF TO if_ixml_stream_factory, - lo_istream TYPE REF TO if_ixml_istream, - lo_parser TYPE REF TO if_ixml_parser, - lo_renderer TYPE REF TO if_ixml_renderer, - lo_ostream TYPE REF TO if_ixml_ostream, - lo_document TYPE REF TO if_ixml_document, - lo_element TYPE REF TO if_ixml_element, - lo_filter TYPE REF TO if_ixml_node_filter, - lo_iterator TYPE REF TO if_ixml_node_iterator, - zip_cleanup_for_diff TYPE REF TO lcl_zip_cleanup_for_diff. - FIELD-SYMBOLS: - TYPE cl_abap_zip=>t_file, - TYPE ty_file. - - CREATE OBJECT zip. - zip->load( - EXPORTING - zip = xstring - EXCEPTIONS - zip_parse_error = 1 - OTHERS = 2 ). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'zip load'. - ENDIF. - - zip->get( - EXPORTING - name = 'docProps/core.xml' - IMPORTING - content = content - EXCEPTIONS - zip_index_error = 1 - zip_decompression_error = 2 - OTHERS = 3 ). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'docProps/core.xml not found'. - ENDIF. - - CALL TRANSFORMATION zexcel_tr_docprops_core SOURCE XML content RESULT root = docprops_core. - - CLEAR: docprops_core-creator, - docprops_core-description, - docprops_core-created, - docprops_core-modified. - - CALL TRANSFORMATION zexcel_tr_docprops_core SOURCE root = docprops_core RESULT XML content. - - zip->delete( - EXPORTING - name = 'docProps/core.xml' - EXCEPTIONS - zip_index_error = 1 - OTHERS = 2 ). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |delete before add of docProps/core.xml|. - ENDIF. - - zip->add( - name = 'docProps/core.xml' - content = content ). - - LOOP AT zip->files ASSIGNING - WHERE name CP 'xl/drawings/drawing*.xml'. - - zip->get( - EXPORTING - name = -name - IMPORTING - content = content - EXCEPTIONS - zip_index_error = 1 - zip_decompression_error = 2 - OTHERS = 3 ). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |{ -name } not found|. - ENDIF. - - lo_ixml = cl_ixml=>create( ). - lo_streamfactory = lo_ixml->create_stream_factory( ). - lo_istream = lo_streamfactory->create_istream_xstring( content ). - lo_document = lo_ixml->create_document( ). - lo_parser = lo_ixml->create_parser( - document = lo_document - istream = lo_istream - stream_factory = lo_streamfactory ). - lo_parser->parse( ). - - lo_filter = lo_document->create_filter_name_ns( - name = 'cNvPr' - namespace = 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing' ). - lo_iterator = lo_document->create_iterator_filtered( lo_filter ). - DO. - lo_element ?= lo_iterator->get_next( ). - IF lo_element IS NOT BOUND. - EXIT. - ENDIF. - lo_element->set_attribute_ns( name = 'name' value = '' ). - ENDDO. - - CLEAR content. - lo_ostream = lo_streamfactory->create_ostream_xstring( content ). - lo_renderer = lo_ixml->create_renderer( - document = lo_document - ostream = lo_ostream ). - lo_renderer->render( ). - - ls_file-name = -name. - ls_file-content = content. - APPEND ls_file TO lt_file. - - ENDLOOP. - - LOOP AT lt_file ASSIGNING . - zip->delete( name = -name ). - zip->add( name = -name content = -content ). - ENDLOOP. - - result = zip->save( ). - - CREATE OBJECT zip_cleanup_for_diff. - result = zip_cleanup_for_diff->run( result ). - - ENDMETHOD. - - -ENDCLASS. - - -CLASS lcl_app IMPLEMENTATION. - - - METHOD at_selection_screen. - - DATA: error TYPE REF TO cx_root. - - TRY. - - CASE sy-dynnr. - - WHEN 1000. - - CASE ref_sscrfields->ucomm. - - WHEN 'ONLI'. - - read_screen_fields( ). - SUBMIT zdemo_excel WITH p_path = p_path WITH p_checkr = abap_true AND RETURN. - CALL SELECTION-SCREEN 1001. - - ENDCASE. - - WHEN 1001. - - CASE ref_sscrfields->ucomm. - - WHEN 'FC01'. " REFRESH - - SUBMIT (sy-repid) WITH p_path = p_path. - - ENDCASE. - ENDCASE. - - CATCH cx_root INTO error. - MESSAGE error TYPE 'E'. - ENDTRY. - - ENDMETHOD. - - - METHOD at_selection_screen_on_exit. - - CASE sy-dynnr. - - WHEN 1001. - - CALL SELECTION-SCREEN 1000. - - ENDCASE. - - ENDMETHOD. - - - METHOD at_selection_screen_output. - - DATA: error TYPE REF TO cx_root. - - TRY. - - CASE sy-dynnr. - - WHEN 1000. - - at_selection_screen_output1000( ). - - WHEN 1001. - - at_selection_screen_output1001( ). - - ENDCASE. - - CATCH cx_root INTO error. - MESSAGE error TYPE 'I' DISPLAY LIKE 'E'. - ENDTRY. - - ENDMETHOD. - - - METHOD at_selection_screen_output1000. - - DATA: lv_workdir TYPE string. - - cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_filesep ). - - IF p_path IS INITIAL. - - cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ). - cl_gui_cfw=>flush( ). - p_path = lv_workdir. - - ENDIF. - - write_screen_fields( ). - - ENDMETHOD. - - - METHOD at_selection_screen_output1001. - - DATA: excluded_functions TYPE ui_functions. - - LOOP AT SCREEN. - screen-active = '0'. - MODIFY SCREEN. - ENDLOOP. - - ref_sscrfields->functxt_01 = icon_refresh. - - APPEND 'ONLI' TO excluded_functions. - APPEND 'PRIN' TO excluded_functions. - APPEND 'SPOS' TO excluded_functions. - CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' - EXPORTING - p_status = sy-pfkey - TABLES - p_exclude = excluded_functions. - - load_alv_table( ). - - IF alv_container IS NOT BOUND. - - screen_1001_pbo_first_time( ). - - ENDIF. - - ENDMETHOD. - - - METHOD check_regression. - - DATA: xlsx_cleanup_for_diff TYPE REF TO lcl_xlsx_cleanup_for_diff. - - - result-xlsx_just_now = gui_upload( file_name = p_path && lv_filesep && demo-filename ). - - result-xlsx_reference = read_xlsx_from_web_repository( objid = demo-objid ). - - IF result-xlsx_reference IS INITIAL. - - result-diff = abap_true. - - ELSE. - - CREATE OBJECT xlsx_cleanup_for_diff. - result-compare_xlsx_just_now = xlsx_cleanup_for_diff->run( result-xlsx_just_now ). - result-compare_xlsx_reference = xlsx_cleanup_for_diff->run( result-xlsx_reference ). - - result-diff = boolc( result-compare_xlsx_just_now <> result-compare_xlsx_reference ). - - ENDIF. - - ENDMETHOD. - - - METHOD get_list_of_demo_files. - - DATA: line TYPE ty_demo. - - line-program = 'ZDEMO_EXCEL1'. - line-objid = 'ZDEMO_EXCEL1'. - line-filename = '01_HelloWorld.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL2'. - line-objid = 'ZDEMO_EXCEL2'. - line-filename = '02_Styles.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL3'. - line-objid = 'ZDEMO_EXCEL3'. - line-filename = '03_iTab.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL4'. - line-objid = 'ZDEMO_EXCEL4'. - line-filename = '04_Sheets.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL5'. - line-objid = 'ZDEMO_EXCEL5'. - line-filename = '05_Conditional.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL6'. - line-objid = 'ZDEMO_EXCEL6'. - line-filename = '06_Formulas.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL7'. - line-objid = 'ZDEMO_EXCEL7'. - line-filename = '07_ConditionalAll.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL8'. - line-objid = 'ZDEMO_EXCEL8'. - line-filename = '08_Range.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL9'. - line-objid = 'ZDEMO_EXCEL9'. - line-filename = '09_DataValidation.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL10'. - line-objid = 'ZDEMO_EXCEL10'. - line-filename = '10_iTabFieldCatalog.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL12'. - line-objid = 'ZDEMO_EXCEL12'. - line-filename = '12_HideSizeOutlineRowsAndColumns.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL13'. - line-objid = 'ZDEMO_EXCEL13'. - line-filename = '13_MergedCells.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL14'. - line-objid = 'ZDEMO_EXCEL14'. - line-filename = '14_Alignment.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL16'. - line-objid = 'ZDEMO_EXCEL16'. - line-filename = '16_Drawings.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL17'. - line-objid = 'ZDEMO_EXCEL17'. - line-filename = '17_SheetProtection.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL18'. - line-objid = 'ZDEMO_EXCEL18'. - line-filename = '18_BookProtection.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL19'. - line-objid = 'ZDEMO_EXCEL19'. - line-filename = '19_SetActiveSheet.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL21'. - line-objid = 'ZDEMO_EXCEL21'. - line-filename = '21_BackgroundColorPicker.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL22'. - line-objid = 'ZDEMO_EXCEL22'. - line-filename = '22_itab_fieldcatalog.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL23'. - line-objid = 'ZDEMO_EXCEL23'. - line-filename = '23_Sheets_with_and_without_grid_lines.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL24'. - line-objid = 'ZDEMO_EXCEL24'. - line-filename = '24_Sheets_with_different_default_date_formats.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL27'. - line-objid = 'ZDEMO_EXCEL27'. - line-filename = '27_ConditionalFormatting.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL30'. - line-objid = 'ZDEMO_EXCEL30'. - line-filename = '30_CellDataTypes.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL31'. - line-objid = 'ZDEMO_EXCEL31'. - line-filename = '31_AutosizeWithDifferentFontSizes.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL33'. - line-objid = 'ZDEMO_EXCEL33'. - line-filename = '33_autofilter.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL34'. - line-objid = 'ZDEMO_EXCEL34'. - line-filename = '34_Static Styles_Chess.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL35'. - line-objid = 'ZDEMO_EXCEL35'. - line-filename = '35_Static_Styles.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL36'. - line-objid = 'ZDEMO_EXCEL36'. - line-filename = '36_DefaultStyles.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL37'. - line-objid = 'ZDEMO_EXCEL37'. - line-filename = '37- Read template and output.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL38'. - line-objid = 'ZDEMO_EXCEL38'. - line-filename = '38_SAP-Icons.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL39'. - line-objid = 'ZDEMO_EXCEL39'. - line-filename = '39_Charts.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL40'. - line-objid = 'ZDEMO_EXCEL40'. - line-filename = '40_Printsettings.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL41'. - line-objid = 'ZDEMO_EXCEL41'. - line-filename = 'ABAP2XLSX Inheritance.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL49'. - line-objid = 'ZDEMO_EXCEL49'. - line-filename = '49_Bind_Table_Conversion_Exit.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL_COMMENTS'. - line-objid = 'ZDEMO_EXCEL_COMMENTS'. - line-filename = 'Comments.xlsx'. - APPEND line TO result. - line-program = 'ZTEST_EXCEL_IMAGE_HEADER'. - line-objid = 'ZTEST_EXCEL_IMAGE_HEADER'. - line-filename = 'Image_Header_Footer.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_01'. - line-filename = '15_01_HelloWorldFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_02'. - line-filename = '15_02_StylesFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_03'. - line-filename = '15_03_iTabFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_04'. - line-filename = '15_04_SheetsFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_05'. - line-filename = '15_05_ConditionalFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_07'. - line-filename = '15_07_ConditionalAllFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_08'. - line-filename = '15_08_RangeFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_13'. - line-filename = '15_13_MergedCellsFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_24'. - line-filename = '15_24_Sheets_with_different_default_date_formatsFromReader.xlsx'. - APPEND line TO result. - line-program = 'ZDEMO_EXCEL15'. - line-objid = 'ZDEMO_EXCEL15_31'. - line-filename = '15_31_AutosizeWithDifferentFontSizesFromReader.xlsx'. - APPEND line TO result. - - ENDMETHOD. - - - METHOD gui_upload. - - DATA: solix_tab TYPE solix_tab, - file_length TYPE i. - - cl_gui_frontend_services=>gui_upload( - EXPORTING - filename = file_name - filetype = 'BIN' - IMPORTING - filelength = file_length - CHANGING - data_tab = solix_tab - 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. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |gui_upload error { file_name }|. - ENDIF. - - result = cl_bcs_convert=>solix_to_xstring( it_solix = solix_tab iv_size = file_length ). - - ENDMETHOD. - - - METHOD load_alv_table. - - DATA: demos TYPE ty_demos, - alv_line TYPE ty_alv_line, - cell_type TYPE salv_s_int4_column, - error TYPE REF TO cx_root, - check_result TYPE ty_check_result. - FIELD-SYMBOLS: - TYPE ty_demo. - - CLEAR alv_table. - - demos = get_list_of_demo_files( ). - LOOP AT demos ASSIGNING . - - TRY. - - CLEAR alv_line. - alv_line-objid = -objid. - alv_line-obj_text = |{ -filename } ({ -program })|. - alv_line-filename = -filename. - alv_line-program = -program. - SELECT SINGLE text FROM trdirt INTO alv_line-prog_text - WHERE sprsl = sy-langu - AND name = alv_line-program. - - check_result = check_regression( ). - - CASE check_result-diff. - WHEN abap_true. - alv_line-status_icon = '@0W\QFiles are different@'. - WHEN abap_false. - alv_line-status_icon = '@0V\QFiles are identical@'. - ENDCASE. - IF check_result-diff = abap_true. - alv_line-xlsx_diff = '@46\QShow differences@'. - alv_line-write_smw0 = '@2L\QSave XLSX to Web Repository@'. - cell_type-columnname = 'XLSX_DIFF'. - cell_type-value = if_salv_c_cell_type=>hotspot. - APPEND cell_type TO alv_line-cell_types. - cell_type-columnname = 'WRITE_SMW0'. - cell_type-value = if_salv_c_cell_type=>hotspot. - APPEND cell_type TO alv_line-cell_types. - ENDIF. - alv_line-xlsx_just_now = check_result-xlsx_just_now. - alv_line-xlsx_reference = check_result-xlsx_reference. - alv_line-compare_xlsx_just_now = check_result-compare_xlsx_just_now. - alv_line-compare_xlsx_reference = check_result-compare_xlsx_reference. - APPEND alv_line TO alv_table. - - CATCH cx_root INTO error. - alv_line-status_icon = |{ icon_cancel }{ error->get_text( ) }|. - ENDTRY. - - ENDLOOP. - - ENDMETHOD. - - - METHOD on_link_clicked. - - DATA: alv_line TYPE ty_alv_line, - error TYPE REF TO cx_root, - zip_old TYPE REF TO cl_abap_zip, - zip_new TYPE REF TO cl_abap_zip, - refresh_stable TYPE lvc_s_stbl, - question TYPE ty_popup_confirm_question. - - TRY. - - READ TABLE alv_table INDEX row INTO alv_line. - ASSERT sy-subrc = 0. - - CASE column. - - WHEN 'XLSX_DIFF'. - - TRY. - IF viewer IS NOT BOUND. - CREATE OBJECT viewer TYPE ('ZCL_ZIP_DIFF_VIEWER2') - EXPORTING - io_container = zip_diff_container. - ENDIF. - - CREATE OBJECT zip_old. - zip_old->load( - EXPORTING - zip = alv_line-compare_xlsx_reference - EXCEPTIONS - zip_parse_error = 1 - OTHERS = 2 ). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |zip load old { alv_line-obj_text }|. - ENDIF. - - CREATE OBJECT zip_new. - zip_new->load( - EXPORTING - zip = alv_line-compare_xlsx_just_now - EXCEPTIONS - zip_parse_error = 1 - OTHERS = 2 ). - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |zip load new { alv_line-filename }|. - ENDIF. - - CALL METHOD viewer->('DIFF_AND_VIEW') - EXPORTING - zip_old = zip_old - zip_new = zip_new. - - CATCH cx_root INTO error. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |Viewer error (https://github.com/sandraros/zip-diff): { error->get_text( ) }|. - ENDTRY. - - WHEN 'WRITE_SMW0'. - - question = |Are you sure you want to overwrite { alv_line-objid } in Web repository?|. - popup_confirm( question ). - - write_xlsx_to_web_repository( - objid = alv_line-objid - text = alv_line-obj_text - xstring = alv_line-xlsx_just_now - filename = alv_line-filename ). - COMMIT WORK. - - alv_line-status_icon = icon_okay. - CLEAR alv_line-xlsx_diff. - CLEAR alv_line-write_smw0. - CLEAR alv_line-cell_types. - MODIFY alv_table INDEX row FROM alv_line. - - refresh_stable-row = abap_true. - refresh_stable-col = abap_true. - salv->refresh( s_stable = refresh_stable ). - - ENDCASE. - - CATCH cx_root INTO error. - MESSAGE error TYPE 'I' DISPLAY LIKE 'E'. - ENDTRY. - - ENDMETHOD. - - - METHOD popup_confirm. - - DATA: l_answer TYPE c LENGTH 1. - - CALL FUNCTION 'POPUP_TO_CONFIRM' - EXPORTING - text_question = question - IMPORTING - answer = l_answer. "1 = button 1, 2 = button 2, A = cancel - CASE l_answer. - WHEN '2' OR 'A'. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'Action cancelled by user'. - ENDCASE. - - ENDMETHOD. - - - METHOD read_xlsx_from_web_repository. - - DATA: query_string TYPE w3query, - query_table TYPE TABLE OF w3query, - html_table TYPE TABLE OF w3html, - return_code TYPE w3param-ret_code, - content_type TYPE w3param-cont_type, - content_length TYPE w3param-cont_len, - mime_table TYPE TABLE OF w3mime. - - CLEAR: query_table, query_string. - query_string-name = '_OBJECT_ID'. - query_string-value = objid. - APPEND query_string TO query_table. - - CALL FUNCTION 'WWW_GET_MIME_OBJECT' - TABLES - query_string = query_table - html = html_table - mime = mime_table - CHANGING - return_code = return_code - content_type = content_type - content_length = content_length - EXCEPTIONS - object_not_found = 1 - parameter_not_found = 2 - OTHERS = 3. - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'WWW_GET_MIME_OBJECT'. - ENDIF. - - result = cl_bcs_convert=>solix_to_xstring( it_solix = mime_table iv_size = content_length ). - - ENDMETHOD. - - - METHOD read_screen_fields. - - DATA: lt_dummy TYPE TABLE OF rsparams, - lt_sel_255 TYPE TABLE OF rsparamsl_255. - FIELD-SYMBOLS: - TYPE rsparamsl_255. - - CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS' - EXPORTING - curr_report = sy-repid - TABLES - selection_table = lt_dummy - selection_table_255 = lt_sel_255 - EXCEPTIONS - not_found = 1 - no_report = 2 - OTHERS = 3. - - READ TABLE lt_sel_255 WITH KEY selname = 'P_PATH' ASSIGNING . - ASSERT sy-subrc = 0. - p_path = -low. - - ENDMETHOD. - - - METHOD screen_1001_pbo_first_time. - - DATA: columns TYPE REF TO cl_salv_columns_table, - events TYPE REF TO cl_salv_events_table. - - CREATE OBJECT splitter - EXPORTING - parent = cl_gui_container=>screen0 - rows = 1 - columns = 2 - EXCEPTIONS - cntl_error = 1 - cntl_system_error = 2 - OTHERS = 3. - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'create splitter'. - ENDIF. - - alv_container = splitter->get_container( row = 1 column = 1 ). - zip_diff_container = splitter->get_container( row = 1 column = 2 ). - - cl_salv_table=>factory( - EXPORTING - r_container = alv_container - IMPORTING - r_salv_table = salv - CHANGING - t_table = alv_table ). - - columns = salv->get_columns( ). - columns->set_cell_type_column( value = 'CELL_TYPES' ). - columns->get_column( 'STATUS_ICON' )->set_medium_text( 'Diff status' ). - columns->get_column( 'STATUS_ICON' )->set_output_length( 2 ). - columns->get_column( 'XLSX_DIFF' )->set_medium_text( 'View diff' ). - columns->get_column( 'XLSX_DIFF' )->set_output_length( 5 ). - columns->get_column( 'XLSX_DIFF' )->set_alignment( if_salv_c_alignment=>centered ). - columns->get_column( 'WRITE_SMW0' )->set_medium_text( 'Web repository' ). - columns->get_column( 'WRITE_SMW0' )->set_output_length( 5 ). - columns->get_column( 'WRITE_SMW0' )->set_alignment( if_salv_c_alignment=>centered ). - columns->get_column( 'PROGRAM' )->set_output_length( 15 ). - columns->get_column( 'PROG_TEXT' )->set_output_length( 30 ). - columns->get_column( 'OBJID' )->set_output_length( 20 ). - columns->get_column( 'OBJ_TEXT' )->set_output_length( 50 ). - columns->get_column( 'FILENAME' )->set_output_length( 50 ). - columns->get_column( 'XLSX_JUST_NOW' )->set_technical( ). - columns->get_column( 'XLSX_REFERENCE' )->set_technical( ). -columns->get_column( 'COMPARE_XLSX_JUST_NOW' )->set_technical( ). -columns->get_column( 'COMPARE_XLSX_REFERENCE' )->set_technical( ). - - events = salv->get_event( ). - SET HANDLER on_link_clicked FOR events. - - salv->display( ). - - ENDMETHOD. - - - METHOD set_sscrfields. - - GET REFERENCE OF sscrfields INTO ref_sscrfields. - - ENDMETHOD. - - - METHOD write_screen_fields. - - DATA: fieldname TYPE string. - FIELD-SYMBOLS: - TYPE simple. - - fieldname = |({ sy-repid })P_PATH|. - ASSIGN (fieldname) TO . - = p_path. - - ENDMETHOD. - - - METHOD write_xlsx_to_web_repository. - - DATA: key TYPE wwwdatatab, - mime TYPE TABLE OF w3mime, - devclass TYPE devclass, - wwwparam TYPE wwwparams, - table_of_wwwparams TYPE TABLE OF wwwparams. - - SELECT SINGLE devclass FROM tadir - INTO devclass - WHERE pgmid = 'R3TR' - AND object = 'W3MI' - AND obj_name = objid. - - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |Object must be first created manually|. - ENDIF. - - mime = cl_bcs_convert=>xstring_to_solix( xstring ). - key-relid = 'MI'. - key-objid = objid. - key-chname = sy-uname. - key-text = text. - key-tdate = sy-datum. - key-ttime = sy-uzeit. - - CALL FUNCTION 'WWWDATA_EXPORT' - EXPORTING - key = key - TABLES - mime = mime - EXCEPTIONS - wrong_object_type = 1 - export_error = 2 - OTHERS = 3. - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = 'WWWDATA_EXPORT'. - ENDIF. - - wwwparam-relid = 'MI'. - wwwparam-objid = objid. - wwwparam-name = 'mimetype'. - wwwparam-value = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'. - APPEND wwwparam TO table_of_wwwparams. - wwwparam-name = 'filename'. - wwwparam-value = filename. - APPEND wwwparam TO table_of_wwwparams. - wwwparam-name = 'filesize'. - wwwparam-value = |{ xstrlen( xstring ) }|. - APPEND wwwparam TO table_of_wwwparams. - wwwparam-name = 'version'. - wwwparam-value = |00001|. - APPEND wwwparam TO table_of_wwwparams. - wwwparam-name = 'fileextension'. - wwwparam-value = |.xlsx|. - APPEND wwwparam TO table_of_wwwparams. - - CALL FUNCTION 'WWWPARAMS_UPDATE' - TABLES - params = table_of_wwwparams - EXCEPTIONS - update_error = 1 - OTHERS = 2. - IF sy-subrc <> 0. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = |WWWPARAMS_UPDATE { objid } { filename }|. - ENDIF. - - ENDMETHOD. - - -ENDCLASS. - - - -TABLES sscrfields. -DATA: app TYPE REF TO lcl_app. - -PARAMETERS p_path TYPE zexcel_export_dir. - -SELECTION-SCREEN BEGIN OF SCREEN 1001. -SELECTION-SCREEN FUNCTION KEY 1. -PARAMETERS dummy. -SELECTION-SCREEN END OF SCREEN 1001. - -INITIALIZATION. - CREATE OBJECT app. - app->set_sscrfields( CHANGING sscrfields = sscrfields ). - -AT SELECTION-SCREEN OUTPUT. - app->at_selection_screen_output( ). - -AT SELECTION-SCREEN. - app->at_selection_screen( ). - -AT SELECTION-SCREEN ON EXIT-COMMAND. - app->at_selection_screen_on_exit( ). diff --git a/src/demos/zdemo_excel_checker.prog.xml b/src/demos/zdemo_excel_checker.prog.xml deleted file mode 100644 index 468a47cd5..000000000 --- a/src/demos/zdemo_excel_checker.prog.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ZDEMO_EXCEL_CHECKER - S - 1 - X - D$S - X - - - - R - abap2xlsx demos: check for regressions - 38 - - - - - diff --git a/src/demos/zdemo_excel_comments.prog.abap b/src/demos/zdemo_excel_comments.prog.abap deleted file mode 100644 index 61de79184..000000000 --- a/src/demos/zdemo_excel_comments.prog.abap +++ /dev/null @@ -1,48 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_EXCEL_COMMENTS -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* -REPORT zdemo_excel_comments. - -DATA: lo_excel TYPE REF TO zcl_excel, - lo_worksheet TYPE REF TO zcl_excel_worksheet, - lo_comment TYPE REF TO zcl_excel_comment, - lo_hyperlink TYPE REF TO zcl_excel_hyperlink, - lv_comment TYPE string. - -CONSTANTS: gc_save_file_name TYPE string VALUE 'Comments.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( ). - - " Comments - lo_comment = lo_excel->add_new_comment( ). - lo_comment->set_text( ip_ref = 'B13' ip_text = 'This is how it begins to be debug time...' ). - lo_worksheet->add_comment( lo_comment ). - lo_comment = lo_excel->add_new_comment( ). - lo_comment->set_text( ip_ref = 'C18' ip_text = 'Another comment' ). - lo_worksheet->add_comment( lo_comment ). - lo_comment = lo_excel->add_new_comment( ). - CONCATENATE 'A comment split' cl_abap_char_utilities=>cr_lf 'on 2 lines?' INTO lv_comment. - lo_comment->set_text( ip_ref = 'F6' ip_text = lv_comment ). - - " Second sheet - lo_worksheet = lo_excel->add_new_worksheet( ). - - lo_comment = lo_excel->add_new_comment( ). - lo_comment->set_text( ip_ref = 'A8' ip_text = 'What about a comment on second sheet?' ). - lo_worksheet->add_comment( lo_comment ). - - lo_excel->set_active_sheet_index_by_name( 'Sheet1' ). - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_excel_comments.prog.xml b/src/demos/zdemo_excel_comments.prog.xml deleted file mode 100644 index 72569ea7b..000000000 --- a/src/demos/zdemo_excel_comments.prog.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - ZDEMO_EXCEL_COMMENTS - 1 - T - E - X - X - - - - S - P_PATH - . - 9 - D - - - S - RB_BACK - 17 - - - R - abap2xlsx Demo: Hello World - 28 - - - - - diff --git a/src/demos/zdemo_excel_fill_template.prog.abap b/src/demos/zdemo_excel_fill_template.prog.abap deleted file mode 100644 index e06ced280..000000000 --- a/src/demos/zdemo_excel_fill_template.prog.abap +++ /dev/null @@ -1,353 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report Fill Template -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_excel_fill_template. - -*================= -* Start of generated code. -* All these types were generated -* by ZEXCEL_TEMPLATE_GET_TYPES based -* on the Excel file ZDEMO_EXCEL_TEMPLATE -* from SMW0. -*================= -TYPES t_number TYPE p LENGTH 16 DECIMALS 4. -TYPES: - BEGIN OF t_table1, - person TYPE string, - salary TYPE t_number, - END OF t_table1, - - tt_table1 TYPE STANDARD TABLE OF t_table1 WITH DEFAULT KEY, - - BEGIN OF t_line1, - carrid TYPE string, - connid TYPE string, - fldate TYPE d, - price TYPE t_number, - END OF t_line1, - - tt_line1 TYPE STANDARD TABLE OF t_line1 WITH DEFAULT KEY, - - BEGIN OF t_table2, - carrid TYPE string, - price TYPE t_number, - line1 TYPE tt_line1, - END OF t_table2, - - tt_table2 TYPE STANDARD TABLE OF t_table2 WITH DEFAULT KEY, - - BEGIN OF t_sheet1, - date TYPE d, - time TYPE t, - user TYPE string, - total TYPE t_number, - price TYPE t_number, - table1 TYPE tt_table1, - table2 TYPE tt_table2, - END OF t_sheet1, - - - BEGIN OF t_table3, - person TYPE string, - salary TYPE t_number, - END OF t_table3, - - tt_table3 TYPE STANDARD TABLE OF t_table3 WITH DEFAULT KEY, - - BEGIN OF t_sheet2, - date TYPE d, - time TYPE t, - user TYPE string, - total TYPE t_number, - table3 TYPE tt_table3, - END OF t_sheet2. - - -DATA: lo_data TYPE REF TO zcl_excel_template_data. -*================= -* End of generated code -*================= - -* define variables -DATA: gs_sheet1 TYPE t_sheet1, - gs_sheet2 TYPE t_sheet2. - -TABLES: sscrfields. - -CONSTANTS: gc_save_file_name TYPE string VALUE 'fill_template.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - -PARAMETERS: p_smw0 RADIOBUTTON GROUP rad1 DEFAULT 'X'. -PARAMETERS: p_objid TYPE w3objid OBLIGATORY DEFAULT 'ZDEMO_EXCEL_TEMPLATE'. - -PARAMETERS: p_file RADIOBUTTON GROUP rad1. -PARAMETERS: p_fpath TYPE string OBLIGATORY LOWER CASE DEFAULT 'c:\temp\whatever.xlsx'. - -SELECTION-SCREEN SKIP 1. - -SELECTION-SCREEN PUSHBUTTON /1(45) but_txt USER-COMMAND get_types. - - -INITIALIZATION. - but_txt = '@BY@ Analyze file to propose TYPES'. - -AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath. - PERFORM get_file_path CHANGING p_fpath. - -AT SELECTION-SCREEN. - CASE sscrfields-ucomm. - WHEN 'GET_TYPES'. - SUBMIT zexcel_template_get_types - WITH p_smw0 = p_smw0 - WITH p_objid = p_objid - WITH p_file = p_file - WITH p_fpath = p_fpath - AND RETURN. - ENDCASE. - -START-OF-SELECTION. - PERFORM load_data. - PERFORM generate_file. - -FORM load_data. - - FIELD-SYMBOLS: TYPE t_table1, - TYPE t_line1, - TYPE t_table2. - - gs_sheet1-date = sy-datum. - gs_sheet1-time = sy-uzeit. - gs_sheet1-user = sy-uname. - gs_sheet1-total = 5600. - - APPEND INITIAL LINE TO gs_sheet1-table1 ASSIGNING . - -person = 'Lurch Schpellchek'. - -salary = 1200. - - APPEND INITIAL LINE TO gs_sheet1-table1 ASSIGNING . - -person = 'Russell Sprout'. - -salary = 1300. - - APPEND INITIAL LINE TO gs_sheet1-table1 ASSIGNING . - -person = 'Fergus Douchebag'. - -salary = 3000. - - APPEND INITIAL LINE TO gs_sheet1-table1 ASSIGNING . - -person = 'Bartholomew Shoe'. - -salary = 100. - - - gs_sheet1-price = 14003. - - APPEND INITIAL LINE TO gs_sheet1-table2 ASSIGNING . - -carrid = 'AC'. - -price = 1222. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'AC'. - -connid = '0820'. - -fldate = '20021220'. - -price = 1222. - - - APPEND INITIAL LINE TO gs_sheet1-table2 ASSIGNING . - -carrid = 'AF'. - -price = 2222. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'AF'. - -connid = '0820'. - -fldate = '20021223'. - -price = 2222. - - - APPEND INITIAL LINE TO gs_sheet1-table2 ASSIGNING . - -carrid = 'LH'. - -price = 9488. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'LH'. - -connid = '0400'. - -fldate = '19950228'. - -price = 899. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'LH'. - -connid = '0400'. - -fldate = '19951117'. - -price = 1499. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'LH'. - -connid = '0400'. - -fldate = '19950606'. - -price = 1090. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'LH'. - -connid = '0400'. - -fldate = '19950428'. - -price = 6000. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'LH'. - -connid = '0400'. - -fldate = '20021221'. - -price = 222. - - APPEND INITIAL LINE TO gs_sheet1-table2 ASSIGNING . - -carrid = 'SQ'. - -price = 849. - - APPEND INITIAL LINE TO -line1 ASSIGNING . - -carrid = 'SQ'. - -connid = '0026'. - -fldate = '19950228'. - -price = 849. - - - MOVE-CORRESPONDING gs_sheet1 TO gs_sheet2. - gs_sheet2-table3 = gs_sheet1-table1. - -ENDFORM. - -FORM generate_file. - - DATA: lo_excel TYPE REF TO zcl_excel, - lo_reader TYPE REF TO zif_excel_reader, - lo_root TYPE REF TO cx_root. - - TRY. - -* prepare data - CREATE OBJECT lo_data. - lo_data->add( iv_sheet = 'Sheet1' iv_data = gs_sheet1 ). - lo_data->add( iv_sheet = 'Sheet2' iv_data = gs_sheet2 ). - -* create reader - CREATE OBJECT lo_reader TYPE zcl_excel_reader_2007. - -* load template - IF p_file IS NOT INITIAL. - lo_excel = lo_reader->load_file( p_fpath ). - ELSE. - PERFORM load_smw0 USING lo_reader p_objid CHANGING lo_excel. - ENDIF. - -* merge data with template - lo_excel->fill_template( lo_data ). - - -*** Create output - lcl_output=>output( cl_excel = lo_excel iv_info_message = abap_false ). - - CATCH cx_root INTO lo_root. - MESSAGE lo_root TYPE 'I' DISPLAY LIKE 'E'. - ENDTRY. - -ENDFORM. - -*&---------------------------------------------------------------------* -*& Form Get_file_path -*&---------------------------------------------------------------------* -FORM get_file_path CHANGING cv_path TYPE string. - - DATA: - lv_rc TYPE i, - lv_user_action TYPE i, - lt_file_table TYPE filetable, - ls_file_table LIKE LINE OF lt_file_table. - - CLEAR cv_path. - - cl_gui_frontend_services=>file_open_dialog( - EXPORTING - window_title = 'select template xlsx' - multiselection = '' - default_extension = '*.xlsx' - file_filter = 'Text file (*.xlsx)|*.xlsx|All (*.*)|*.*' - CHANGING - file_table = lt_file_table - rc = lv_rc - user_action = lv_user_action - EXCEPTIONS - OTHERS = 1 - ). - IF sy-subrc = 0. - IF lv_user_action = cl_gui_frontend_services=>action_ok. - IF lt_file_table IS NOT INITIAL. - READ TABLE lt_file_table INTO ls_file_table INDEX 1. - IF sy-subrc = 0. - cv_path = ls_file_table-filename. - ENDIF. - ENDIF. - ENDIF. - ENDIF. -ENDFORM. " Get_file_path - -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. diff --git a/src/demos/zdemo_excel_fill_template.prog.xml b/src/demos/zdemo_excel_fill_template.prog.xml deleted file mode 100644 index e75f886e7..000000000 --- a/src/demos/zdemo_excel_fill_template.prog.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - ZDEMO_EXCEL_FILL_TEMPLATE - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Fill template - 29 - - - S - P_FILE - Load template from file - 31 - - - S - P_FPATH - Path to template.xlsx - 29 - - - S - P_OBJID - Object ID - 17 - - - S - P_PATH - . - 9 - D - - - S - P_SMW0 - Load template from SMW0 - 31 - - - S - RB_BACK - 17 - - - - - diff --git a/src/demos/zdemo_excel_outputopt_incl.prog.abap b/src/demos/zdemo_excel_outputopt_incl.prog.abap deleted file mode 100644 index 9c7488d96..000000000 --- a/src/demos/zdemo_excel_outputopt_incl.prog.abap +++ /dev/null @@ -1,391 +0,0 @@ -*&---------------------------------------------------------------------* -*& Include ZDEMO_EXCEL_OUTPUTOPT_INCL -*&---------------------------------------------------------------------* -CLASS lcl_output DEFINITION CREATE PRIVATE. - PUBLIC SECTION. - CLASS-METHODS: - output IMPORTING cl_excel TYPE REF TO zcl_excel - iv_writerclass_name TYPE clike OPTIONAL - iv_info_message TYPE abap_bool DEFAULT abap_true - RAISING zcx_excel, - f4_path RETURNING VALUE(selected_folder) TYPE string, - parametertexts. - - PRIVATE SECTION. - METHODS: - download_frontend - RAISING - zcx_excel, - download_backend, - display_online, - send_email. - - DATA: xdata TYPE xstring, " Will be used for sending as email - t_rawdata TYPE solix_tab, " Will be used for downloading or open directly - bytecount TYPE i. " Will be used for downloading or open directly -ENDCLASS. "lcl_output DEFINITION - - -SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE txt_bl1. -PARAMETERS: rb_down RADIOBUTTON GROUP rb1 USER-COMMAND space. - -PARAMETERS: rb_back RADIOBUTTON GROUP rb1. - -PARAMETERS: rb_show RADIOBUTTON GROUP rb1 DEFAULT 'X' . - -PARAMETERS: rb_send RADIOBUTTON GROUP rb1. - -PARAMETERS: p_path TYPE string LOWER CASE MODIF ID pat. -PARAMETERS: p_email TYPE string LOWER CASE MODIF ID ema OBLIGATORY DEFAULT 'insert_your_emailadress@here'. -PARAMETERS: p_backfn TYPE text40 NO-DISPLAY. -SELECTION-SCREEN END OF BLOCK bl1. - - -AT SELECTION-SCREEN OUTPUT. - LOOP AT SCREEN. - - IF rb_down IS INITIAL AND screen-group1 = 'PAT'. - screen-input = 0. - screen-invisible = 1. - ENDIF. - - IF rb_send IS INITIAL AND screen-group1 = 'EMA'. - screen-input = 0. - screen-invisible = 1. - ENDIF. - - MODIFY SCREEN. - - ENDLOOP. - -INITIALIZATION. - IF sy-batch IS INITIAL. - cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = p_path ). - cl_gui_cfw=>flush( ). - ENDIF. - lcl_output=>parametertexts( ). " If started in language w/o textelements translated set defaults - txt_bl1 = 'Output options'(bl1). - p_backfn = gc_save_file_name. " Use as default if nothing else is supplied by submit - -AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. - p_path = lcl_output=>f4_path( ). - - -*----------------------------------------------------------------------* -* CLASS lcl_output IMPLEMENTATION -*----------------------------------------------------------------------* -CLASS lcl_output IMPLEMENTATION. - METHOD output. - - DATA: cl_output TYPE REF TO lcl_output, - cl_writer TYPE REF TO zif_excel_writer, - cl_error TYPE REF TO zcx_excel. - - TRY. - - IF iv_writerclass_name IS INITIAL. - CREATE OBJECT cl_output. - CREATE OBJECT cl_writer TYPE zcl_excel_writer_2007. - ELSE. - CREATE OBJECT cl_output. - CREATE OBJECT cl_writer TYPE (iv_writerclass_name). - ENDIF. - cl_output->xdata = cl_writer->write_file( cl_excel ). - - cl_output->t_rawdata = cl_bcs_convert=>xstring_to_solix( iv_xstring = cl_output->xdata ). - cl_output->bytecount = xstrlen( cl_output->xdata ). - - CASE 'X'. - WHEN rb_down. - IF sy-batch IS INITIAL. - cl_output->download_frontend( ). - ELSE. - MESSAGE e802(zabap2xlsx). - ENDIF. - - WHEN rb_back. - cl_output->download_backend( ). - - WHEN rb_show. - IF sy-batch IS INITIAL. - cl_output->display_online( ). - ELSE. - MESSAGE e803(zabap2xlsx). - ENDIF. - - WHEN rb_send. - cl_output->send_email( ). - - ENDCASE. - - CATCH zcx_excel INTO cl_error. - IF iv_info_message = abap_true. - MESSAGE cl_error TYPE 'I' DISPLAY LIKE 'E'. - ELSE. - RAISE EXCEPTION cl_error. - ENDIF. - ENDTRY. - - ENDMETHOD. "output - - METHOD f4_path. - DATA: new_path TYPE string, - repid TYPE syrepid, - dynnr TYPE sydynnr, - lt_dynpfields TYPE TABLE OF dynpread, - ls_dynpfields LIKE LINE OF lt_dynpfields. - -* Get current value - dynnr = sy-dynnr. - repid = sy-repid. - ls_dynpfields-fieldname = 'P_PATH'. - APPEND ls_dynpfields TO lt_dynpfields. - - CALL FUNCTION 'DYNP_VALUES_READ' - EXPORTING - dyname = repid - dynumb = dynnr - TABLES - dynpfields = lt_dynpfields - EXCEPTIONS - invalid_abapworkarea = 1 - invalid_dynprofield = 2 - invalid_dynproname = 3 - invalid_dynpronummer = 4 - invalid_request = 5 - no_fielddescription = 6 - invalid_parameter = 7 - undefind_error = 8 - double_conversion = 9 - stepl_not_found = 10 - OTHERS = 11. - IF sy-subrc <> 0. - MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno - WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. - RETURN. - ENDIF. - - READ TABLE lt_dynpfields INTO ls_dynpfields INDEX 1. - - new_path = ls_dynpfields-fieldvalue. - selected_folder = new_path. - - cl_gui_frontend_services=>directory_browse( - EXPORTING - window_title = 'Select path to download EXCEL-file' - initial_folder = new_path - CHANGING - selected_folder = new_path - EXCEPTIONS - cntl_error = 1 - error_no_gui = 2 - not_supported_by_gui = 3 - OTHERS = 4 - ). - cl_gui_cfw=>flush( ). - CHECK new_path IS NOT INITIAL. - selected_folder = new_path. - - ENDMETHOD. "f4_path - - METHOD parametertexts. -* If started in language w/o textelements translated set defaults -* Furthermore I don't have to change the selectiontexts of all demoreports. - - TYPES: BEGIN OF ty_parameter, - name TYPE string, - text TYPE string, - END OF ty_parameter. - DATA: parameters TYPE TABLE OF ty_parameter, - parameter TYPE ty_parameter, - parameter_text_name TYPE string. - FIELD-SYMBOLS: TYPE ty_parameter, - TYPE c. - - parameter-name = 'RB_DOWN'. parameter-text = 'Save to frontend'. APPEND parameter TO parameters. - parameter-name = 'RB_BACK'. parameter-text = 'Save to backend'. APPEND parameter TO parameters. - parameter-name = 'RB_SHOW'. parameter-text = 'Direct display'. APPEND parameter TO parameters. - parameter-name = 'RB_SEND'. parameter-text = 'Send via email'. APPEND parameter TO parameters. - parameter-name = 'P_PATH'. parameter-text = 'Frontend-path to download to'. APPEND parameter TO parameters. - parameter-name = 'P_EMAIL'. parameter-text = 'Email to send xlsx to'. APPEND parameter TO parameters. - - LOOP AT parameters ASSIGNING . - parameter_text_name = |%_{ -name }_%_APP_%-TEXT|. - ASSIGN (parameter_text_name) TO . - IF sy-subrc = 0. - IF = -name OR - IS INITIAL. - = -text. - ENDIF. - ENDIF. - ENDLOOP. - - ENDMETHOD. "parametertexts - - METHOD: download_frontend. - DATA: filename TYPE string, - message TYPE string. -* I don't like p_path here - but for this include it's ok - filename = p_path. -* Add trailing "\" or "/" - IF filename CA '/'. - REPLACE REGEX '([^/])\s*$' IN filename WITH '$1/' . - ELSE. - REPLACE REGEX '([^\\])\s*$' IN filename WITH '$1\\'. - ENDIF. - - CONCATENATE filename gc_save_file_name INTO filename. -* Get trailing blank - cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = bytecount - filename = filename - filetype = 'BIN' - CHANGING data_tab = t_rawdata - EXCEPTIONS OTHERS = 1 ). - IF sy-subrc <> 0. - MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno - WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 INTO message. - RAISE EXCEPTION TYPE zcx_excel EXPORTING error = message. - ENDIF. - ENDMETHOD. "download_frontend - - METHOD download_backend. - DATA: bytes_remain TYPE i. - FIELD-SYMBOLS: LIKE LINE OF t_rawdata. - - OPEN DATASET p_backfn FOR OUTPUT IN BINARY MODE. - CHECK sy-subrc = 0. - - bytes_remain = bytecount. - - LOOP AT t_rawdata ASSIGNING . - - AT LAST. - CHECK bytes_remain >= 0. - TRANSFER TO p_backfn LENGTH bytes_remain. - EXIT. - ENDAT. - - TRANSFER TO p_backfn. - SUBTRACT 255 FROM bytes_remain. " Solix has length 255 - - ENDLOOP. - - CLOSE DATASET p_backfn. - - IF sy-repid <> sy-cprog AND sy-cprog IS NOT INITIAL. " no need to display anything if download was selected and report was called for demo purposes - LEAVE PROGRAM. - ELSE. - MESSAGE 'Data transferred to default backend directory' TYPE 'S'. - ENDIF. - ENDMETHOD. "download_backend - - METHOD display_online. - 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, "OIContainerCtrl - cl_document TYPE REF TO i_oi_document_proxy. "Office Dokument - - 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 = cl_gui_container=>screen0 - 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 - - cl_document->open_document_from_table( EXPORTING document_size = bytecount - document_table = t_rawdata - open_inplace = 'X' ). - - WRITE: '.'. " To create an output. That way screen0 will exist - ENDMETHOD. "display_online - - METHOD send_email. -* Needed to send emails - DATA: bcs_exception TYPE REF TO cx_bcs, - errortext TYPE string, - cl_send_request TYPE REF TO cl_bcs, - cl_document TYPE REF TO cl_document_bcs, - cl_recipient TYPE REF TO if_recipient_bcs, - cl_sender TYPE REF TO cl_cam_address_bcs, - t_attachment_header TYPE soli_tab, - wa_attachment_header LIKE LINE OF t_attachment_header, - attachment_subject TYPE sood-objdes, - - sood_bytecount TYPE sood-objlen, - mail_title TYPE so_obj_des, - t_mailtext TYPE soli_tab, - wa_mailtext LIKE LINE OF t_mailtext, - send_to TYPE adr6-smtp_addr, - sent TYPE abap_bool. - - - mail_title = 'Mail title'. - wa_mailtext = 'Mailtext'. - APPEND wa_mailtext TO t_mailtext. - - TRY. -* Create send request - cl_send_request = cl_bcs=>create_persistent( ). -* Create new document with mailtitle and mailtextg - cl_document = cl_document_bcs=>create_document( i_type = 'RAW' "#EC NOTEXT - i_text = t_mailtext - i_subject = mail_title ). -* Add attachment to document -* since the new excelfiles have an 4-character extension .xlsx but the attachment-type only holds 3 charactes .xls, -* we have to specify the real filename via attachment header -* Use attachment_type xls to have SAP display attachment with the excel-icon - attachment_subject = gc_save_file_name. - CONCATENATE '&SO_FILENAME=' attachment_subject INTO wa_attachment_header. - APPEND wa_attachment_header TO t_attachment_header. -* Attachment - sood_bytecount = bytecount. " next method expects sood_bytecount instead of any positive integer *sigh* - cl_document->add_attachment( i_attachment_type = 'XLS' "#EC NOTEXT - i_attachment_subject = attachment_subject - i_attachment_size = sood_bytecount - i_att_content_hex = t_rawdata - i_attachment_header = t_attachment_header ). - -* add document to send request - cl_send_request->set_document( cl_document ). - -* add recipient(s) - here only 1 will be needed - send_to = p_email. - IF send_to IS INITIAL. - send_to = 'no_email@no_email.no_email'. " Place into SOST in any case for demonstration purposes - ENDIF. - cl_recipient = cl_cam_address_bcs=>create_internet_address( send_to ). - cl_send_request->add_recipient( cl_recipient ). - -* Und abschicken - sent = cl_send_request->send( i_with_error_screen = 'X' ). - - COMMIT WORK. - - IF sent = abap_true. - MESSAGE s805(zabap2xlsx). - MESSAGE 'Document ready to be sent - Check SOST or SCOT' TYPE 'I'. - ELSE. - MESSAGE i804(zabap2xlsx) WITH p_email. - ENDIF. - - CATCH cx_bcs INTO bcs_exception. - errortext = bcs_exception->if_message~get_text( ). - MESSAGE errortext TYPE 'I'. - - ENDTRY. - ENDMETHOD. "send_email - - -ENDCLASS. "lcl_output IMPLEMENTATION diff --git a/src/demos/zdemo_excel_outputopt_incl.prog.xml b/src/demos/zdemo_excel_outputopt_incl.prog.xml deleted file mode 100644 index 96fc354c4..000000000 --- a/src/demos/zdemo_excel_outputopt_incl.prog.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - ZDEMO_EXCEL_OUTPUTOPT_INCL - I - E - X - - - - R - Include ZDEMO_EXCEL_OUTPUTOPT_INCL - 34 - - - - - diff --git a/src/demos/zdemo_excel_wda01.wdya.xml b/src/demos/zdemo_excel_wda01.wdya.xml deleted file mode 100644 index 56d89583f..000000000 --- a/src/demos/zdemo_excel_wda01.wdya.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - ZDEMO_EXCEL_WDA01 - ZDEMO_EXCEL_WDA01 - W_MAIN - DEFAULT - ZDEMO_EXCEL_WDA01 - - - - diff --git a/src/demos/zdemo_excel_wda01.wdyn.xml b/src/demos/zdemo_excel_wda01.wdyn.xml deleted file mode 100644 index 6f98b4604..000000000 --- a/src/demos/zdemo_excel_wda01.wdyn.xml +++ /dev/null @@ -1,1410 +0,0 @@ - - - - - - - - ZDEMO_EXCEL_WDA01 - A - COMPONENTCONTROLLER - COMPONENTINTERFACE - ZDEMO_EXCEL_WDA01 - - - - ZDEMO_EXCEL_WDA01 - E - abap2xlsx Web Dynpro Demo 1 - - - - - - - ZDEMO_EXCEL_WDA01 - EMPTYVIEW - A - CL_WDY_MD_EMPTY_VIEW - EMPTYVIEW - EMPTYVIEW - - - - ZDEMO_EXCEL_WDA01 - EMPTYVIEW - SHOWEMPTYVIEW - A - CL_WDY_MD_INBOUND_PLUG - SHOWEMPTYVIEW - - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - A - CL_WDY_MD_VIEW - V_MAIN - ROOTUIELEMENTCONTAINER - E - V_MAIN - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - E - Web Dynpro View - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - 1 - CL_WDY_MD_BUTTON - BTN_DOWNLOAD - STANDARD - BUTTON - ROOTUIELEMENTCONTAINER - CHILDREN - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD_LD - A - 1 - CL_WDY_MD_FLOW_DATA - BTN_DOWNLOAD_LD - STANDARD - FLOW_DATA - BTN_DOWNLOAD - LAYOUT_DATA - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - CL_WDY_MD_TRANSP_CONTAINER - ROOTUIELEMENTCONTAINER - STANDARD - TRANSPARENT_CONTAINER - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER_LAYOUT - A - 1 - CL_WDY_MD_FLOW_LAYOUT - ROOTUIELEMENTCONTAINER_LAYOUT - STANDARD - FLOW_LAYOUT - ROOTUIELEMENTCONTAINER - LAYOUT - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - ON_ACTION - A - ON_ACTION - BTN_DOWNLOAD - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - ACTIVATE_ACCESS_KEY - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - CONTEXT_MENU_BEHAVIOUR - 00 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - DESIGN - 00 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - ENABLED - X - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - HOTKEY - 00 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - IMAGE_FIRST - X - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - IMAGE_IS_DECORATIVE - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - TEXT - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - TEXT_DIRECTION - 02 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - VISIBLE - 02 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD_LD - A - CELL_DESIGN - 04 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD_LD - A - V_GUTTER - 00 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - ARIA_LANDMARK - 10 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - CONTEXT_MENU_BEHAVIOUR - 00 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - ENABLED - X - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - HANDLE_HOTKEYS - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - IS_LAYOUT_CONTAINER - X - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - SCROLLING_MODE - 02 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - SCROLL_LEFT - 0 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - SCROLL_TOP - 0 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER - A - VISIBLE - 02 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ROOTUIELEMENTCONTAINER_LAYOUT - A - WRAPPING - X - - - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - A - CL_WDY_MD_WINDOW - W_MAIN - W_MAIN - V_MAIN_USAGE_0 - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - DEFAULT - A - CL_WDY_MD_INBOUND_PLUG - 1 - DEFAULT - X - - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - V_MAIN_USAGE_0 - A - CL_WDY_MD_VIEW_USAGE - V_MAIN - V_MAIN_USAGE_0 - - - - - - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - A - 02 - CONTEXT - COMPONENTCONTROLLER - ZIWCI_DEMO_EXCEL_WDA01 - - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOAPPLICATIONSTATECHANGE - E - Handling for Suspending and Resuming an Application - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOBEFORENAVIGATION - E - Error Handling Before Navigation Through Application - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOEXIT - E - Controller Clean-Up Method - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOINIT - E - Controller Initialization Method - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOPOSTPROCESSING - E - Prepare Output - - - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOAPPLICATIONSTATECHANGE - STATE_CHANGE - A - 1 - 1 - IF_WD_APPLICATION_STATE_CHANGE - STATE_CHANGE - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOBEFORENAVIGATION - IS_CURRENT_ROOT - A - 1 - WDY_BOOLEAN - IS_CURRENT_ROOT - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOEXIT - REASON - A - 1 - WDR_APPL_EXIT_REASON - REASON - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOPOSTPROCESSING - IS_CURRENT_ROOT - A - 1 - WDY_BOOLEAN - IS_CURRENT_ROOT - - - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - CONTEXT - A - CL_WDY_MD_CONTEXT_VALUE_NODE - 03 - 01 - 01 - X - CONTEXT - X - X - - - - - - ZDEMO_EXCEL_WDA01 - EMPTYVIEW - A - 01 - EMPTYVIEW - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - A - 01 - CONTEXT - V_MAIN - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - 00O2TRN3HOPNY2XMW9ZPOIO72 - A - COMPONENTCONTROLLER - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - E - Download Excel file - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - E - Download Excel file - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOAFTERACTION - E - Method for non-action specific operations before navigation - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - E - Method for Validation of User Input - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOEXIT - E - Controller Clean-Up Method - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOINIT - E - Controller Initialization Method - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - E - Method for Modifying the View Before Rendering - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - E - Method for Modifying the Context Menu - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - FIRST_TIME - A - 1 - WDY_BOOLEAN - FIRST_TIME - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - VIEW - A - 2 - 1 - IF_WD_VIEW - VIEW - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - CONTEXT_MENU_EVENT - A - 1 - 1 - IF_WD_CONTEXT_MENU_EVENT - CONTEXT_MENU_EVENT - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - CONTEXT_MENU_MANAGER - A - 2 - 1 - IF_WD_CONTEXT_MENU_MANAGER - CONTEXT_MENU_MANAGER - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - MENU - A - 3 - 3 - 1 - CL_WD_MENU - MENU - - - - - ZDEMO_EXCEL_WDA01 - V_MAIN - CONTEXT - A - CL_WDY_MD_CONTEXT_VALUE_NODE - 03 - 01 - 01 - X - CONTEXT - X - - - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - A - 06 - CONTEXT - W_MAIN - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - 00O2TRN3HOPNY2XMW9ZPOIHVI - A - COMPONENTCONTROLLER - - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOEXIT - E - Controller Clean-Up Method - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOINIT - E - Controller Initialization Method - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONCLOSE - E - Handling For Closing of Window - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONOPEN - E - Handling For Opening of Window - - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONOPEN - WINDOW_DESCR - A - 1 - 1 - IF_WD_WINDOW_DESCRIPTION - WINDOW_DESCR - - - - - ZDEMO_EXCEL_WDA01 - W_MAIN - CONTEXT - A - CL_WDY_MD_CONTEXT_VALUE_NODE - 03 - 01 - 01 - X - CONTEXT - X - - - - - - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOAPPLICATIONSTATECHANGE - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOAPPLICATIONSTATECHANGE - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOBEFORENAVIGATION - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOBEFORENAVIGATION - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOEXIT - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOEXIT - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOINIT - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOINIT - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOPOSTPROCESSING - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOPOSTPROCESSING - - - ZDEMO_EXCEL_WDA01 - V_MAIN - BTN_DOWNLOAD - A - CL_WDY_MD_ACTION - BTN_DOWNLOAD - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - A - CL_WDY_MD_CTLR_EVENT_HANDLER - 2 - V_MAIN - BTN_DOWNLOAD - ONACTIONBTN_DOWNLOAD - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOAFTERACTION - A - CL_WDY_MD_CONTROLLER_METHOD - 2 - WDDOAFTERACTION - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - A - CL_WDY_MD_CONTROLLER_METHOD - 2 - WDDOBEFOREACTION - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOEXIT - A - CL_WDY_MD_CONTROLLER_METHOD - 2 - WDDOEXIT - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOINIT - A - CL_WDY_MD_CONTROLLER_METHOD - 2 - WDDOINIT - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - A - CL_WDY_MD_CONTROLLER_METHOD - 2 - WDDOMODIFYVIEW - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - A - CL_WDY_MD_CONTROLLER_METHOD - 2 - WDDOONCONTEXTMENU - - - ZDEMO_EXCEL_WDA01 - W_MAIN - HANDLEDEFAULT - A - CL_WDY_MD_CTLR_EVENT_HANDLER - 1 - 2 - W_MAIN - DEFAULT - HANDLEDEFAULT - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOEXIT - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOEXIT - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOINIT - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOINIT - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONCLOSE - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOONCLOSE - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONOPEN - A - CL_WDY_MD_CONTROLLER_METHOD - 1 - 2 - WDDOONOPEN - - - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOAPPLICATIONSTATECHANGE - 1 - method WDDOAPPLICATIONSTATECHANGE . - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOAPPLICATIONSTATECHANGE - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOBEFORENAVIGATION - 1 - method WDDOBEFORENAVIGATION . - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOBEFORENAVIGATION - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOEXIT - 1 - method WDDOEXIT . - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOEXIT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOINIT - 1 - method WDDOINIT . - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOINIT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOPOSTPROCESSING - 1 - method WDDOPOSTPROCESSING . - - - ZDEMO_EXCEL_WDA01 - COMPONENTCONTROLLER - WDDOPOSTPROCESSING - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 1 - METHOD onactionbtn_download . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 2 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 3 - DATA: lo_excel TYPE REF TO zcl_excel, - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 4 - lo_excel_writer TYPE REF TO zcl_excel_writer_2007, - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 5 - lo_worksheet TYPE REF TO zcl_excel_worksheet. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 6 - DATA: lv_content TYPE xstring. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 7 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 8 - TRY. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 9 - CREATE OBJECT lo_excel. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 10 - lo_worksheet = lo_excel->get_active_worksheet( ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 11 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 12 - lo_worksheet->set_cell( ip_column = 'B' - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 13 - ip_row = '2' - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 14 - ip_value = 'Welcome to Web Dynpro and abap2xlsx.' ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 15 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 16 - CREATE OBJECT lo_excel_writer. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 17 - lv_content = lo_excel_writer->zif_excel_writer~write_file( lo_excel ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 18 - CATCH zcx_excel. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 19 - "Unlikely, ignore to keep demo simple. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 20 - ENDTRY. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 21 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 22 - DATA: lv_filename TYPE string. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 23 - lv_filename = 'wda01.xlsx'. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 24 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 25 - CALL METHOD cl_wd_runtime_services=>attach_file_to_response - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 26 - EXPORTING - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 27 - i_filename = lv_filename - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 28 - i_content = lv_content - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 29 - i_mime_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 30 - i_in_new_window = abap_false - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 31 - i_inplace = abap_false. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 32 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - ONACTIONBTN_DOWNLOAD - 33 - ENDMETHOD. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOAFTERACTION - 1 - method WDDOAFTERACTION . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOAFTERACTION - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 1 - method WDDOBEFOREACTION . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 2 - * data lo_api_controller type ref to if_wd_view_controller. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 3 - * data lo_action type ref to if_wd_action. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 4 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 5 - * lo_api_controller = wd_this->wd_get_api( ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 6 - * lo_action = lo_api_controller->get_current_action( ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 7 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 8 - * if lo_action is bound. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 9 - * case lo_action->name. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 10 - * when '...'. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 11 - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 12 - * endcase. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 13 - * endif. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOBEFOREACTION - 14 - endmethod. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOEXIT - 1 - method WDDOEXIT . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOEXIT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOINIT - 1 - method WDDOINIT . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOINIT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - 1 - method WDDOMODIFYVIEW . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - 2 - DATA lo_button TYPE REF TO cl_wd_button. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - 3 - lo_button ?= view->get_element( id = 'BTN_DOWNLOAD' ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - 4 - lo_button->set_text( 'Download' ). - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOMODIFYVIEW - 5 - endmethod. - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - 1 - method WDDOONCONTEXTMENU . - - - ZDEMO_EXCEL_WDA01 - V_MAIN - WDDOONCONTEXTMENU - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - W_MAIN - HANDLEDEFAULT - 1 - method HANDLEDEFAULT . - - - ZDEMO_EXCEL_WDA01 - W_MAIN - HANDLEDEFAULT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOEXIT - 1 - method WDDOEXIT . - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOEXIT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOINIT - 1 - method WDDOINIT . - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOINIT - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONCLOSE - 1 - method WDDOONCLOSE . - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONCLOSE - 2 - endmethod. - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONOPEN - 1 - method WDDOONOPEN . - - - ZDEMO_EXCEL_WDA01 - W_MAIN - WDDOONOPEN - 2 - endmethod. - - - - - diff --git a/src/demos/zdemo_teched1.prog.abap b/src/demos/zdemo_teched1.prog.abap deleted file mode 100644 index b89dcdddb..000000000 --- a/src/demos/zdemo_teched1.prog.abap +++ /dev/null @@ -1,83 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED1 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched1. - -******************************* -* Data Object declaration * -******************************* - -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. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo01' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched1.prog.xml b/src/demos/zdemo_teched1.prog.xml deleted file mode 100644 index fd042e21d..000000000 --- a/src/demos/zdemo_teched1.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED1 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched10.prog.abap b/src/demos/zdemo_teched10.prog.abap deleted file mode 100644 index d928d00d2..000000000 --- a/src/demos/zdemo_teched10.prog.abap +++ /dev/null @@ -1,49 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched10. - -******************************* -* Data Object declaration * -******************************* - -DATA: lo_excel TYPE REF TO zcl_excel, - lo_excel_reader TYPE REF TO zif_excel_reader, - lo_worksheet TYPE REF TO zcl_excel_worksheet. - -DATA: lv_full_path TYPE string, - lv_workdir TYPE string, - lv_file_separator TYPE c. - -DATA: lt_files TYPE filetable, - ls_file TYPE file_table, - lv_rc TYPE i, - lv_value TYPE zexcel_cell_value. - -CONSTANTS: gc_save_file_name TYPE string VALUE 'TechEd01.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - -START-OF-SELECTION. - -******************************* -* abap2xlsx read XLSX * -******************************* - CREATE OBJECT lo_excel_reader TYPE zcl_excel_reader_2007. - lo_excel = lo_excel_reader->load_file( lv_full_path ). - - lo_excel->set_active_sheet_index( 1 ). - lo_worksheet = lo_excel->get_active_worksheet( ). - - lo_worksheet->get_cell( EXPORTING ip_column = 'C' - ip_row = 10 - IMPORTING ep_value = lv_value ). - - WRITE: 'abap2xlsx total score is ', lv_value. - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/zdemo_teched10.prog.xml b/src/demos/zdemo_teched10.prog.xml deleted file mode 100644 index ff8516c56..000000000 --- a/src/demos/zdemo_teched10.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED10 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched2.prog.abap b/src/demos/zdemo_teched2.prog.abap deleted file mode 100644 index 0ead99e48..000000000 --- a/src/demos/zdemo_teched2.prog.abap +++ /dev/null @@ -1,91 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED2 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched2. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lv_style_title_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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched2.prog.xml b/src/demos/zdemo_teched2.prog.xml deleted file mode 100644 index c4b1cd5c7..000000000 --- a/src/demos/zdemo_teched2.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED2 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched3.prog.abap b/src/demos/zdemo_teched3.prog.abap deleted file mode 100644 index 77e0dd1b6..000000000 --- a/src/demos/zdemo_teched3.prog.abap +++ /dev/null @@ -1,107 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched3. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lv_style_title_guid TYPE zexcel_cell_style, - ls_key TYPE wwwdatatab. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - - " add logo from SMWO - lo_drawing = lo_excel->add_new_drawing( ). - lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - - ls_key-relid = 'MI'. - ls_key-objid = 'WBLOGO'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - - " assign drawing to the worksheet - lo_worksheet->add_drawing( lo_drawing ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched3.prog.xml b/src/demos/zdemo_teched3.prog.xml deleted file mode 100644 index c739eea20..000000000 --- a/src/demos/zdemo_teched3.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED3 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched4.prog.abap b/src/demos/zdemo_teched4.prog.abap deleted file mode 100644 index 660c9f4cf..000000000 --- a/src/demos/zdemo_teched4.prog.abap +++ /dev/null @@ -1,129 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched4. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lo_range TYPE REF TO zcl_excel_range, - lv_style_title_guid TYPE zexcel_cell_style, - ls_key TYPE wwwdatatab. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - - " add logo from SMWO - lo_drawing = lo_excel->add_new_drawing( ). - lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - - ls_key-relid = 'MI'. - ls_key-objid = 'WBLOGO'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - - " assign drawing to the worksheet - lo_worksheet->add_drawing( lo_drawing ). - - " Add new sheet - lo_worksheet = lo_excel->add_new_worksheet( ). - lo_worksheet->set_title( ip_title = 'Values' ). - - " Set values for range - lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'Values'. - lo_range->set_value( ip_sheet_name = 'Values' - ip_start_column = 'A' - ip_start_row = 4 - ip_stop_column = 'A' - ip_stop_row = 8 ). - - lo_excel->set_active_sheet_index( 1 ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched4.prog.xml b/src/demos/zdemo_teched4.prog.xml deleted file mode 100644 index 2577c4b6d..000000000 --- a/src/demos/zdemo_teched4.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED4 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched5.prog.abap b/src/demos/zdemo_teched5.prog.abap deleted file mode 100644 index 989fc7e69..000000000 --- a/src/demos/zdemo_teched5.prog.abap +++ /dev/null @@ -1,150 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched5. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lo_range TYPE REF TO zcl_excel_range, - lo_data_validation TYPE REF TO zcl_excel_data_validation, - lv_style_title_guid TYPE zexcel_cell_style, - ls_key TYPE wwwdatatab. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'Is abap2xlsx simple' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Is abap2xlsx CooL' ). - - " add logo from SMWO - lo_drawing = lo_excel->add_new_drawing( ). - lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - - ls_key-relid = 'MI'. - ls_key-objid = 'WBLOGO'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - - " assign drawing to the worksheet - lo_worksheet->add_drawing( lo_drawing ). - - " Add new sheet - lo_worksheet = lo_excel->add_new_worksheet( ). - lo_worksheet->set_title( ip_title = 'Values' ). - - " Set values for range - lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'Values'. - lo_range->set_value( ip_sheet_name = 'Values' - ip_start_column = 'A' - ip_start_row = 4 - ip_stop_column = 'A' - ip_stop_row = 8 ). - - lo_excel->set_active_sheet_index( 1 ). - - " add data validation - 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 = 'Values'. - lo_data_validation->cell_row = 7. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Select a value' ). - - - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_list. - lo_data_validation->formula1 = 'Values'. - lo_data_validation->cell_row = 8. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Select a value' ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched5.prog.xml b/src/demos/zdemo_teched5.prog.xml deleted file mode 100644 index 25c6ced61..000000000 --- a/src/demos/zdemo_teched5.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED5 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched6.prog.abap b/src/demos/zdemo_teched6.prog.abap deleted file mode 100644 index 7e5f21e1b..000000000 --- a/src/demos/zdemo_teched6.prog.abap +++ /dev/null @@ -1,157 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched6. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lo_range TYPE REF TO zcl_excel_range, - lo_data_validation TYPE REF TO zcl_excel_data_validation, - lo_column TYPE REF TO zcl_excel_column, - lv_style_title_guid TYPE zexcel_cell_style, - ls_key TYPE wwwdatatab. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'Is abap2xlsx simple' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Is abap2xlsx CooL' ). - - " add logo from SMWO - lo_drawing = lo_excel->add_new_drawing( ). - lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - - ls_key-relid = 'MI'. - ls_key-objid = 'WBLOGO'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - - " assign drawing to the worksheet - lo_worksheet->add_drawing( lo_drawing ). - - " Add new sheet - lo_worksheet = lo_excel->add_new_worksheet( ). - lo_worksheet->set_title( ip_title = 'Values' ). - - " Set values for range - lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'Values'. - lo_range->set_value( ip_sheet_name = 'Values' - ip_start_column = 'A' - ip_start_row = 4 - ip_stop_column = 'A' - ip_stop_row = 8 ). - - lo_excel->set_active_sheet_index( 1 ). - - " add data validation - 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 = 'Values'. - lo_data_validation->cell_row = 7. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Select a value' ). - - - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_list. - lo_data_validation->formula1 = 'Values'. - lo_data_validation->cell_row = 8. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Select a value' ). - - " add autosize (column width) - 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 = 'C' ). - lo_column->set_auto_size( ip_auto_size = abap_true ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched6.prog.xml b/src/demos/zdemo_teched6.prog.xml deleted file mode 100644 index c784577b7..000000000 --- a/src/demos/zdemo_teched6.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED6 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched7.prog.abap b/src/demos/zdemo_teched7.prog.abap deleted file mode 100644 index a6961f8f0..000000000 --- a/src/demos/zdemo_teched7.prog.abap +++ /dev/null @@ -1,160 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched7. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lo_range TYPE REF TO zcl_excel_range, - lo_data_validation TYPE REF TO zcl_excel_data_validation, - lo_column TYPE REF TO zcl_excel_column, - lv_style_title_guid TYPE zexcel_cell_style, - ls_key TYPE wwwdatatab. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'Is abap2xlsx simple' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Is abap2xlsx CooL' ). - - lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_value = 'Total score' ). - lo_worksheet->set_cell( ip_column = 'C' ip_row = 10 ip_formula = 'SUM(C7:C8)' ). - - " add logo from SMWO - lo_drawing = lo_excel->add_new_drawing( ). - lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - - ls_key-relid = 'MI'. - ls_key-objid = 'WBLOGO'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - - " assign drawing to the worksheet - lo_worksheet->add_drawing( lo_drawing ). - - " Add new sheet - lo_worksheet = lo_excel->add_new_worksheet( ). - lo_worksheet->set_title( ip_title = 'Values' ). - - " Set values for range - lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'Values'. - lo_range->set_value( ip_sheet_name = 'Values' - ip_start_column = 'A' - ip_start_row = 4 - ip_stop_column = 'A' - ip_stop_row = 8 ). - - lo_excel->set_active_sheet_index( 1 ). - - " add data validation - 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 = 'Values'. - lo_data_validation->cell_row = 7. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Select a value' ). - - - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_list. - lo_data_validation->formula1 = 'Values'. - lo_data_validation->cell_row = 8. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Select a value' ). - - " add autosize (column width) - 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 = 'C' ). - lo_column->set_auto_size( ip_auto_size = abap_true ). - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched7.prog.xml b/src/demos/zdemo_teched7.prog.xml deleted file mode 100644 index 3589a0733..000000000 --- a/src/demos/zdemo_teched7.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED7 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched8.prog.abap b/src/demos/zdemo_teched8.prog.abap deleted file mode 100644 index b77227212..000000000 --- a/src/demos/zdemo_teched8.prog.abap +++ /dev/null @@ -1,222 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched8. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_style_green TYPE REF TO zcl_excel_style, - lo_style_yellow TYPE REF TO zcl_excel_style, - lo_style_red TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lo_range TYPE REF TO zcl_excel_range, - lo_data_validation TYPE REF TO zcl_excel_data_validation, - lo_column TYPE REF TO zcl_excel_column, - lo_style_conditional TYPE REF TO zcl_excel_style_cond, - lv_style_title_guid TYPE zexcel_cell_style, - lv_style_green_guid TYPE zexcel_cell_style, - lv_style_yellow_guid TYPE zexcel_cell_style, - lv_style_red_guid TYPE zexcel_cell_style, - ls_cellis TYPE zexcel_conditional_cellis, - ls_key TYPE wwwdatatab. - -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 'TechEd01.xlsx'. - -******************************* -* Selection screen management * -******************************* - -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. - -******************************* -* abap2xlsx create XLSX * -******************************* - - " Create excel instance - CREATE OBJECT lo_excel. - - " Styles - lo_style_title = lo_excel->add_new_style( ). - lo_style_title->font->bold = abap_true. - lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. - lv_style_title_guid = lo_style_title->get_guid( ). - - " Get active sheet - lo_worksheet = lo_excel->get_active_worksheet( ). - lo_worksheet->set_title( ip_title = 'Demo TechEd' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'Is abap2xlsx simple' ). - lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Is abap2xlsx CooL' ). - - lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_value = 'Total score' ). - lo_worksheet->set_cell( ip_column = 'C' ip_row = 10 ip_formula = 'SUM(C7:C8)' ). - - " add logo from SMWO - lo_drawing = lo_excel->add_new_drawing( ). - lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - - ls_key-relid = 'MI'. - ls_key-objid = 'SIWB_KW_LOGO'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - - " assign drawing to the worksheet - lo_worksheet->add_drawing( lo_drawing ). - - " Add new sheet - lo_worksheet = lo_excel->add_new_worksheet( ). - lo_worksheet->set_title( ip_title = 'Values' ). - - " Set values for range - lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). - lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). - lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). - lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). - lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). - - lo_range = lo_excel->add_new_range( ). - lo_range->name = 'Values'. - lo_range->set_value( ip_sheet_name = 'Values' - ip_start_column = 'A' - ip_start_row = 4 - ip_stop_column = 'A' - ip_stop_row = 8 ). - - lo_excel->set_active_sheet_index( 1 ). - - " add data validation - 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 = 'Values'. - lo_data_validation->cell_row = 7. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Select a value' ). - - - lo_data_validation = lo_worksheet->add_new_data_validation( ). - lo_data_validation->type = zcl_excel_data_validation=>c_type_list. - lo_data_validation->formula1 = 'Values'. - lo_data_validation->cell_row = 8. - lo_data_validation->cell_column = 'C'. - lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Select a value' ). - - " add autosize (column width) - 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 = 'C' ). - lo_column->set_auto_size( ip_auto_size = abap_true ). - - " defne conditional styles - lo_style_green = lo_excel->add_new_style( ). - lo_style_green->fill->filltype = zcl_excel_style_fill=>c_fill_solid. - lo_style_green->fill->bgcolor-rgb = zcl_excel_style_color=>c_green. - lv_style_green_guid = lo_style_green->get_guid( ). - - lo_style_yellow = lo_excel->add_new_style( ). - lo_style_yellow->fill->filltype = zcl_excel_style_fill=>c_fill_solid. - lo_style_yellow->fill->bgcolor-rgb = zcl_excel_style_color=>c_yellow. - lv_style_yellow_guid = lo_style_yellow->get_guid( ). - - lo_style_red = lo_excel->add_new_style( ). - lo_style_red->fill->filltype = zcl_excel_style_fill=>c_fill_solid. - lo_style_red->fill->bgcolor-rgb = zcl_excel_style_color=>c_red. - lv_style_red_guid = lo_style_red->get_guid( ). - - " add conditional formatting - lo_style_conditional = lo_worksheet->add_new_style_cond( ). - lo_style_conditional->rule = zcl_excel_style_cond=>c_rule_cellis. - ls_cellis-formula = '5'. - ls_cellis-operator = zcl_excel_style_cond=>c_operator_greaterthan. - ls_cellis-cell_style = lv_style_green_guid. - lo_style_conditional->mode_cellis = ls_cellis. - lo_style_conditional->priority = 1. - lo_style_conditional->set_range( ip_start_column = 'C' - ip_start_row = 10 - ip_stop_column = 'C' - ip_stop_row = 10 ). - - lo_style_conditional = lo_worksheet->add_new_style_cond( ). - lo_style_conditional->rule = zcl_excel_style_cond=>c_rule_cellis. - ls_cellis-formula = '5'. - ls_cellis-operator = zcl_excel_style_cond=>c_operator_equal. - ls_cellis-cell_style = lv_style_yellow_guid. - lo_style_conditional->mode_cellis = ls_cellis. - lo_style_conditional->priority = 2. - lo_style_conditional->set_range( ip_start_column = 'C' - ip_start_row = 10 - ip_stop_column = 'C' - ip_stop_row = 10 ). - - lo_style_conditional = lo_worksheet->add_new_style_cond( ). - lo_style_conditional->rule = zcl_excel_style_cond=>c_rule_cellis. - ls_cellis-formula = '0'. - ls_cellis-operator = zcl_excel_style_cond=>c_operator_greaterthan. - ls_cellis-cell_style = lv_style_red_guid. - lo_style_conditional->mode_cellis = ls_cellis. - lo_style_conditional->priority = 3. - lo_style_conditional->set_range( ip_start_column = 'C' - ip_start_row = 10 - ip_stop_column = 'C' - ip_stop_row = 10 ). - - - " Create xlsx stream - CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. - lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - - " Convert to binary - lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). - lv_bytecount = xstrlen( lv_file ). - - " 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 ). diff --git a/src/demos/zdemo_teched8.prog.xml b/src/demos/zdemo_teched8.prog.xml deleted file mode 100644 index 86ad70341..000000000 --- a/src/demos/zdemo_teched8.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED8 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zdemo_teched9.prog.abap b/src/demos/zdemo_teched9.prog.abap deleted file mode 100644 index 094ba6288..000000000 --- a/src/demos/zdemo_teched9.prog.abap +++ /dev/null @@ -1,211 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZDEMO_TECHED3 -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT zdemo_teched9. - -******************************* -* Data Object declaration * -******************************* - -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. - -DATA: lo_style_title TYPE REF TO zcl_excel_style, - lo_style_green TYPE REF TO zcl_excel_style, - lo_style_yellow TYPE REF TO zcl_excel_style, - lo_style_red TYPE REF TO zcl_excel_style, - lo_drawing TYPE REF TO zcl_excel_drawing, - lo_range TYPE REF TO zcl_excel_range, - lo_data_validation TYPE REF TO zcl_excel_data_validation, - lo_column TYPE REF TO zcl_excel_column, - lo_style_conditional TYPE REF TO zcl_excel_style_cond, - lv_style_title_guid TYPE zexcel_cell_style, - lv_style_green_guid TYPE zexcel_cell_style, - lv_style_yellow_guid TYPE zexcel_cell_style, - lv_style_red_guid TYPE zexcel_cell_style, - ls_cellis TYPE zexcel_conditional_cellis, - ls_key TYPE wwwdatatab. - -DATA: lo_send_request TYPE REF TO cl_bcs, - lo_document TYPE REF TO cl_document_bcs, - lo_sender TYPE REF TO cl_sapuser_bcs, - lo_recipient TYPE REF TO cl_sapuser_bcs. - -DATA: lv_file TYPE xstring, - lv_bytecount TYPE i, - lv_bytecount_c TYPE sood-objlen, - lt_file_tab TYPE solix_tab. - -******************************* -* abap2xlsx create XLSX * -******************************* - -" Create excel instance -CREATE OBJECT lo_excel. - -" Styles -lo_style_title = lo_excel->add_new_style( ). -lo_style_title->font->bold = abap_true. -lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. -lv_style_title_guid = lo_style_title->get_guid( ). - -" Get active sheet -lo_worksheet = lo_excel->get_active_worksheet( ). -lo_worksheet->set_title( ip_title = 'Demo TechEd' ). -lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). -lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'Is abap2xlsx simple' ). -lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Is abap2xlsx CooL' ). - -lo_worksheet->set_cell( ip_column = 'B' ip_row = 10 ip_value = 'Total score' ). -lo_worksheet->set_cell( ip_column = 'C' ip_row = 10 ip_formula = 'SUM(C7:C8)' ). - -" add logo from SMWO -lo_drawing = lo_excel->add_new_drawing( ). -lo_drawing->set_position( ip_from_row = 2 - ip_from_col = 'B' ). - -ls_key-relid = 'MI'. -ls_key-objid = 'SIWB_KW_LOGO'. -lo_drawing->set_media_www( ip_key = ls_key - ip_width = 140 - ip_height = 64 ). - -" assign drawing to the worksheet -lo_worksheet->add_drawing( lo_drawing ). - -" Add new sheet -lo_worksheet = lo_excel->add_new_worksheet( ). -lo_worksheet->set_title( ip_title = 'Values' ). - -" Set values for range -lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). -lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). -lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). -lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). -lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). - -lo_range = lo_excel->add_new_range( ). -lo_range->name = 'Values'. -lo_range->set_value( ip_sheet_name = 'Values' - ip_start_column = 'A' - ip_start_row = 4 - ip_stop_column = 'A' - ip_stop_row = 8 ). - -lo_excel->set_active_sheet_index( 1 ). - -" add data validation -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 = 'Values'. -lo_data_validation->cell_row = 7. -lo_data_validation->cell_column = 'C'. -lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Select a value' ). - - -lo_data_validation = lo_worksheet->add_new_data_validation( ). -lo_data_validation->type = zcl_excel_data_validation=>c_type_list. -lo_data_validation->formula1 = 'Values'. -lo_data_validation->cell_row = 8. -lo_data_validation->cell_column = 'C'. -lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Select a value' ). - -" add autosize (column width) -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 = 'C' ). -lo_column->set_auto_size( ip_auto_size = abap_true ). - -" defne conditional styles -lo_style_green = lo_excel->add_new_style( ). -lo_style_green->fill->filltype = zcl_excel_style_fill=>c_fill_solid. -lo_style_green->fill->bgcolor-rgb = zcl_excel_style_color=>c_green. -lv_style_green_guid = lo_style_green->get_guid( ). - -lo_style_yellow = lo_excel->add_new_style( ). -lo_style_yellow->fill->filltype = zcl_excel_style_fill=>c_fill_solid. -lo_style_yellow->fill->bgcolor-rgb = zcl_excel_style_color=>c_yellow. -lv_style_yellow_guid = lo_style_yellow->get_guid( ). - -lo_style_red = lo_excel->add_new_style( ). -lo_style_red->fill->filltype = zcl_excel_style_fill=>c_fill_solid. -lo_style_red->fill->bgcolor-rgb = zcl_excel_style_color=>c_red. -lv_style_red_guid = lo_style_red->get_guid( ). - -" add conditional formatting -lo_style_conditional = lo_worksheet->add_new_style_cond( ). -lo_style_conditional->rule = zcl_excel_style_cond=>c_rule_cellis. -ls_cellis-formula = '5'. -ls_cellis-operator = zcl_excel_style_cond=>c_operator_greaterthan. -ls_cellis-cell_style = lv_style_green_guid. -lo_style_conditional->mode_cellis = ls_cellis. -lo_style_conditional->priority = 1. -lo_style_conditional->set_range( ip_start_column = 'C' - ip_start_row = 10 - ip_stop_column = 'C' - ip_stop_row = 10 ). - -lo_style_conditional = lo_worksheet->add_new_style_cond( ). -lo_style_conditional->rule = zcl_excel_style_cond=>c_rule_cellis. -ls_cellis-formula = '5'. -ls_cellis-operator = zcl_excel_style_cond=>c_operator_equal. -ls_cellis-cell_style = lv_style_yellow_guid. -lo_style_conditional->mode_cellis = ls_cellis. -lo_style_conditional->priority = 2. -lo_style_conditional->set_range( ip_start_column = 'C' - ip_start_row = 10 - ip_stop_column = 'C' - ip_stop_row = 10 ). - -lo_style_conditional = lo_worksheet->add_new_style_cond( ). -lo_style_conditional->rule = zcl_excel_style_cond=>c_rule_cellis. -ls_cellis-formula = '0'. -ls_cellis-operator = zcl_excel_style_cond=>c_operator_greaterthan. -ls_cellis-cell_style = lv_style_red_guid. -lo_style_conditional->mode_cellis = ls_cellis. -lo_style_conditional->priority = 3. -lo_style_conditional->set_range( ip_start_column = 'C' - ip_start_row = 10 - ip_stop_column = 'C' - ip_stop_row = 10 ). - - -" Create xlsx stream -CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. -lv_file = lo_excel_writer->write_file( lo_excel ). - -******************************* -* Output * -******************************* - -" Convert to binary -lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). -lv_bytecount = xstrlen( lv_file ). -lv_bytecount_c = lv_bytecount. - -" Send via email -lo_document = cl_document_bcs=>create_document( i_type = 'RAW' - i_subject = 'Demo TechEd' ). - -lo_document->add_attachment( i_attachment_type = 'EXT' - i_attachment_subject = 'abap2xlsx.xlsx' - i_attachment_size = lv_bytecount_c - i_att_content_hex = lt_file_tab ). - -lo_sender = cl_sapuser_bcs=>create( sy-uname ). -lo_recipient = cl_sapuser_bcs=>create( sy-uname ). - -lo_send_request = cl_bcs=>create_persistent( ). -lo_send_request->set_document( lo_document ). -lo_send_request->set_sender( lo_sender ). -lo_send_request->add_recipient( lo_recipient ). -lo_send_request->set_send_immediately( abap_true ). -lo_send_request->send( ). diff --git a/src/demos/zdemo_teched9.prog.xml b/src/demos/zdemo_teched9.prog.xml deleted file mode 100644 index 00fd26d32..000000000 --- a/src/demos/zdemo_teched9.prog.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - ZDEMO_TECHED9 - 1 - T - E - X - X - - - - R - abap2xlsx Demo: Hello World - 27 - - - S - P_PATH - . - 9 - D - - - - - diff --git a/src/demos/zexcel_s_org_rel.tabl.xml b/src/demos/zexcel_s_org_rel.tabl.xml deleted file mode 100644 index 00f5d68c3..000000000 --- a/src/demos/zexcel_s_org_rel.tabl.xml +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - ZEXCEL_S_ORG_REL - E - INTTAB - X - Organization & Contact Person download - 1 - - - - ORG_GUID - BAPIGUID - 0 - E - - - CONTPERS_GUID - BAPIGUID - 0 - E - - - ORG_NUMBER - BU_PARTNER - 0 - D - E - - - CONTPERS_NUMBER - BU_PARTNER - 0 - D - E - - - .INCLUDE - 0 - BAPIBUS1006_CENTRAL_ORGAN - S - SAP BP: BAPI Structure for Organization Data - S - - - .INCLUDE - 0 - LANGU - BAPIBUS1006_ADDRESS - S - SAP BP: BAPI Structure for Address Data - S - - - .INCLUDE - 0 - BAPIBUS1006_CENTRAL_PERSON - S - SAP BP: BAPI Structure for Personal Data - S - - - .INCLUDE - 0 - BAPIBUS1006002_CENTRAL - S - SAP BP, CP Rel.: BAPI Structure for Central Data - S - - - - - AUTHORITY - * - REF - CN - X - Y - 1 - - - CORRESPONDLANGUAGE - * - REF - CN - X - Y - C - - - COUNTRY - * - REF - CN - X - Y - 1 - - - DEPARTMENT - * - REF - CN - X - Y - 1 - - - FUNCTION - * - REF - CN - X - Y - 1 - - - INDUSTRYSECTOR - * - REF - CN - X - Y - 1 - - - LEGALFORM - * - KEY - CN - X - Y - 1 - - - MARITALSTATUS - * - CN - X - Y - 1 - - - NAMCOUNTRY - * - REF - CN - X - Y - C - - - NAMEFORMAT - * - REF - CN - X - Y - C - - - POBOX_CTRY - * - REF - CN - X - Y - C - - - PO_BOX_REG - * - CN - X - Y - C - - - PREFIX1 - * - X - Y - - - PREFIX2 - * - X - Y - - - REGIOGROUP - * - REF - CN - X - Y - C - - - REGION - * - REF - CN - X - Y - C - - - STR_ABBR - * - REF - CN - X - Y - C - - - TIME_ZONE - * - REF - CN - X - Y - C - - - TITLE_ACA1 - * - X - Y - - - TITLE_ACA2 - * - X - Y - - - TITLE_SPPL - * - X - Y - - - VIP - * - REF - CN - X - h - Y - 1 - - - - - diff --git a/src/demos/ztest_excel_image_header.prog.abap b/src/demos/ztest_excel_image_header.prog.abap deleted file mode 100644 index 4214c15a9..000000000 --- a/src/demos/ztest_excel_image_header.prog.abap +++ /dev/null @@ -1,106 +0,0 @@ -*&---------------------------------------------------------------------* -*& Report ZTEST_EXCEL_IMAGE_HEADER -*& -*&---------------------------------------------------------------------* -*& -*& -*&---------------------------------------------------------------------* - -REPORT ztest_excel_image_header. - -DATA: lo_excel TYPE REF TO zcl_excel, - lo_worksheet TYPE REF TO zcl_excel_worksheet, - lo_drawing TYPE REF TO zcl_excel_drawing, - ls_key TYPE wwwdatatab, - ls_header TYPE zexcel_s_worksheet_head_foot, - ls_footer TYPE zexcel_s_worksheet_head_foot, - lv_content TYPE xstring. - - -DATA: ls_io TYPE skwf_io. - -CONSTANTS: gc_save_file_name TYPE string VALUE 'Image_Header_Footer.xlsx'. -INCLUDE zdemo_excel_outputopt_incl. - -START-OF-SELECTION. - - " Creates active sheet - CREATE OBJECT lo_excel. - -********************************************************************** -*** Header Center - " create global drawing, set position and media from web repository - lo_drawing = lo_excel->add_new_drawing( ip_type = zcl_excel_drawing=>type_image_header_footer ). - - ls_key-relid = 'MI'. - ls_key-objid = 'SAPLOGO.GIF'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 166 - ip_height = 75 ). -********************************************************************** - ls_header-center_image = lo_drawing. - - -********************************************************************** -*** Header Left - " create global drawing, set position and media from web repository - lo_drawing = lo_excel->add_new_drawing( ip_type = zcl_excel_drawing=>type_image_header_footer ). - - ls_key-relid = 'MI'. - ls_key-objid = 'SAPLOGO.GIF'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 166 - ip_height = 75 ). - - - ls_header-left_image = ls_footer-left_image = lo_drawing. - ls_header-left_value = 'Hallo'. - lo_worksheet = lo_excel->get_active_worksheet( ). - - lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header - ip_odd_footer = ls_footer ). - -********************************************************************** -*** Normal Image - " 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 ). - -********************************************************************** -********************************************************************** -* New sheet - lo_worksheet = lo_excel->add_new_worksheet( 'Sheet2' ). - - " Add some content otherwise the error "nothing to be printed" is shown - lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'Hello world' ). - -********************************************************************** -*** Header Left - " create global drawing, set position and media from web repository - lo_drawing = lo_excel->add_new_drawing( ip_type = zcl_excel_drawing=>type_image_header_footer ). - - ls_key-relid = 'MI'. - ls_key-objid = 'SAPLOGO.GIF'. - lo_drawing->set_media_www( ip_key = ls_key - ip_width = 166 - ip_height = 75 ). - - - CLEAR ls_header. - ls_header-left_image = ls_footer-left_image = lo_drawing. - - lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header ). - - -*** Create output - lcl_output=>output( lo_excel ). diff --git a/src/demos/ztest_excel_image_header.prog.xml b/src/demos/ztest_excel_image_header.prog.xml deleted file mode 100644 index c57e5e574..000000000 --- a/src/demos/ztest_excel_image_header.prog.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - ZTEST_EXCEL_IMAGE_HEADER - 1 - D - X - X - - - - R - 34 - - - - - D - - - R - Image Excel header - 18 - - - - - - - From e2521a1480d16149744a8e019a59591a3f3786df Mon Sep 17 00:00:00 2001 From: sandraros Date: Sun, 6 Mar 2022 13:44:11 +0000 Subject: [PATCH 2/3] remove unused zexcel_export_dir --- src/zexcel_export_dir.dtel.xml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/zexcel_export_dir.dtel.xml diff --git a/src/zexcel_export_dir.dtel.xml b/src/zexcel_export_dir.dtel.xml deleted file mode 100644 index c7e59ed32..000000000 --- a/src/zexcel_export_dir.dtel.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - ZEXCEL_EXPORT_DIR - E - TEXT255 - 20 - 10 - 15 - 20 - Export Directory - Export Directory - Exprt D - Exprt D - Export Directory - E - D - - - - From 36f92a4fd860aca8dafe8b2ac063463db6a5b5fa Mon Sep 17 00:00:00 2001 From: sandraros <34005250+sandraros@users.noreply.github.com> Date: Sun, 6 Mar 2022 15:00:29 +0100 Subject: [PATCH 3/3] + procedure for the demo programs --- docs/abapGit-installation.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/abapGit-installation.md b/docs/abapGit-installation.md index ecf54abdc..1573184a0 100644 --- a/docs/abapGit-installation.md +++ b/docs/abapGit-installation.md @@ -4,8 +4,10 @@ ## 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* ![abapGit New Online Repository](new-online-abap2xlsx.png) 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*.