mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 14:06:24 +08:00
simplify some IFs
This commit is contained in:
parent
5e6bb3ba10
commit
eaea931778
|
@ -1029,11 +1029,10 @@ METHOD get_fieldcatalog.
|
|||
<fcat>-abap_type = lo_salv_column_table->get_ddic_inttype( ).
|
||||
|
||||
<fcat>-dynpfld = 'X'. " What in the world would we exclude here?
|
||||
IF <fcat>-position = 1. " except for the MANDT-field of most tables ( 1st column that is )
|
||||
IF lo_salv_column_table->get_ddic_datatype( ) = 'CLNT'.
|
||||
" except for the MANDT-field of most tables ( 1st column that is )
|
||||
IF <fcat>-position = 1 AND lo_salv_column_table->get_ddic_datatype( ) = 'CLNT'.
|
||||
CLEAR <fcat>-dynpfld.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
* For fields that don't a description ( i.e. defined by "field type i," )
|
||||
* just use the fieldname as description - that is better than nothing
|
||||
|
|
|
@ -302,8 +302,7 @@ 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.
|
||||
|
@ -315,7 +314,6 @@ METHOD ask_option.
|
|||
set_option( is_option = ws_option ) .
|
||||
rs_option = ws_option.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
@ -865,9 +863,8 @@ 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( ) .
|
||||
|
@ -875,8 +872,6 @@ method CREATE_WORKSHEET.
|
|||
l_freeze_col = bind_cells( ) .
|
||||
ENDIF.
|
||||
|
||||
ENDIF.
|
||||
|
||||
* Check for freeze panes
|
||||
IF ws_layout-is_fixed = abap_true.
|
||||
IF l_freeze_col = 0.
|
||||
|
|
|
@ -323,8 +323,7 @@ method GET_COLOR.
|
|||
l_line = sy-tabix.
|
||||
IF ws_layo-info_fname IS NOT INITIAL.
|
||||
ASSIGN COMPONENT ws_layo-info_fname OF STRUCTURE <fs_stab> TO <fs>.
|
||||
IF sy-subrc = 0.
|
||||
IF <fs> IS NOT INITIAL.
|
||||
IF sy-subrc = 0 AND <fs> IS NOT INITIAL.
|
||||
l_color = <fs>.
|
||||
IF l_color(1) = 'C'.
|
||||
READ TABLE wt_colors INTO ls_color WITH TABLE KEY col = l_color+1(1)
|
||||
|
@ -340,7 +339,6 @@ method GET_COLOR.
|
|||
ENDIF.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
if ws_layo-ctab_fname is not initial.
|
||||
|
||||
assign component ws_layo-ctab_fname of structure <fs_stab> to <ft_slis>.
|
||||
|
|
|
@ -2922,11 +2922,9 @@ METHOD bind_table.
|
|||
ip_formula = <fs_fldval>
|
||||
ip_style = <ls_field_catalog>-style ).
|
||||
ENDIF.
|
||||
ELSE.
|
||||
IF <ls_field_catalog>-abap_type IS NOT INITIAL.
|
||||
ELSEIF <ls_field_catalog>-abap_type IS NOT INITIAL.
|
||||
me->set_cell( ip_column = lv_column_alpha
|
||||
ip_row = lv_row_int
|
||||
|
||||
ip_formula = <fs_fldval>
|
||||
ip_abap_type = <ls_field_catalog>-abap_type ).
|
||||
ELSE.
|
||||
|
@ -2934,7 +2932,6 @@ METHOD bind_table.
|
|||
ip_row = lv_row_int
|
||||
ip_formula = <fs_fldval> ).
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
ELSE.
|
||||
IF <ls_field_catalog>-style IS NOT INITIAL.
|
||||
IF <ls_field_catalog>-abap_type IS NOT INITIAL.
|
||||
|
|
|
@ -3366,15 +3366,13 @@ 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.
|
||||
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.
|
||||
ENDIF.
|
||||
|
||||
" outlineLevelCol
|
||||
WHILE lo_column_iterator->has_next( ) = abap_true.
|
||||
|
|
|
@ -433,11 +433,9 @@ 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.
|
||||
IF lo_column_default IS BOUND AND lo_column_default->get_width( ) >= 0.
|
||||
l_worksheet-defaultcolwidth = lo_column_default->get_width( ).
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
lo_row_default = io_worksheet->get_default_row( ).
|
||||
IF lo_row_default IS BOUND.
|
||||
|
|
Loading…
Reference in New Issue
Block a user