From 16fac218f7a7ffc6a634063a611def7660176681 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:44:19 +0100 Subject: [PATCH 1/7] Update zcl_excel_converter.clas.abap --- src/not_cloud/zcl_excel_converter.clas.abap | 180 +++++++++----------- 1 file changed, 77 insertions(+), 103 deletions(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.abap b/src/not_cloud/zcl_excel_converter.clas.abap index e3c05b3..0ad1ac8 100644 --- a/src/not_cloud/zcl_excel_converter.clas.abap +++ b/src/not_cloud/zcl_excel_converter.clas.abap @@ -133,12 +133,14 @@ CLASS zcl_excel_converter DEFINITION RAISING zcx_excel . METHODS clean_fieldcatalog . - METHODS create_color_style - IMPORTING - !i_style TYPE zexcel_cell_style - !is_colors TYPE zexcel_s_converter_col - RETURNING - VALUE(ro_style) TYPE REF TO zcl_excel_style . + methods COMPLETE_CELL + importing + !IP_TABLE_ROW type ZEXCEL_CELL_ROW + !IP_FIELDNAME type FIELDNAME + !IP_COLUMN type SIMPLE + !IP_ROW type ZEXCEL_CELL_ROW + raising + ZCX_EXCEL . METHODS create_formular_subtotal IMPORTING !i_row_int_start TYPE zexcel_cell_row @@ -206,13 +208,6 @@ CLASS zcl_excel_converter DEFINITION !it_table TYPE STANDARD TABLE RAISING zcx_excel . - METHODS get_color_style - IMPORTING - !i_row TYPE zexcel_cell_row - !i_fieldname TYPE fieldname - !i_style TYPE zexcel_cell_style - RETURNING - VALUE(r_style) TYPE zexcel_cell_style . METHODS get_function_number IMPORTING !i_totals_function TYPE zexcel_table_totals_function @@ -348,12 +343,15 @@ CLASS zcl_excel_converter IMPLEMENTATION. ls_field_catalog TYPE zexcel_s_fieldcatalog, ls_fcat TYPE zexcel_s_converter_fcat, lo_column TYPE REF TO zcl_excel_column, + lv_row_int TYPE zexcel_cell_row, lv_col_int TYPE zexcel_cell_column, lv_col_alpha TYPE zexcel_cell_column_alpha, ls_settings TYPE zexcel_s_table_settings, + lv_tabix TYPE sy-tabix, lv_line TYPE i. - FIELD-SYMBOLS: TYPE ANY TABLE. + FIELD-SYMBOLS: TYPE ANY TABLE, + TYPE ANY. ASSIGN wo_data->* TO . @@ -386,6 +384,15 @@ CLASS zcl_excel_converter IMPLEMENTATION. LOOP AT wt_fieldcatalog INTO ls_fcat. lv_col_int = w_col_int + ls_fcat-position - 1. lv_col_alpha = zcl_excel_common=>convert_column2alpha( lv_col_int ). + lv_row_int = w_row_int. + LOOP AT ASSIGNING . + lv_tabix = sy-tabix. + ADD 1 TO lv_row_int. + complete_cell( ip_table_row = lv_tabix + ip_fieldname = ls_fcat-columnname + ip_column = lv_col_alpha + ip_row = lv_row_int ). + ENDLOOP. * Freeze panes IF ls_fcat-fix_column = abap_true. ADD 1 TO r_freeze_col. @@ -521,22 +528,53 @@ CLASS zcl_excel_converter IMPLEMENTATION. ENDMETHOD. - METHOD create_color_style. - DATA: ls_styles TYPE ts_styles. - DATA: lo_style TYPE REF TO zcl_excel_style. + METHOD complete_cell. - READ TABLE wt_styles INTO ls_styles WITH KEY guid = i_style. - IF sy-subrc = 0. - lo_style = wo_excel->add_new_style( ). - lo_style->font->bold = ls_styles-style->font->bold. - lo_style->alignment->horizontal = ls_styles-style->alignment->horizontal. - lo_style->number_format->format_code = ls_styles-style->number_format->format_code. +* Now let's check for colors + DATA: ls_color TYPE zexcel_s_style_color, + ls_colors TYPE zexcel_s_converter_col, + ls_colors_col LIKE ls_colors, + ls_fieldcat LIKE LINE OF wt_fieldcatalog, + lv_subrc TYPE sy-subrc. - lo_style->font->color-rgb = is_colors-fontcolor. - lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid. - lo_style->fill->fgcolor-rgb = is_colors-fillcolor. + READ TABLE wt_fieldcatalog INTO ls_fieldcat WITH KEY columnname = ip_fieldname. - ro_style = lo_style. +* Gemäss ALV-Logik gilt: Farbe am Feld hat immer oberste Priorität. Sonst gilt: +* Bei Schlüssel-Feldern übersteuert die Spaltenfarbe (dann hellblau) die Zeilenfarbe, +* ausser dies wird durch NOKEYCOL an der Zeile explizit verboten. +* Dann gilt hier wie sonst auch: Zeilenfarbe vor Spaltenfarbe. + IF NOT wt_colors IS INITIAL. +* Field has color + READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row + columnname = ip_fieldname. + IF sy-subrc <> 0. +* Full line has color + READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row + columnname = space. + IF sy-subrc <> 0 OR ls_colors-nokeycol IS INITIAL. + lv_subrc = sy-subrc. +* Fieldcatalog/Column has color + READ TABLE wt_colors INTO ls_colors_col WITH KEY rownumber = 0 + columnname = ip_fieldname. + IF sy-subrc = 0 AND + ( NOT ls_fieldcat-keyflag IS INITIAL OR "Use key color found + lv_subrc <> 0 ). "Use column color if no line color was found + ls_colors = ls_colors_col. + ENDIF. + ENDIF. + ENDIF. + IF NOT ls_colors IS INITIAL. + ls_color-rgb = zcl_excel_style_color=>c_gray. + ls_color-indexed = zcl_excel_style_color=>c_indexed_not_set. + ls_color-theme = zcl_excel_style_color=>c_theme_not_set. + wo_worksheet->change_cell_style( ip_column = ip_column + ip_row = ip_row + ip_font_color_rgb = ls_colors-fontcolor + ip_fill_filltype = zcl_excel_style_fill=>c_fill_solid + ip_fill_fgcolor_rgb = ls_colors-fillcolor + ip_borders_allborders_style = zcl_excel_style_border=>c_border_thin + ip_borders_allborders_color = ls_color ). + ENDIF. ENDIF. ENDMETHOD. @@ -979,64 +1017,6 @@ CLASS zcl_excel_converter IMPLEMENTATION. ENDMETHOD. - METHOD get_color_style. - DATA: ls_colors TYPE zexcel_s_converter_col, - ls_color_styles TYPE ts_color_styles, - lo_style TYPE REF TO zcl_excel_style. - - r_style = i_style. " Default we change nothing - - IF wt_colors IS NOT INITIAL. -* Full line has color - READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = i_row - columnname = space. - IF sy-subrc = 0. - READ TABLE wt_color_styles INTO ls_color_styles WITH KEY guid_old = i_style - fontcolor = ls_colors-fontcolor - fillcolor = ls_colors-fillcolor. - IF sy-subrc = 0. - r_style = ls_color_styles-style_new->get_guid( ). - ELSE. - lo_style = create_color_style( i_style = i_style - is_colors = ls_colors ) . - r_style = lo_style->get_guid( ) . - ls_color_styles-guid_old = i_style. - ls_color_styles-fontcolor = ls_colors-fontcolor. - ls_color_styles-fillcolor = ls_colors-fillcolor. - ls_color_styles-style_new = lo_style. - INSERT ls_color_styles INTO TABLE wt_color_styles. - ENDIF. - ELSE. -* Only field has color - READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = i_row - columnname = i_fieldname. - IF sy-subrc = 0. - READ TABLE wt_color_styles INTO ls_color_styles WITH KEY guid_old = i_style - fontcolor = ls_colors-fontcolor - fillcolor = ls_colors-fillcolor. - IF sy-subrc = 0. - r_style = ls_color_styles-style_new->get_guid( ). - ELSE. - lo_style = create_color_style( i_style = i_style - is_colors = ls_colors ) . - ls_color_styles-guid_old = i_style. - ls_color_styles-fontcolor = ls_colors-fontcolor. - ls_color_styles-fillcolor = ls_colors-fillcolor. - ls_color_styles-style_new = lo_style. - INSERT ls_color_styles INTO TABLE wt_color_styles. - r_style = ls_color_styles-style_new->get_guid( ). - ENDIF. - ELSE. - r_style = i_style. - ENDIF. - ENDIF. - ELSE. - r_style = i_style. - ENDIF. - - ENDMETHOD. - - METHOD get_file. DATA: lo_excel_writer TYPE REF TO zif_excel_writer. @@ -1202,7 +1182,6 @@ CLASS zcl_excel_converter IMPLEMENTATION. l_s_color TYPE abap_bool, lo_column TYPE REF TO zcl_excel_column, l_formula TYPE zexcel_cell_formula, - l_style TYPE zexcel_cell_style, l_cells TYPE i, l_count TYPE i, l_table_row TYPE i. @@ -1247,26 +1226,24 @@ CLASS zcl_excel_converter IMPLEMENTATION. ASSIGN COMPONENT -columnname OF STRUCTURE TO . * Now let's write the cell values IF ws_layout-is_stripped = abap_true AND l_s_color = abap_true. - l_style = get_color_style( i_row = l_table_row - i_fieldname = -columnname - i_style = -style_stripped ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = - ip_style = l_style + ip_style = -style_stripped ip_conv_exit_length = ws_option-conv_exit_length ). CLEAR l_s_color. ELSE. - l_style = get_color_style( i_row = l_table_row - i_fieldname = -columnname - i_style = -style_normal ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = - ip_style = l_style + ip_style = -style_normal ip_conv_exit_length = ws_option-conv_exit_length ). l_s_color = abap_true. ENDIF. + complete_cell( ip_table_row = l_table_row + ip_fieldname = -columnname + ip_column = l_col_alpha + ip_row = l_row_int ). READ TABLE wt_filter TRANSPORTING NO FIELDS WITH TABLE KEY rownumber = l_table_row columnname = -columnname. IF sy-subrc = 0. @@ -1319,7 +1296,6 @@ CLASS zcl_excel_converter IMPLEMENTATION. lo_column TYPE REF TO zcl_excel_column, lo_row TYPE REF TO zcl_excel_row, l_formula TYPE zexcel_cell_formula, - l_style TYPE zexcel_cell_style, l_text TYPE string, ls_sort_values TYPE ts_sort_values, ls_subtotal_rows TYPE ts_subtotal_rows, @@ -1547,26 +1523,24 @@ CLASS zcl_excel_converter IMPLEMENTATION. ENDIF. * Now let's write the cell values IF ws_layout-is_stripped = abap_true AND l_s_color = abap_true. - l_style = get_color_style( i_row = l_table_row - i_fieldname = -columnname - i_style = -style_stripped ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = - ip_style = l_style + ip_style = -style_stripped ip_conv_exit_length = ws_option-conv_exit_length ). CLEAR l_s_color. ELSE. - l_style = get_color_style( i_row = l_table_row - i_fieldname = -columnname - i_style = -style_normal ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = - ip_style = l_style + ip_style = -style_normal ip_conv_exit_length = ws_option-conv_exit_length ). l_s_color = abap_true. ENDIF. + complete_cell( ip_table_row = l_table_row + ip_fieldname = -columnname + ip_column = l_col_alpha + ip_row = l_row_int ). READ TABLE wt_filter TRANSPORTING NO FIELDS WITH TABLE KEY rownumber = l_table_row columnname = -columnname. IF sy-subrc = 0. From 2b83b2c027a3a7984920b89b4af3818ac21c3ed0 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:49:31 +0100 Subject: [PATCH 2/7] Update zcl_excel_converter.clas.abap --- src/not_cloud/zcl_excel_converter.clas.abap | 54 ++++++--------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.abap b/src/not_cloud/zcl_excel_converter.clas.abap index 0ad1ac8..c61558a 100644 --- a/src/not_cloud/zcl_excel_converter.clas.abap +++ b/src/not_cloud/zcl_excel_converter.clas.abap @@ -133,14 +133,14 @@ CLASS zcl_excel_converter DEFINITION RAISING zcx_excel . METHODS clean_fieldcatalog . - methods COMPLETE_CELL - importing - !IP_TABLE_ROW type ZEXCEL_CELL_ROW - !IP_FIELDNAME type FIELDNAME - !IP_COLUMN type SIMPLE - !IP_ROW type ZEXCEL_CELL_ROW - raising - ZCX_EXCEL . + METHODS complete_cell + IMPORTING + !ip_table_row TYPE zexcel_cell_row + !ip_fieldname TYPE fieldname + !ip_column TYPE simple + !ip_row TYPE zexcel_cell_row + RAISING + zcx_excel . METHODS create_formular_subtotal IMPORTING !i_row_int_start TYPE zexcel_cell_row @@ -351,7 +351,7 @@ CLASS zcl_excel_converter IMPLEMENTATION. lv_line TYPE i. FIELD-SYMBOLS: TYPE ANY TABLE, - TYPE ANY. + TYPE any. ASSIGN wo_data->* TO . @@ -530,19 +530,9 @@ CLASS zcl_excel_converter IMPLEMENTATION. METHOD complete_cell. -* Now let's check for colors - DATA: ls_color TYPE zexcel_s_style_color, - ls_colors TYPE zexcel_s_converter_col, - ls_colors_col LIKE ls_colors, - ls_fieldcat LIKE LINE OF wt_fieldcatalog, - lv_subrc TYPE sy-subrc. + DATA: ls_colors TYPE zexcel_s_converter_col. - READ TABLE wt_fieldcatalog INTO ls_fieldcat WITH KEY columnname = ip_fieldname. - -* Gemäss ALV-Logik gilt: Farbe am Feld hat immer oberste Priorität. Sonst gilt: -* Bei Schlüssel-Feldern übersteuert die Spaltenfarbe (dann hellblau) die Zeilenfarbe, -* ausser dies wird durch NOKEYCOL an der Zeile explizit verboten. -* Dann gilt hier wie sonst auch: Zeilenfarbe vor Spaltenfarbe. +* Now let's check for colors IF NOT wt_colors IS INITIAL. * Field has color READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row @@ -551,31 +541,17 @@ CLASS zcl_excel_converter IMPLEMENTATION. * Full line has color READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row columnname = space. - IF sy-subrc <> 0 OR ls_colors-nokeycol IS INITIAL. - lv_subrc = sy-subrc. -* Fieldcatalog/Column has color - READ TABLE wt_colors INTO ls_colors_col WITH KEY rownumber = 0 - columnname = ip_fieldname. - IF sy-subrc = 0 AND - ( NOT ls_fieldcat-keyflag IS INITIAL OR "Use key color found - lv_subrc <> 0 ). "Use column color if no line color was found - ls_colors = ls_colors_col. - ENDIF. - ENDIF. ENDIF. - IF NOT ls_colors IS INITIAL. - ls_color-rgb = zcl_excel_style_color=>c_gray. - ls_color-indexed = zcl_excel_style_color=>c_indexed_not_set. - ls_color-theme = zcl_excel_style_color=>c_theme_not_set. + IF sy-subrc = 0. wo_worksheet->change_cell_style( ip_column = ip_column ip_row = ip_row ip_font_color_rgb = ls_colors-fontcolor ip_fill_filltype = zcl_excel_style_fill=>c_fill_solid - ip_fill_fgcolor_rgb = ls_colors-fillcolor - ip_borders_allborders_style = zcl_excel_style_border=>c_border_thin - ip_borders_allborders_color = ls_color ). + ip_fill_fgcolor_rgb = ls_colors-fillcolor ). ENDIF. ENDIF. + +* todo: hyperlink support ENDMETHOD. From d0b18768a4abbb906d4102a02fcff82fae8c2275 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:01:13 +0100 Subject: [PATCH 3/7] Update zcl_excel_converter.clas.abap --- src/not_cloud/zcl_excel_converter.clas.abap | 37 ++------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.abap b/src/not_cloud/zcl_excel_converter.clas.abap index c61558a..5bc6765 100644 --- a/src/not_cloud/zcl_excel_converter.clas.abap +++ b/src/not_cloud/zcl_excel_converter.clas.abap @@ -54,36 +54,6 @@ CLASS zcl_excel_converter DEFINITION *"* do not include other source files here!!! PROTECTED SECTION. - TYPES: - BEGIN OF t_relationship, - id TYPE string, - type TYPE string, - target TYPE string, - END OF t_relationship . - TYPES: - BEGIN OF t_fileversion, - appname TYPE string, - lastedited TYPE string, - lowestedited TYPE string, - rupbuild TYPE string, - codename TYPE string, - END OF t_fileversion . - TYPES: - BEGIN OF t_sheet, - name TYPE string, - sheetid TYPE string, - id TYPE string, - END OF t_sheet . - TYPES: - BEGIN OF t_workbookpr, - codename TYPE string, - defaultthemeversion TYPE string, - END OF t_workbookpr . - TYPES: - BEGIN OF t_sheetpr, - codename TYPE string, - END OF t_sheetpr . - DATA w_row_int TYPE zexcel_cell_row VALUE 1. "#EC NOTEXT . . . . . . . . . . " . DATA w_col_int TYPE zexcel_cell_column VALUE 1. "#EC NOTEXT . . . . . . . . . . " . *"* private components of class ZCL_EXCEL_CONVERTER @@ -114,7 +84,6 @@ CLASS zcl_excel_converter DEFINITION CONSTANTS c_type_nor TYPE c VALUE 'N'. "#EC NOTEXT CONSTANTS c_type_sub TYPE c VALUE 'S'. "#EC NOTEXT CONSTANTS c_type_tot TYPE c VALUE 'T'. "#EC NOTEXT - DATA wt_color_styles TYPE tt_color_styles . CLASS-DATA ws_option TYPE zexcel_s_converter_option . CLASS-DATA ws_indx TYPE indx . @@ -384,14 +353,14 @@ CLASS zcl_excel_converter IMPLEMENTATION. LOOP AT wt_fieldcatalog INTO ls_fcat. lv_col_int = w_col_int + ls_fcat-position - 1. lv_col_alpha = zcl_excel_common=>convert_column2alpha( lv_col_int ). - lv_row_int = w_row_int. + lv_row_int = w_row_int + 1. "Skip header LOOP AT ASSIGNING . lv_tabix = sy-tabix. - ADD 1 TO lv_row_int. complete_cell( ip_table_row = lv_tabix ip_fieldname = ls_fcat-columnname ip_column = lv_col_alpha ip_row = lv_row_int ). + ADD 1 TO lv_row_int. ENDLOOP. * Freeze panes IF ls_fcat-fix_column = abap_true. @@ -530,9 +499,9 @@ CLASS zcl_excel_converter IMPLEMENTATION. METHOD complete_cell. +* Now let's check for colors DATA: ls_colors TYPE zexcel_s_converter_col. -* Now let's check for colors IF NOT wt_colors IS INITIAL. * Field has color READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row From 4e5563f747ecb2e3c3d9dbe6ad5246a65abec7f7 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:03:12 +0100 Subject: [PATCH 4/7] Update zcl_excel_converter.clas.locals_def.abap --- src/not_cloud/zcl_excel_converter.clas.locals_def.abap | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.locals_def.abap b/src/not_cloud/zcl_excel_converter.clas.locals_def.abap index a61e25e..cb847e7 100644 --- a/src/not_cloud/zcl_excel_converter.clas.locals_def.abap +++ b/src/not_cloud/zcl_excel_converter.clas.locals_def.abap @@ -38,12 +38,3 @@ TYPES: BEGIN OF ts_styles, END OF ts_styles, tt_styles TYPE HASHED TABLE OF ts_styles WITH UNIQUE KEY type alignment inttype decimals. - -TYPES: BEGIN OF ts_color_styles, - guid_old TYPE zexcel_cell_style, - fontcolor TYPE zexcel_style_color_argb, - fillcolor TYPE zexcel_style_color_argb, - style_new TYPE REF TO zcl_excel_style, - END OF ts_color_styles, - - tt_color_styles TYPE HASHED TABLE OF ts_color_styles WITH UNIQUE KEY guid_old fontcolor fillcolor. From efd87719d33dfb3810544869e331a1af603e87f3 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:08:42 +0100 Subject: [PATCH 5/7] Update zcl_excel_converter.clas.xml --- src/not_cloud/zcl_excel_converter.clas.xml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.xml b/src/not_cloud/zcl_excel_converter.clas.xml index 20f0a49..d6ce827 100644 --- a/src/not_cloud/zcl_excel_converter.clas.xml +++ b/src/not_cloud/zcl_excel_converter.clas.xml @@ -123,14 +123,14 @@ Convert - CREATE_COLOR_STYLE + COMPLETE_CELL E - Create new color style based on cell style + Complete cell's attributes - CREATE_COLOR_STYLE + COMPLETE_CELL I - Create new color style based on cell style + Complete cell's attributes CREATE_FORMULAR_SUBTOTAL @@ -302,16 +302,6 @@ I Execute the converter based on object provided - - GET_COLOR_STYLE - E - Look up color style and create if needed - - - GET_COLOR_STYLE - I - Look up color style and create if needed - GET_FILE E From cba7bcc89af327845abc542806a45de01add571e Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:02:29 +0100 Subject: [PATCH 6/7] Update zcl_excel_converter.clas.abap --- src/not_cloud/zcl_excel_converter.clas.abap | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.abap b/src/not_cloud/zcl_excel_converter.clas.abap index 5bc6765..e839b90 100644 --- a/src/not_cloud/zcl_excel_converter.clas.abap +++ b/src/not_cloud/zcl_excel_converter.clas.abap @@ -104,7 +104,7 @@ CLASS zcl_excel_converter DEFINITION METHODS clean_fieldcatalog . METHODS complete_cell IMPORTING - !ip_table_row TYPE zexcel_cell_row + !ip_table_row TYPE i !ip_fieldname TYPE fieldname !ip_column TYPE simple !ip_row TYPE zexcel_cell_row @@ -316,11 +316,10 @@ CLASS zcl_excel_converter IMPLEMENTATION. lv_col_int TYPE zexcel_cell_column, lv_col_alpha TYPE zexcel_cell_column_alpha, ls_settings TYPE zexcel_s_table_settings, - lv_tabix TYPE sy-tabix, + lv_table_row TYPE i, lv_line TYPE i. - FIELD-SYMBOLS: TYPE ANY TABLE, - TYPE any. + FIELD-SYMBOLS: TYPE ANY TABLE. ASSIGN wo_data->* TO . @@ -354,14 +353,14 @@ CLASS zcl_excel_converter IMPLEMENTATION. lv_col_int = w_col_int + ls_fcat-position - 1. lv_col_alpha = zcl_excel_common=>convert_column2alpha( lv_col_int ). lv_row_int = w_row_int + 1. "Skip header - LOOP AT ASSIGNING . - lv_tabix = sy-tabix. - complete_cell( ip_table_row = lv_tabix + DO lines( ) TIMES. + lv_table_row = sy-index. + complete_cell( ip_table_row = lv_table_row ip_fieldname = ls_fcat-columnname ip_column = lv_col_alpha ip_row = lv_row_int ). ADD 1 TO lv_row_int. - ENDLOOP. + ENDDO. * Freeze panes IF ls_fcat-fix_column = abap_true. ADD 1 TO r_freeze_col. From ce0d4b27f191c4e40eecfb2ea7891abcc38f64d7 Mon Sep 17 00:00:00 2001 From: Bernd <135710507+darnoc312@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:26:11 +0100 Subject: [PATCH 7/7] Update zcl_excel_converter.clas.abap --- src/not_cloud/zcl_excel_converter.clas.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/not_cloud/zcl_excel_converter.clas.abap b/src/not_cloud/zcl_excel_converter.clas.abap index e839b90..b269ada 100644 --- a/src/not_cloud/zcl_excel_converter.clas.abap +++ b/src/not_cloud/zcl_excel_converter.clas.abap @@ -501,7 +501,7 @@ CLASS zcl_excel_converter IMPLEMENTATION. * Now let's check for colors DATA: ls_colors TYPE zexcel_s_converter_col. - IF NOT wt_colors IS INITIAL. + IF wt_colors IS NOT INITIAL. * Field has color READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = ip_table_row columnname = ip_fieldname.