diff --git a/ZA2X/CLAS/ZCL_EXCEL_AUTOFILTERS.slnk b/ZA2X/CLAS/ZCL_EXCEL_AUTOFILTERS.slnk index 1056ba3..2038e10 100644 --- a/ZA2X/CLAS/ZCL_EXCEL_AUTOFILTERS.slnk +++ b/ZA2X/CLAS/ZCL_EXCEL_AUTOFILTERS.slnk @@ -1,87 +1,100 @@ - + + + *"* local class implementation for public class *"* use this source file for the implementation part of *"* local helper classes *"* use this source file for any type declarations (class *"* definitions, interfaces or data types) you need for method -*"* implementation or private method's signature -TYPES: BEGIN OF ts_objects, - sheet_guid TYPE uuid, - autofilter TYPE REF TO zcl_excel_autofilter, - END OF ts_objects, - - tt_objects TYPE HASHED TABLE OF ts_objects WITH UNIQUE KEY sheet_guid. +*"* implementation or private method's signature *"* use this source file for any macro definitions you need *"* in the implementation part of the class ABAP - - - + + + - method ADD. - DATA: ls_autofilters TYPE ts_objects, - l_guid TYPE uuid. - l_guid = io_sheet->get_guid( ) . - READ TABLE autofilters INTO ls_autofilters WITH TABLE KEY sheet_guid = l_guid. + + METHOD add. + + DATA: ls_autofilter LIKE LINE OF me->mt_autofilters. + + FIELD-SYMBOLS: <ls_autofilter> LIKE LINE OF me->mt_autofilters. + + READ TABLE me->mt_autofilters ASSIGNING <ls_autofilter> WITH TABLE KEY worksheet = io_sheet. IF sy-subrc = 0. - ro_autofilter = ls_autofilters-autofilter. - ELSE. - CREATE OBJECT ro_autofilter - EXPORTING - io_sheet = io_sheet. - ls_autofilters-autofilter = ro_autofilter. - ls_autofilters-sheet_guid = l_guid. - INSERT ls_autofilters INTO TABLE autofilters . + RAISE EXCEPTION TYPE zcx_excel. " adding another autofilter to sheet is not allowed ENDIF. - endmethod. + + CREATE OBJECT ro_autofilter + EXPORTING + io_sheet = io_sheet. + + ls_autofilter-worksheet = io_sheet. + ls_autofilter-autofilter = ro_autofilter. + INSERT ls_autofilter INTO TABLE me->mt_autofilters. + + +ENDMETHOD. - method CLEAR. + METHOD clear. - REFRESH autofilters. + CLEAR me->mt_autofilters. - endmethod. +ENDMETHOD. - - - method GET. + + + + METHOD get. - DATA: ls_autofilters TYPE ts_objects. + DATA: ls_autofilter LIKE LINE OF me->mt_autofilters. - READ TABLE autofilters INTO ls_autofilters WITH TABLE KEY sheet_guid = i_sheet_guid. + FIELD-SYMBOLS: <ls_autofilter> LIKE LINE OF me->mt_autofilters. + + READ TABLE me->mt_autofilters ASSIGNING <ls_autofilter> WITH TABLE KEY worksheet = io_worksheet. IF sy-subrc = 0. - ro_autofilter = ls_autofilters-autofilter. + ro_autofilter = <ls_autofilter>-autofilter. ELSE. CLEAR ro_autofilter. ENDIF. - endmethod. +ENDMETHOD. - method IS_EMPTY. - IF autofilters IS INITIAL. + METHOD is_empty. + IF me->mt_autofilters IS INITIAL. r_empty = abap_true. ENDIF. - endmethod. +ENDMETHOD. - - method REMOVE. - DATA: ls_autofilters TYPE ts_objects. + + METHOD remove. - DELETE autofilters WHERE sheet_guid = i_sheet_guid. + DATA: lo_worksheet TYPE REF TO zcl_excel_worksheet. - endmethod. + FIELD-SYMBOLS: <ls_autofilter> LIKE LINE OF me->mt_autofilters. + + DELETE TABLE me->mt_autofilters WITH TABLE KEY worksheet = lo_worksheet. + +ENDMETHOD. - method SIZE. - DESCRIBE TABLE autofilters LINES r_size. - endmethod. + METHOD size. + DESCRIBE TABLE me->mt_autofilters LINES r_size. +ENDMETHOD. diff --git a/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk b/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk index c554a9c..942e7c7 100644 --- a/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk +++ b/ZA2X/TABL/ZEXCEL_CONDITIONAL_TOP10.slnk @@ -4,4 +4,5 @@ +