Skip to Content
0

Deleting CMFK and CMFP data

Feb 23 at 09:29 AM

65

avatar image
Former Member

Dear All,

I want to delete data from tables CMFK and CMFP tables .

our CMFP table contains around 2 billion entries occupying 0.5 TB of database space.

I m writing small abap program to delete these entries.

will it affect any other tables or processes in SAP?

Below is my small Code

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S32 { color: #3399FF; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }

REPORT zdel_cmfk_cmfp.

TABLES : cmfk , cmfp.

DATA : it_cmfk LIKE cmfk OCCURS 0 WITH HEADER LINE.
DATA : it_cmfp LIKE cmfp OCCURS 0 WITH HEADER LINE.


SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS : aplid TYPE cmfk-aplid.
SELECT-OPTIONS : datum FOR cmfk-datum.
SELECTION-SCREEN : END OF BLOCK b1.

START-OF-SELECTION.

SELECT * FROM cmfk INTO TABLE it_cmfk WHERE aplid = aplid and datum IN datum.

IF it_cmfk[] IS NOT INITIAL.

SELECT * FROM cmfp INTO TABLE it_cmfp
FOR ALL ENTRIES IN it_cmfk
WHERE aplid = it_cmfk-aplid
AND nr = it_cmfk-nr.

ENDIF.


DELETE cmfk FROM TABLE it_cmfk.
DELETE cmfp FROM TABLE it_cmfp.

IF sy-subrc = 0.
WRITE : / 'Table data deleted Sucesfully'.
ENDIF.

Thanks & Regards

Gaurav Joshi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Feb 23 at 11:07 AM
0

It depends on applications (CMFK-APLID) but you should use SARA, so identify archive objects which purge this table

Nevertheless, you could

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Dear Raymond,

Thanks for reply,

We already checked table CMFPAR table, it has zero entries in our case.

and we are deleting old data which is more than 10 years old for aplid = 'CK'

Regards

Gaurav

0

So archive object should be CO_COPC.

1
Former Member

Dear Raymond

Thanks for reply

SAP note you share contains same program in correction instructions

Regards

Gaurav

0