ZRFCORR97
ZRFCORR97
*
* Note 337706 correction program to get rid of A003 w/o KONH and KONP
* For S4HANA = S4CORE
* SAP original in U92 on 20211221
* Pexecute = 'X' means productive run.
*
TABLES: a003,
konh,
konp.
TOP-OF-PAGE.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/ '|', (25) 'A003', '|',
(25) 'KONH', '|',
(24) 'KONP', '|'.
ULINE /(84).
*---------------------------------------------------------------------*
* FORM check_consistency *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM check_consistency.
LOOP AT it_a003.
CLEAR it_anzeige.
it_anzeige-kappl = it_a003-kappl.
it_anzeige-kschl = it_a003-kschl.
it_anzeige-aland = it_a003-aland.
it_anzeige-mwskz = it_a003-mwskz.
it_anzeige-knumh = it_a003-knumh.
*---------------------------------------------------------------------*
* FORM anzeigen_daten *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM anzeigen_daten.
SORT it_anzeige BY statusp DESCENDING aland kschl mwskz knumh kopos.
LOOP AT it_anzeige.
* Show data of table A003
FORMAT COLOR COL_KEY INTENSIFIED ON.
WRITE:/ '|', it_anzeige-kappl,
it_anzeige-kschl,
it_anzeige-aland,
it_anzeige-mwskz,
it_anzeige-knumh, '|'.
*---------------------------------------------------------------------*
* FORM correct_KONP *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM correct_konp.
LOOP AT it_anzeige WHERE statusp = 2 AND statush = 2.
SELECT SINGLE * FROM a003 WHERE
kappl = it_anzeige-kappl AND
kschl = it_anzeige-kschl AND
aland = it_anzeige-aland AND
mwskz = it_anzeige-mwskz AND
knumh = it_anzeige-knumh.
IF sy-subrc = 0.
DELETE a003.
ENDIF.
ENDLOOP.
COMMIT WORK.