diff --git a/src/#apmg#cl_strust.clas.abap b/src/#apmg#cl_strust.clas.abap index 167915b..d1e1a80 100644 --- a/src/#apmg#cl_strust.clas.abap +++ b/src/#apmg#cl_strust.clas.abap @@ -129,6 +129,10 @@ CLASS /apmg/cl_strust DEFINITION RAISING /apmg/cx_error. + METHODS get_logs + RETURNING + VALUE(result) TYPE STANDARD TABLE OF /apmg/strust_log WITH DEFAULT KEY. + PROTECTED SECTION. PRIVATE SECTION. @@ -597,6 +601,13 @@ CLASS /apmg/cl_strust IMPLEMENTATION. ENDMETHOD. + METHOD get_logs. + + result = logs. + + ENDMETHOD. + + METHOD _create. DATA: diff --git a/src/#apmg#strust_updater.prog.abap b/src/#apmg#strust_updater.prog.abap index 0d0094a..9f46b2d 100644 --- a/src/#apmg#strust_updater.prog.abap +++ b/src/#apmg#strust_updater.prog.abap @@ -241,6 +241,30 @@ START-OF-SELECTION. remove_expired = p_remove ). WRITE / 'Certificates saved' COLOR COL_POSITIVE. + + IF p_remove = abap_true. + DATA(logs) TYPE STANDARD TABLE OF /apmg/strust_log WITH DEFAULT KEY. + logs = strust->get_logs( ). + + DATA(removed_count) = 0. + + LOOP AT logs ASSIGNING FIELD-SYMBOL() WHERE message = 'Removed'. + IF removed_count = 0. + SKIP. + WRITE / 'Certificates removed:' COLOR COL_TOTAL. + ENDIF. + removed_count += 1. + WRITE: /5 -cert_subject, + AT 130 |{ -date_from DATE = ISO }|, + AT 145 |{ -date_to DATE = ISO }|, + AT 158 ''. + ENDLOOP. + + IF removed_count = 0. + SKIP. + WRITE / 'No expired certificates were removed' COLOR COL_TOTAL. + ENDIF. + ENDIF. CATCH /apmg/cx_error INTO error. WRITE: / 'Error updating certificate:' COLOR COL_NEGATIVE, error->get_text( ). ENDTRY.