From dea6cfd9f0c162f16d2e7f8c7e03b9822a6097fa Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Fri, 24 Dec 2021 18:11:40 +0100 Subject: [PATCH] refactor all MOVE statements (#926) * refactor all MOVE statements * fix whitespace Co-authored-by: sandraros <34005250+sandraros@users.noreply.github.com> --- abaplint.json | 4 +- src/not_cloud/zcl_excel_ole.clas.abap | 10 +- src/zcl_excel_common.clas.abap | 4 +- src/zcl_excel_converter.clas.abap | 2 +- src/zcl_excel_reader_2007.clas.abap | 4 +- src/zcl_excel_style_changer.clas.abap | 8 +- src/zcl_excel_worksheet.clas.abap | 30 ++--- src/zcl_excel_writer_2007.clas.abap | 142 +++++++++++------------ src/zcl_excel_writer_huge_file.clas.abap | 4 +- src/zcl_excel_writer_xlsm.clas.abap | 6 +- 10 files changed, 108 insertions(+), 106 deletions(-) diff --git a/abaplint.json b/abaplint.json index 2ba0307..868ab71 100644 --- a/abaplint.json +++ b/abaplint.json @@ -152,7 +152,9 @@ "allowExit": false }, "line_only_punc": false, - "obsolete_statement": false, + "obsolete_statement": { + "move": true + }, "start_at_tab": false, "whitespace_end": true, "exporting": false, diff --git a/src/not_cloud/zcl_excel_ole.clas.abap b/src/not_cloud/zcl_excel_ole.clas.abap index 1a02354..b97e571 100644 --- a/src/not_cloud/zcl_excel_ole.clas.abap +++ b/src/not_cloud/zcl_excel_ole.clas.abap @@ -1325,13 +1325,13 @@ CLASS zcl_excel_ole IMPLEMENTATION. contentsitem-row = realoverflow. IF sy-subrc = 0. - MOVE semaitem-col_ops TO search_item(3). + search_item(3) = semaitem-col_ops. SEARCH 'ADD#CNT#MIN#MAX#AVG#NOP#DFT#' FOR search_item. IF sy-subrc NE 0. RAISE error_in_sema. ENDIF. - MOVE semaitem-col_typ TO search_item(3). + search_item(3) = semaitem-col_typ. SEARCH 'NUM#N00#N01#N02#N03#N04#PCT#DAT#MON#STR#' FOR search_item. IF sy-subrc NE 0. @@ -1382,7 +1382,7 @@ CLASS zcl_excel_ole IMPLEMENTATION. CLEAR contentsitem-value. ENDIF. ELSE. - MOVE TO contentsitem-value. + contentsitem-value = . ENDIF. ELSEIF semaitem-col_typ EQ 'NUM' OR semaitem-col_typ EQ 'N00' OR @@ -1758,7 +1758,7 @@ CLASS zcl_excel_ole IMPLEMENTATION. IF curritem-left EQ curritem2-left. length = curritem-top + curritem-rows. IF length EQ curritem2-top AND curritem-decimals EQ curritem2-decimals. - MOVE curritem TO curritem3. + curritem3 = curritem. curritem3-rows = curritem3-rows + curritem2-rows. curritem-left = -1. MODIFY currcells INDEX sy-index FROM curritem. @@ -1794,7 +1794,7 @@ CLASS zcl_excel_ole IMPLEMENTATION. curritem2-rows. length = curritem-left + curritem-columns. IF length EQ curritem2-left AND curritem-decimals EQ curritem2-decimals. - MOVE curritem TO curritem3. + curritem3 = curritem. curritem3-columns = curritem3-columns + curritem2-columns. curritem-left = -1. MODIFY currcells INDEX sy-index FROM curritem. diff --git a/src/zcl_excel_common.clas.abap b/src/zcl_excel_common.clas.abap index 6ae1159..f035070 100644 --- a/src/zcl_excel_common.clas.abap +++ b/src/zcl_excel_common.clas.abap @@ -1261,7 +1261,7 @@ CLASS zcl_excel_common IMPLEMENTATION. * Capture reference cell address *--------------------------------------------------------------------* TRY. - MOVE: lv_ref_formula+lv_offset1(lv_tlen) TO lv_ref_cell_addr. "Ref cell address + lv_ref_cell_addr = lv_ref_formula+lv_offset1(lv_tlen). "Ref cell address CATCH cx_root. lv_errormessage = 'Internal error in Class ZCL_EXCEL_COMMON Method SHIFT_FORMULA Spot 1 '. " Change to messageclass if possible zcx_excel=>raise_text( lv_errormessage ). @@ -1445,7 +1445,7 @@ CLASS zcl_excel_common IMPLEMENTATION. * Return resulting formula *--------------------------------------------------------------------* IF lv_cur_form IS NOT INITIAL. - MOVE lv_cur_form TO ev_resulting_formula. + ev_resulting_formula = lv_cur_form. ENDIF. ENDMETHOD. diff --git a/src/zcl_excel_converter.clas.abap b/src/zcl_excel_converter.clas.abap index 00741a5..4fa17c8 100644 --- a/src/zcl_excel_converter.clas.abap +++ b/src/zcl_excel_converter.clas.abap @@ -836,7 +836,7 @@ CLASS zcl_excel_converter IMPLEMENTATION. CLEAR l_func. ENDCASE. - MOVE i_value TO l_string. + l_string = i_value. CONCATENATE l_string l_func INTO r_text SEPARATED BY space. diff --git a/src/zcl_excel_reader_2007.clas.abap b/src/zcl_excel_reader_2007.clas.abap index 4307e24..48154b3 100644 --- a/src/zcl_excel_reader_2007.clas.abap +++ b/src/zcl_excel_reader_2007.clas.abap @@ -3806,7 +3806,7 @@ CLASS zcl_excel_reader_2007 IMPLEMENTATION. lv_actual_length_line TYPE i, lv_errormessage TYPE string. - MOVE i_filename TO lv_filename. + lv_filename = i_filename. DESCRIBE FIELD ls_binary_data LENGTH lv_max_length_line IN BYTE MODE. OPEN DATASET lv_filename FOR INPUT IN BINARY MODE. @@ -3843,7 +3843,7 @@ CLASS zcl_excel_reader_2007 IMPLEMENTATION. lv_filename TYPE string, lv_errormessage TYPE string. - MOVE i_filename TO lv_filename. + lv_filename = i_filename. cl_gui_frontend_services=>gui_upload( EXPORTING filename = lv_filename diff --git a/src/zcl_excel_style_changer.clas.abap b/src/zcl_excel_style_changer.clas.abap index 22bcfd0..1373c67 100644 --- a/src/zcl_excel_style_changer.clas.abap +++ b/src/zcl_excel_style_changer.clas.abap @@ -574,10 +574,10 @@ CLASS zcl_excel_style_changer IMPLEMENTATION. fontx = ip_xfont. ELSE. * Only supplied values should be used - exception: Flags bold and italic strikethrough underline - MOVE 'X' TO: fontx-bold, - fontx-italic, - fontx-strikethrough, - fontx-underline_mode. + fontx-bold = 'X'. + fontx-italic = 'X'. + fontx-strikethrough = 'X'. + fontx-underline_mode = 'X'. CLEAR fontx-color WITH 'X'. clear_initial_colorxfields( EXPORTING diff --git a/src/zcl_excel_worksheet.clas.abap b/src/zcl_excel_worksheet.clas.abap index 92305f1..9878bdc 100644 --- a/src/zcl_excel_worksheet.clas.abap +++ b/src/zcl_excel_worksheet.clas.abap @@ -2986,15 +2986,15 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. lv_column_start_int TYPE zexcel_cell_column_alpha, lv_column_end_int TYPE zexcel_cell_column_alpha. - MOVE: ip_row_to TO lv_row_end, - ip_row TO lv_row. + lv_row_end = ip_row_to. + lv_row = ip_row. IF lv_row_end IS INITIAL OR ip_row_to IS NOT SUPPLIED. lv_row_end = lv_row. ENDIF. - MOVE: ip_column_start TO lv_column_start, - ip_column_end TO lv_column_end. + lv_column_start = ip_column_start. + lv_column_end = ip_column_end. IF lv_column_end IS INITIAL OR ip_column_end IS NOT SUPPLIED. lv_column_end = lv_column_start. @@ -3109,14 +3109,14 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. ld_column_int TYPE zexcel_cell_column_alpha, ld_column_end_int TYPE zexcel_cell_column_alpha. - MOVE: ip_row_to TO ld_row_end, - ip_row TO ld_row. + ld_row_end = ip_row_to. + ld_row = ip_row. IF ld_row_end IS INITIAL OR ip_row_to IS NOT SUPPLIED. ld_row_end = ld_row. ENDIF. - MOVE: ip_column_start TO ld_column, - ip_column_end TO ld_column_end. + ld_column = ip_column_start. + ld_column_end = ip_column_end. IF ld_column_end IS INITIAL OR ip_column_end IS NOT SUPPLIED. ld_column_end = ld_column. @@ -3175,8 +3175,8 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. DATA: lv_column TYPE zexcel_cell_column, lo_hyperlink TYPE REF TO zcl_excel_hyperlink. - MOVE: ip_row_to TO ld_row_end, - ip_row TO ld_row_start. + ld_row_end = ip_row_to. + ld_row_start = ip_row. IF ld_row_end IS INITIAL OR ip_row_to IS NOT SUPPLIED. ld_row_end = ld_row_start. ENDIF. @@ -3218,8 +3218,8 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. ld_current_column TYPE zexcel_cell_column_alpha, ld_current_row TYPE zexcel_cell_row. - MOVE: ip_row_to TO ld_row_end, - ip_row TO ld_row_start. + ld_row_end = ip_row_to. + ld_row_start = ip_row. IF ld_row_end IS INITIAL OR ip_row_to IS NOT SUPPLIED. ld_row_end = ld_row_start. ENDIF. @@ -3689,8 +3689,8 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. ld_current_column TYPE zexcel_cell_column_alpha, ld_current_row TYPE zexcel_cell_row. - MOVE: ip_row_to TO ld_row_end, - ip_row TO ld_row_start. + ld_row_end = ip_row_to. + ld_row_start = ip_row. IF ld_row_end IS INITIAL. ld_row_end = ld_row_start. ENDIF. @@ -3832,7 +3832,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. LOOP AT ip_table ASSIGNING . lv_column_alpha = zcl_excel_common=>convert_column2alpha( lv_column_int ). ASSIGN COMPONENT -fieldname OF STRUCTURE TO . - MOVE TO lv_cell_value. + lv_cell_value = . me->set_cell( ip_column = lv_column_alpha ip_row = lv_row_int ip_value = "lv_cell_value diff --git a/src/zcl_excel_writer_2007.clas.abap b/src/zcl_excel_writer_2007.clas.abap index 9fc333a..417bd2b 100644 --- a/src/zcl_excel_writer_2007.clas.abap +++ b/src/zcl_excel_writer_2007.clas.abap @@ -699,7 +699,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lo_element = lo_document->create_simple_element( name = lc_xml_node_override parent = lo_document ). - MOVE sy-index TO lv_worksheets_numc. + lv_worksheets_numc = sy-index. SHIFT lv_worksheets_numc LEFT DELETING LEADING '0'. lv_xml_node_worksheet_pn = lc_xml_node_worksheet_pn. REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_worksheet_pn WITH lv_worksheets_numc. @@ -3589,7 +3589,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. DELETE lt_cell_data WHERE cell_formula IS NOT INITIAL. " delete formula content DESCRIBE TABLE lt_cell_data LINES lv_count. - MOVE lv_count TO lv_count_str. + lv_count_str = lv_count. " separating plain and rich text format strings lt_cell_data_rtf = lt_cell_data. @@ -3611,7 +3611,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. FREE lt_cell_data_rtf. DESCRIBE TABLE lt_cell_data LINES lv_uniquecount. - MOVE lv_uniquecount TO lv_uniquecount_str. + lv_uniquecount_str = lv_uniquecount. SHIFT lv_uniquecount_str RIGHT DELETING TRAILING space. SHIFT lv_uniquecount_str LEFT DELETING LEADING space. @@ -3620,9 +3620,9 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. LOOP AT lt_cell_data ASSIGNING WHERE data_type = 's'. * lv_sytabix = sy-tabix - 1. lv_sytabix = lv_count. - MOVE lv_sytabix TO ls_shared_string-string_no. - MOVE -cell_value TO ls_shared_string-string_value. - MOVE -data_type TO ls_shared_string-string_type. + ls_shared_string-string_no = lv_sytabix. + ls_shared_string-string_value = -cell_value. + ls_shared_string-string_type = -data_type. ls_shared_string-rtf_tab = -rtf_tab. INSERT ls_shared_string INTO TABLE shared_strings. ADD 1 TO lv_count. @@ -4395,7 +4395,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. " sheetProtection node lo_element = lo_document->create_simple_element( name = lc_xml_node_sheetprotection parent = lo_document ). - MOVE io_worksheet->zif_excel_sheet_protection~password TO lv_value. + lv_value = io_worksheet->zif_excel_sheet_protection~password. IF lv_value IS NOT INITIAL. lo_element->set_attribute_ns( name = lc_xml_attr_password value = lv_value ). @@ -4669,12 +4669,12 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_databar parent = lo_document ). - MOVE ls_databar-cfvo1_value TO ls_cfvo-value. - MOVE ls_databar-cfvo1_type TO ls_cfvo-type. + ls_cfvo-value = ls_databar-cfvo1_value. + ls_cfvo-type = ls_databar-cfvo1_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_databar-cfvo2_value TO ls_cfvo-value. - MOVE ls_databar-cfvo2_type TO ls_cfvo-type. + ls_cfvo-value = ls_databar-cfvo2_value. + ls_cfvo-type = ls_databar-cfvo2_type. APPEND ls_cfvo TO lt_cfvo. LOOP AT lt_cfvo INTO ls_cfvo. @@ -4709,16 +4709,16 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lo_element_3 = lo_document->create_simple_element( name = lc_xml_node_colorscale parent = lo_document ). - MOVE ls_colorscale-cfvo1_value TO ls_cfvo-value. - MOVE ls_colorscale-cfvo1_type TO ls_cfvo-type. + ls_cfvo-value = ls_colorscale-cfvo1_value. + ls_cfvo-type = ls_colorscale-cfvo1_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_colorscale-cfvo2_value TO ls_cfvo-value. - MOVE ls_colorscale-cfvo2_type TO ls_cfvo-type. + ls_cfvo-value = ls_colorscale-cfvo2_value. + ls_cfvo-type = ls_colorscale-cfvo2_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_colorscale-cfvo3_value TO ls_cfvo-value. - MOVE ls_colorscale-cfvo3_type TO ls_cfvo-type. + ls_cfvo-value = ls_colorscale-cfvo3_value. + ls_cfvo-type = ls_colorscale-cfvo3_type. APPEND ls_cfvo TO lt_cfvo. APPEND ls_colorscale-colorrgb1 TO lt_colors. @@ -4788,50 +4788,50 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. zcl_excel_style_cond=>c_iconset_3symbols2 OR zcl_excel_style_cond=>c_iconset_3trafficlights OR zcl_excel_style_cond=>c_iconset_3trafficlights2. - MOVE ls_iconset-cfvo1_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo1_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo1_value. + ls_cfvo-type = ls_iconset-cfvo1_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo2_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo2_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo2_value. + ls_cfvo-type = ls_iconset-cfvo2_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo3_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo3_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo3_value. + ls_cfvo-type = ls_iconset-cfvo3_type. APPEND ls_cfvo TO lt_cfvo. WHEN zcl_excel_style_cond=>c_iconset_4arrows OR zcl_excel_style_cond=>c_iconset_4arrowsgray OR zcl_excel_style_cond=>c_iconset_4rating OR zcl_excel_style_cond=>c_iconset_4redtoblack OR zcl_excel_style_cond=>c_iconset_4trafficlights. - MOVE ls_iconset-cfvo1_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo1_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo1_value. + ls_cfvo-type = ls_iconset-cfvo1_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo2_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo2_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo2_value. + ls_cfvo-type = ls_iconset-cfvo2_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo3_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo3_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo3_value. + ls_cfvo-type = ls_iconset-cfvo3_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo4_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo4_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo4_value. + ls_cfvo-type = ls_iconset-cfvo4_type. APPEND ls_cfvo TO lt_cfvo. WHEN zcl_excel_style_cond=>c_iconset_5arrows OR zcl_excel_style_cond=>c_iconset_5arrowsgray OR zcl_excel_style_cond=>c_iconset_5quarters OR zcl_excel_style_cond=>c_iconset_5rating. - MOVE ls_iconset-cfvo1_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo1_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo1_value. + ls_cfvo-type = ls_iconset-cfvo1_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo2_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo2_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo2_value. + ls_cfvo-type = ls_iconset-cfvo2_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo3_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo3_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo3_value. + ls_cfvo-type = ls_iconset-cfvo3_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo4_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo4_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo4_value. + ls_cfvo-type = ls_iconset-cfvo4_type. APPEND ls_cfvo TO lt_cfvo. - MOVE ls_iconset-cfvo5_value TO ls_cfvo-value. - MOVE ls_iconset-cfvo5_type TO ls_cfvo-type. + ls_cfvo-value = ls_iconset-cfvo5_value. + ls_cfvo-type = ls_iconset-cfvo5_type. APPEND ls_cfvo TO lt_cfvo. WHEN OTHERS. CLEAR lt_cfvo. @@ -5791,7 +5791,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lv_index_str = iv_drawing_index. CONDENSE lv_index_str NO-GAPS. - MOVE me->c_xl_drawings TO lv_value. + lv_value = me->c_xl_drawings. REPLACE 'xl' WITH '..' INTO lv_value. REPLACE '#' WITH lv_index_str INTO lv_value. lo_element->set_attribute_ns( name = lc_xml_attr_target @@ -5823,7 +5823,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lv_index_str = iv_comment_index. CONDENSE lv_index_str NO-GAPS. - MOVE me->cl_xl_drawing_for_comments TO lv_value. + lv_value = me->cl_xl_drawing_for_comments. REPLACE 'xl' WITH '..' INTO lv_value. REPLACE '#' WITH lv_index_str INTO lv_value. lo_element->set_attribute_ns( name = lc_xml_attr_target @@ -5845,7 +5845,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lv_index_str = iv_comment_index. CONDENSE lv_index_str NO-GAPS. - MOVE me->c_xl_comments TO lv_value. + lv_value = me->c_xl_comments. REPLACE 'xl' WITH '..' INTO lv_value. REPLACE '#' WITH lv_index_str INTO lv_value. lo_element->set_attribute_ns( name = lc_xml_attr_target @@ -5873,7 +5873,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lv_index_str = lv_comment_index. CONDENSE lv_index_str NO-GAPS. - MOVE me->cl_xl_drawing_for_comments TO lv_value. + lv_value = me->cl_xl_drawing_for_comments. REPLACE 'xl' WITH '..' INTO lv_value. REPLACE '#' WITH lv_index_str INTO lv_value. lo_element->set_attribute_ns( name = lc_xml_attr_target @@ -6920,25 +6920,25 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. " update attribute "count" DESCRIBE TABLE lt_fonts LINES lv_fonts_count. - MOVE lv_fonts_count TO lv_value. + lv_value = lv_fonts_count. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element_fonts->set_attribute_ns( name = lc_xml_attr_count value = lv_value ). DESCRIBE TABLE lt_fills LINES lv_fills_count. - MOVE lv_fills_count TO lv_value. + lv_value = lv_fills_count. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element_fills->set_attribute_ns( name = lc_xml_attr_count value = lv_value ). DESCRIBE TABLE lt_borders LINES lv_borders_count. - MOVE lv_borders_count TO lv_value. + lv_value = lv_borders_count. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element_borders->set_attribute_ns( name = lc_xml_attr_count value = lv_value ). DESCRIBE TABLE lt_cellxfs LINES lv_cellxfs_count. - MOVE lv_cellxfs_count TO lv_value. + lv_value = lv_cellxfs_count. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element_cellxfs->set_attribute_ns( name = lc_xml_attr_count @@ -6973,61 +6973,61 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. LOOP AT lt_cellxfs INTO ls_cellxfs. lo_element = lo_document->create_simple_element( name = lc_xml_node_xf parent = lo_document ). - MOVE ls_cellxfs-numfmtid TO lv_value. + lv_value = ls_cellxfs-numfmtid. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_numfmtid value = lv_value ). - MOVE ls_cellxfs-fontid TO lv_value. + lv_value = ls_cellxfs-fontid. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_fontid value = lv_value ). - MOVE ls_cellxfs-fillid TO lv_value. + lv_value = ls_cellxfs-fillid. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_fillid value = lv_value ). - MOVE ls_cellxfs-borderid TO lv_value. + lv_value = ls_cellxfs-borderid. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_borderid value = lv_value ). - MOVE ls_cellxfs-xfid TO lv_value. + lv_value = ls_cellxfs-xfid. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_xfid value = lv_value ). IF ls_cellxfs-applynumberformat EQ 1. - MOVE ls_cellxfs-applynumberformat TO lv_value. + lv_value = ls_cellxfs-applynumberformat. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_applynumberformat value = lv_value ). ENDIF. IF ls_cellxfs-applyfont EQ 1. - MOVE ls_cellxfs-applyfont TO lv_value. + lv_value = ls_cellxfs-applyfont. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_applyfont value = lv_value ). ENDIF. IF ls_cellxfs-applyfill EQ 1. - MOVE ls_cellxfs-applyfill TO lv_value. + lv_value = ls_cellxfs-applyfill. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_applyfill value = lv_value ). ENDIF. IF ls_cellxfs-applyborder EQ 1. - MOVE ls_cellxfs-applyborder TO lv_value. + lv_value = ls_cellxfs-applyborder. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_applyborder value = lv_value ). ENDIF. IF ls_cellxfs-applyalignment EQ 1. " depends on each style not for all the sheet - MOVE ls_cellxfs-applyalignment TO lv_value. + lv_value = ls_cellxfs-applyalignment. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_element->set_attribute_ns( name = lc_xml_attr_applyalignment @@ -7038,12 +7038,12 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. READ TABLE lt_alignments INTO ls_alignment INDEX ls_cellxfs-alignmentid. SUBTRACT 1 FROM ls_cellxfs-alignmentid. IF ls_alignment-horizontal IS NOT INITIAL. - MOVE ls_alignment-horizontal TO lv_value. + lv_value = ls_alignment-horizontal. lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_horizontal value = lv_value ). ENDIF. IF ls_alignment-vertical IS NOT INITIAL. - MOVE ls_alignment-vertical TO lv_value. + lv_value = ls_alignment-vertical. lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_vertical value = lv_value ). ENDIF. @@ -7052,7 +7052,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. value = c_on ). ENDIF. IF ls_alignment-textrotation IS NOT INITIAL. - MOVE ls_alignment-textrotation TO lv_value. + lv_value = ls_alignment-textrotation. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_textrotation @@ -7063,7 +7063,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. value = c_on ). ENDIF. IF ls_alignment-indent IS NOT INITIAL. - MOVE ls_alignment-indent TO lv_value. + lv_value = ls_alignment-indent. SHIFT lv_value RIGHT DELETING TRAILING space. SHIFT lv_value LEFT DELETING LEADING space. lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_indent @@ -7073,7 +7073,7 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. lo_element->append_child( new_child = lo_sub_element_2 ). ENDIF. IF ls_cellxfs-applyprotection EQ 1. - MOVE ls_cellxfs-applyprotection TO lv_value. + lv_value = ls_cellxfs-applyprotection. CONDENSE lv_value NO-GAPS. lo_element->set_attribute_ns( name = lc_xml_attr_applyprotection value = lv_value ). @@ -7083,13 +7083,13 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. READ TABLE lt_protections INTO ls_protection INDEX ls_cellxfs-protectionid. SUBTRACT 1 FROM ls_cellxfs-protectionid. IF ls_protection-locked IS NOT INITIAL. - MOVE ls_protection-locked TO lv_value. + lv_value = ls_protection-locked. CONDENSE lv_value. lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_locked value = lv_value ). ENDIF. IF ls_protection-hidden IS NOT INITIAL. - MOVE ls_protection-hidden TO lv_value. + lv_value = ls_protection-hidden. CONDENSE lv_value. lo_sub_element_2->set_attribute_ns( name = lc_xml_attr_hidden value = lv_value ). @@ -7692,25 +7692,25 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION. IF me->excel->zif_excel_book_protection~protected EQ abap_true. lo_element = lo_document->create_simple_element( name = lc_xml_node_workbookprotection parent = lo_document ). - MOVE me->excel->zif_excel_book_protection~workbookpassword TO lv_value. + lv_value = me->excel->zif_excel_book_protection~workbookpassword. IF lv_value IS NOT INITIAL. lo_element->set_attribute_ns( name = lc_xml_attr_workbookpassword value = lv_value ). ENDIF. - MOVE me->excel->zif_excel_book_protection~revisionspassword TO lv_value. + lv_value = me->excel->zif_excel_book_protection~revisionspassword. IF lv_value IS NOT INITIAL. lo_element->set_attribute_ns( name = lc_xml_attr_revisionspassword value = lv_value ). ENDIF. - MOVE me->excel->zif_excel_book_protection~lockrevision TO lv_value. + lv_value = me->excel->zif_excel_book_protection~lockrevision. CONDENSE lv_value NO-GAPS. lo_element->set_attribute_ns( name = lc_xml_attr_lockrevision value = lv_value ). - MOVE me->excel->zif_excel_book_protection~lockstructure TO lv_value. + lv_value = me->excel->zif_excel_book_protection~lockstructure. CONDENSE lv_value NO-GAPS. lo_element->set_attribute_ns( name = lc_xml_attr_lockstructure value = lv_value ). - MOVE me->excel->zif_excel_book_protection~lockwindows TO lv_value. + lv_value = me->excel->zif_excel_book_protection~lockwindows. CONDENSE lv_value NO-GAPS. lo_element->set_attribute_ns( name = lc_xml_attr_lockwindows value = lv_value ). diff --git a/src/zcl_excel_writer_huge_file.clas.abap b/src/zcl_excel_writer_huge_file.clas.abap index 68f6eb1..43486fe 100644 --- a/src/zcl_excel_writer_huge_file.clas.abap +++ b/src/zcl_excel_writer_huge_file.clas.abap @@ -101,8 +101,8 @@ CLASS zcl_excel_writer_huge_file IMPLEMENTATION. LOOP AT lt_cell_data ASSIGNING . lv_sytabix = sy-tabix - 1. - MOVE lv_sytabix TO ls_shared_string-string_no. - MOVE -cell_value TO ls_shared_string-string_value. + ls_shared_string-string_no = lv_sytabix. + ls_shared_string-string_value = -cell_value. REPLACE ALL OCCURRENCES OF REGEX lv_invalid IN ls_shared_string-string_value WITH ` `. APPEND ls_shared_string TO shared_strings. diff --git a/src/zcl_excel_writer_xlsm.clas.abap b/src/zcl_excel_writer_xlsm.clas.abap index 12f667e..c275e24 100644 --- a/src/zcl_excel_writer_xlsm.clas.abap +++ b/src/zcl_excel_writer_xlsm.clas.abap @@ -151,8 +151,8 @@ CLASS zcl_excel_writer_xlsm IMPLEMENTATION. lv_content = me->create_xl_sheet( io_worksheet = lo_worksheet iv_active = lv_active ). lv_xl_sheet = me->c_xl_sheet. - MOVE sy-index TO: lv_syindex, - lv_comment_index. " (+) Issue 588 + lv_syindex = sy-index. + lv_comment_index = sy-index. " (+) Issue 588 SHIFT lv_syindex RIGHT DELETING TRAILING space. SHIFT lv_syindex LEFT DELETING LEADING space. REPLACE ALL OCCURRENCES OF '#' IN lv_xl_sheet WITH lv_syindex. @@ -182,7 +182,7 @@ CLASS zcl_excel_writer_xlsm IMPLEMENTATION. * Add drawings ********************************** lo_drawings = lo_worksheet->get_drawings( ). IF lo_drawings->is_empty( ) = abap_false. - MOVE lv_drawing_index TO lv_syindex. + lv_syindex = lv_drawing_index. SHIFT lv_syindex RIGHT DELETING TRAILING space. SHIFT lv_syindex LEFT DELETING LEADING space.