DCLS/DDLS: Fix uninstall dependencies (#3726)

* DCLS/DDLS: Fix uninstall dependencies 

Closes https://github.com/larshp/abapGit/issues/2467

* Move DDLS before other DDIC

DDLS must be deleted before TABL (which is used in DDLS)

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2020-08-13 02:52:50 -04:00 committed by GitHub
parent dfc19fe718
commit cfc900a2b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,20 +78,26 @@ CLASS zcl_abapgit_dependencies IMPLEMENTATION.
CASE <ls_tadir>-object. CASE <ls_tadir>-object.
WHEN 'DEVC'. WHEN 'DEVC'.
" Packages last " Packages last
<ls_tadir>-korrnum = '9990'. <ls_tadir>-korrnum = '999000'.
WHEN 'DOMA'. WHEN 'DOMA'.
<ls_tadir>-korrnum = '9000'. <ls_tadir>-korrnum = '900000'.
WHEN 'PARA'. WHEN 'PARA'.
" PARA after DTEL " PARA after DTEL
<ls_tadir>-korrnum = '8100'. <ls_tadir>-korrnum = '810000'.
WHEN 'DTEL'. WHEN 'DTEL'.
<ls_tadir>-korrnum = '8000'. <ls_tadir>-korrnum = '800000'.
WHEN 'DCLS'. WHEN 'DCLS'.
" AUTH after DCLS " AUTH and SUSO after DCLS
<ls_tadir>-korrnum = '7100'. <ls_tadir>-korrnum = '705000'.
WHEN 'SUSO'.
" SUSO after DCLS
<ls_tadir>-korrnum = '710000'.
WHEN 'AUTH'. WHEN 'AUTH'.
" AUTH after DCLS " AUTH after DCLS
<ls_tadir>-korrnum = '7050'. <ls_tadir>-korrnum = '715000'.
WHEN 'DDLS'.
" DDLS after DCLS but before other DDIC
<ls_tadir>-korrnum = '720000'.
WHEN 'TTYP' OR 'TABL' OR 'VIEW'. WHEN 'TTYP' OR 'TABL' OR 'VIEW'.
SELECT SINGLE tabclass FROM dd02l SELECT SINGLE tabclass FROM dd02l
INTO lv_tabclass INTO lv_tabclass
@ -100,21 +106,21 @@ CLASS zcl_abapgit_dependencies IMPLEMENTATION.
AND as4vers = '0000'. AND as4vers = '0000'.
IF sy-subrc = 0 AND lv_tabclass = 'APPEND'. IF sy-subrc = 0 AND lv_tabclass = 'APPEND'.
" delete append structures before database tables " delete append structures before database tables
<ls_tadir>-korrnum = '6500'. <ls_tadir>-korrnum = '730000'.
ELSE. ELSE.
<ls_tadir>-korrnum = '7000'. <ls_tadir>-korrnum = '750000'.
ENDIF. ENDIF.
WHEN 'IASP'. WHEN 'IASP'.
<ls_tadir>-korrnum = '5520'. <ls_tadir>-korrnum = '552000'.
WHEN 'IARP'. WHEN 'IARP'.
<ls_tadir>-korrnum = '5510'. <ls_tadir>-korrnum = '551000'.
WHEN 'IATU'. WHEN 'IATU'.
<ls_tadir>-korrnum = '5500'. <ls_tadir>-korrnum = '550000'.
WHEN 'SUSC'. WHEN 'SUSC'.
<ls_tadir>-korrnum = '5000'. <ls_tadir>-korrnum = '500000'.
WHEN 'ACID'. WHEN 'ACID'.
" ACID after PROG/FUGR/CLAS " ACID after PROG/FUGR/CLAS
<ls_tadir>-korrnum = '3000'. <ls_tadir>-korrnum = '300000'.
WHEN 'PROG'. WHEN 'PROG'.
" delete includes after main programs " delete includes after main programs
SELECT COUNT(*) FROM reposrc SELECT COUNT(*) FROM reposrc
@ -122,16 +128,16 @@ CLASS zcl_abapgit_dependencies IMPLEMENTATION.
AND r3state = 'A' AND r3state = 'A'
AND subc = 'I'. AND subc = 'I'.
IF sy-subrc = 0. IF sy-subrc = 0.
<ls_tadir>-korrnum = '2000'. <ls_tadir>-korrnum = '200000'.
ELSE. ELSE.
<ls_tadir>-korrnum = '1000'. <ls_tadir>-korrnum = '100000'.
ENDIF. ENDIF.
WHEN 'IDOC'. WHEN 'IDOC'.
<ls_tadir>-korrnum = '2000'. <ls_tadir>-korrnum = '200000'.
WHEN 'IEXT'. WHEN 'IEXT'.
<ls_tadir>-korrnum = '1500'. <ls_tadir>-korrnum = '150000'.
WHEN OTHERS. WHEN OTHERS.
<ls_tadir>-korrnum = '1000'. <ls_tadir>-korrnum = '100000'.
ENDCASE. ENDCASE.
ENDLOOP. ENDLOOP.