Skip to content

Commit b5008bb

Browse files
committed
disabling profiles when it executes the regression
1 parent 3979684 commit b5008bb

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

src/foundation/y_code_pal_service.clas.abap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ CLASS y_code_pal_service IMPLEMENTATION.
153153
RETURN.
154154
ENDIF.
155155

156+
TRY.
157+
y_profile_manager=>create( )->delete_profiles( ).
158+
CATCH ycx_failed_to_remove_a_line.
159+
raise_internal_server_error( ).
160+
response->set_cdata( 'Profiles were not disabled' ).
161+
RETURN.
162+
ENDTRY.
163+
156164
DATA(atc) = NEW cl_satc_api_factory( ).
157165

158166
TRY.

src/profiles/y_if_profile_manager.intf.abap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ INTERFACE y_if_profile_manager
8282
!profile TYPE ytab_profiles
8383
RAISING
8484
ycx_failed_to_remove_a_line .
85+
METHODS delete_profiles
86+
RAISING
87+
ycx_failed_to_remove_a_line .
8588
METHODS delete_check
8689
IMPORTING
8790
!check TYPE ytab_checks

src/profiles/y_profile_manager.clas.abap

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ CLASS y_profile_manager IMPLEMENTATION.
151151
ENDMETHOD.
152152

153153

154+
METHOD y_if_profile_manager~delete_profiles.
155+
TRY.
156+
DATA(profiles) = y_if_profile_manager~select_profiles( sy-uname ).
157+
CATCH ycx_entry_not_found.
158+
RETURN.
159+
ENDTRY.
160+
161+
LOOP AT profiles ASSIGNING FIELD-SYMBOL(<profile>).
162+
y_if_profile_manager~delete_profile( <profile> ).
163+
ENDLOOP.
164+
ENDMETHOD.
165+
154166
METHOD y_if_profile_manager~get_checks_type_name.
155167
result = checks_type.
156168
ENDMETHOD.
@@ -334,10 +346,11 @@ CLASS y_profile_manager IMPLEMENTATION.
334346

335347

336348
METHOD y_if_profile_manager~select_all_profiles.
337-
SELECT * FROM ytab_profiles INTO TABLE @result.
338-
IF sy-subrc NE 0.
339-
RAISE EXCEPTION TYPE ycx_entry_not_found.
340-
ENDIF.
349+
"Based on Checks because the profile might be inactive
350+
SELECT DISTINCT profile FROM ytab_checks INTO TABLE @DATA(profiles).
351+
LOOP AT profiles ASSIGNING FIELD-SYMBOL(<profile>).
352+
APPEND VALUE ytab_profiles( profile = <profile> ) TO result.
353+
ENDLOOP.
341354
ENDMETHOD.
342355

343356

0 commit comments

Comments
 (0)