diff --git a/ZA2X/CLAS/ZCL_EXCEL_CONVERTER_ALV.slnk b/ZA2X/CLAS/ZCL_EXCEL_CONVERTER_ALV.slnk index 48edf15..0cb1366 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_CONVERTER_ALV.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_CONVERTER_ALV.slnk @@ -1,5 +1,5 @@ - + *"* local class implementation for public class *"* use this source file for the implementation part of @@ -285,7 +285,9 @@ TYPES: BEGIN OF ts_col_converter, <fs_stab> TYPE ANY, <fs> TYPE ANY, <fs_tcol> TYPE lvc_t_scol, - <fs_scol> TYPE lvc_s_scol. + <fs_scol> TYPE lvc_s_scol, + <ft_slis> type standard table, + <fs_slis> type any. * Loop trough the table to set the color properties of each line. The color properties field is * Char 4 and the characters is set as follows: @@ -320,24 +322,50 @@ TYPES: BEGIN OF ts_col_converter, ENDIF. ENDIF. ENDIF. - IF ws_layo-ctab_fname IS NOT INITIAL. - ASSIGN COMPONENT ws_layo-ctab_fname OF STRUCTURE <fs_stab> TO <fs_tcol>. - IF sy-subrc = 0. - LOOP AT <fs_tcol> ASSIGNING <fs_scol>. - READ TABLE wt_colors INTO ls_color WITH TABLE KEY col = <fs_scol>-color-col - int = <fs_scol>-color-int - inv = <fs_scol>-color-inv. - IF sy-subrc = 0. - ls_con_col-rownumber = l_line. - ls_con_col-columnname = <fs_scol>-fname. - ls_con_col-fontcolor = ls_color-fontcolor. - ls_con_col-fillcolor = ls_color-fillcolor. - ls_con_col-nokeycol = <fs_scol>-nokeycol. - INSERT ls_con_col INTO TABLE et_colors. - ENDIF. - ENDLOOP. - ENDIF. - ENDIF. + if ws_layo-ctab_fname is not initial. + + assign component ws_layo-ctab_fname of structure <fs_stab> to <ft_slis>. + if sy-subrc = 0. + loop at <ft_slis> assigning <fs_slis>. + assign component 'COLOR' of structure <fs_slis> to <fs>. + if sy-subrc = 0. + if <fs> is not initial. + field-symbols: <col> type any, + <int> type any, + <inv> type any, + <fname> type any, + <nokeycol> type any. + assign component 'COL' of structure <fs> to <col>. + assign component 'INT' of structure <fs> to <int>. + assign component 'INV' of structure <fs> to <inv>. + read table wt_colors into ls_color with table key col = <col> + int = <int> + inv = <inv>. + if sy-subrc = 0. + ls_con_col-rownumber = l_line. + assign component 'FNAME' of structure <fs_slis> to <fname>. + if sy-subrc ne 0. + assign component 'FIELDNAME' of structure <fs_slis> to <fname>. + if sy-subrc eq 0. + ls_con_col-columnname = <fname>. + endif. + else. + ls_con_col-columnname = <fname>. + endif. + + ls_con_col-fontcolor = ls_color-fontcolor. + ls_con_col-fillcolor = ls_color-fillcolor. + assign component 'NOKEYCOL' of structure <fs_slis> to <nokeycol>. + if sy-subrc eq 0. + ls_con_col-nokeycol = <nokeycol>. + endif. + insert ls_con_col into table et_colors. + endif. + endif. + endif. + endloop. + endif. + endif. ENDLOOP. ENDIF. endmethod.