diff --git a/src/zcl_excel_common.clas.abap b/src/zcl_excel_common.clas.abap index c255cb14a..47450e427 100644 --- a/src/zcl_excel_common.clas.abap +++ b/src/zcl_excel_common.clas.abap @@ -1029,10 +1029,9 @@ METHOD get_fieldcatalog. -abap_type = lo_salv_column_table->get_ddic_inttype( ). -dynpfld = 'X'. " What in the world would we exclude here? - IF -position = 1. " except for the MANDT-field of most tables ( 1st column that is ) - IF lo_salv_column_table->get_ddic_datatype( ) = 'CLNT'. - CLEAR -dynpfld. - ENDIF. + " except for the MANDT-field of most tables ( 1st column that is ) + IF -position = 1 AND lo_salv_column_table->get_ddic_datatype( ) = 'CLNT'. + CLEAR -dynpfld. ENDIF. * For fields that don't a description ( i.e. defined by "field type i," ) diff --git a/src/zcl_excel_converter.clas.abap b/src/zcl_excel_converter.clas.abap index e95a230df..f14144bc4 100644 --- a/src/zcl_excel_converter.clas.abap +++ b/src/zcl_excel_converter.clas.abap @@ -302,19 +302,17 @@ METHOD ask_option. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. - ELSE. - IF l_returncode = 'A'. + ELSEIF l_returncode = 'A'. RAISE EXCEPTION TYPE zcx_excel. - ELSE. - LOOP AT lt_sval INTO ls_sval. - ASSIGN COMPONENT ls_sval-fieldname OF STRUCTURE ws_option TO . - IF sy-subrc = 0. - = ls_sval-value. - ENDIF. - ENDLOOP. - set_option( is_option = ws_option ) . - rs_option = ws_option. - ENDIF. + ELSE. + LOOP AT lt_sval INTO ls_sval. + ASSIGN COMPONENT ls_sval-fieldname OF STRUCTURE ws_option TO . + IF sy-subrc = 0. + = ls_sval-value. + ENDIF. + ENDLOOP. + set_option( is_option = ws_option ) . + rs_option = ws_option. ENDIF. ENDMETHOD. @@ -865,16 +863,13 @@ method CREATE_WORKSHEET. IF i_table = abap_true. l_freeze_col = bind_table( i_style_table = i_style_table ) . - ELSE. + ELSEIF wt_filter IS NOT INITIAL. * Let's check for filter. - IF wt_filter IS NOT INITIAL. - wo_autofilter = wo_excel->add_new_autofilter( io_sheet = wo_worksheet ). - l_freeze_col = bind_cells( ) . - set_autofilter_area( ) . - ELSE. - l_freeze_col = bind_cells( ) . - ENDIF. - + wo_autofilter = wo_excel->add_new_autofilter( io_sheet = wo_worksheet ). + l_freeze_col = bind_cells( ) . + set_autofilter_area( ) . + ELSE. + l_freeze_col = bind_cells( ) . ENDIF. * Check for freeze panes diff --git a/src/zcl_excel_converter_alv.clas.abap b/src/zcl_excel_converter_alv.clas.abap index 7ede32e04..8c5d3d058 100644 --- a/src/zcl_excel_converter_alv.clas.abap +++ b/src/zcl_excel_converter_alv.clas.abap @@ -323,20 +323,18 @@ method GET_COLOR. l_line = sy-tabix. IF ws_layo-info_fname IS NOT INITIAL. ASSIGN COMPONENT ws_layo-info_fname OF STRUCTURE TO . - IF sy-subrc = 0. - IF IS NOT INITIAL. - l_color = . - IF l_color(1) = 'C'. - READ TABLE wt_colors INTO ls_color WITH TABLE KEY col = l_color+1(1) - int = l_color+2(1) - inv = l_color+3(1). - IF sy-subrc = 0. - ls_con_col-rownumber = l_line. - ls_con_col-columnname = space. - ls_con_col-fontcolor = ls_color-fontcolor. - ls_con_col-fillcolor = ls_color-fillcolor. - INSERT ls_con_col INTO TABLE et_colors. - ENDIF. + IF sy-subrc = 0 AND IS NOT INITIAL. + l_color = . + IF l_color(1) = 'C'. + READ TABLE wt_colors INTO ls_color WITH TABLE KEY col = l_color+1(1) + int = l_color+2(1) + inv = l_color+3(1). + IF sy-subrc = 0. + ls_con_col-rownumber = l_line. + ls_con_col-columnname = space. + ls_con_col-fontcolor = ls_color-fontcolor. + ls_con_col-fillcolor = ls_color-fillcolor. + INSERT ls_con_col INTO TABLE et_colors. ENDIF. ENDIF. ENDIF. diff --git a/src/zcl_excel_worksheet.clas.abap b/src/zcl_excel_worksheet.clas.abap index 75b827577..102730976 100644 --- a/src/zcl_excel_worksheet.clas.abap +++ b/src/zcl_excel_worksheet.clas.abap @@ -2176,10 +2176,8 @@ method BIND_ALV_OLE2. clear: wa_subtot_indexs. read table lt_subtot_indexs into wa_subtot_indexs with key index = l_save_index. - IF sy-subrc = 0. - if = '0'. - clear: contentsitem-value. - endif. + IF sy-subrc = 0 AND = '0'. + clear: contentsitem-value. ENDIF. endif. endif. @@ -2422,17 +2420,15 @@ method BIND_ALV_OLE2. read table currcells index counter into curritem2. if curritem-left eq curritem2-left. length = curritem-top + curritem-rows. - if length eq curritem2-top. - if curritem-decimals eq curritem2-decimals. - move curritem to curritem3. - curritem3-rows = curritem3-rows + curritem2-rows. - curritem-left = -1. - modify currcells index sy-index from curritem. - curritem2-left = -1. - modify currcells index counter from curritem2. - append curritem3 to currcells. - found = 'X'. - endif. + if length eq curritem2-top and curritem-decimals eq curritem2-decimals. + move curritem to curritem3. + curritem3-rows = curritem3-rows + curritem2-rows. + curritem-left = -1. + modify currcells index sy-index from curritem. + curritem2-left = -1. + modify currcells index counter from curritem2. + append curritem3 to currcells. + found = 'X'. endif. endif. enddo. @@ -2460,17 +2456,15 @@ method BIND_ALV_OLE2. if curritem-top eq curritem2-top and curritem-rows eq curritem2-rows. length = curritem-left + curritem-columns. - if length eq curritem2-left. - if curritem-decimals eq curritem2-decimals. - move curritem to curritem3. - curritem3-columns = curritem3-columns + curritem2-columns. - curritem-left = -1. - modify currcells index sy-index from curritem. - curritem2-left = -1. - modify currcells index counter from curritem2. - append curritem3 to currcells. - found = 'X'. - endif. + if length eq curritem2-left and curritem-decimals eq curritem2-decimals. + move curritem to curritem3. + curritem3-columns = curritem3-columns + curritem2-columns. + curritem-left = -1. + modify currcells index sy-index from curritem. + curritem2-left = -1. + modify currcells index counter from curritem2. + append curritem3 to currcells. + found = 'X'. endif. endif. enddo. @@ -2922,18 +2916,15 @@ METHOD bind_table. ip_formula = ip_style = -style ). ENDIF. - ELSE. - IF -abap_type IS NOT INITIAL. - me->set_cell( ip_column = lv_column_alpha + ELSEIF -abap_type IS NOT INITIAL. + me->set_cell( ip_column = lv_column_alpha ip_row = lv_row_int - ip_formula = ip_abap_type = -abap_type ). - ELSE. - me->set_cell( ip_column = lv_column_alpha - ip_row = lv_row_int - ip_formula = ). - ENDIF. + ELSE. + me->set_cell( ip_column = lv_column_alpha + ip_row = lv_row_int + ip_formula = ). ENDIF. ELSE. IF -style IS NOT INITIAL. diff --git a/src/zcl_excel_writer_2007.clas.abap b/src/zcl_excel_writer_2007.clas.abap index c39c374aa..0e9b28144 100644 --- a/src/zcl_excel_writer_2007.clas.abap +++ b/src/zcl_excel_writer_2007.clas.abap @@ -3395,14 +3395,12 @@ METHOD create_xl_sheet. value = lv_value ). " defaultColWidth lo_column_default = io_worksheet->get_default_column( ). - IF lo_column_default IS BOUND. - IF lo_column_default->get_width( ) >= 0. - lv_value = lo_column_default->get_width( ). - SHIFT lv_value RIGHT DELETING TRAILING space. - SHIFT lv_value LEFT DELETING LEADING space. - lo_element->set_attribute_ns( name = lc_xml_attr_defaultcolwidth - value = lv_value ). - ENDIF. + IF lo_column_default IS BOUND AND lo_column_default->get_width( ) >= 0. + lv_value = lo_column_default->get_width( ). + SHIFT lv_value RIGHT DELETING TRAILING space. + SHIFT lv_value LEFT DELETING LEADING space. + lo_element->set_attribute_ns( name = lc_xml_attr_defaultcolwidth + value = lv_value ). ENDIF. " outlineLevelCol diff --git a/src/zcl_excel_writer_huge_file.clas.abap b/src/zcl_excel_writer_huge_file.clas.abap index e8d8b2cec..686fa6dc9 100644 --- a/src/zcl_excel_writer_huge_file.clas.abap +++ b/src/zcl_excel_writer_huge_file.clas.abap @@ -433,10 +433,8 @@ METHOD create_xl_sheet. ENDIF. lo_column_default = io_worksheet->get_default_column( ). - IF lo_column_default IS BOUND. - IF lo_column_default->get_width( ) >= 0. - l_worksheet-defaultcolwidth = lo_column_default->get_width( ). - ENDIF. + IF lo_column_default IS BOUND AND lo_column_default->get_width( ) >= 0. + l_worksheet-defaultcolwidth = lo_column_default->get_width( ). ENDIF. lo_row_default = io_worksheet->get_default_row( ).