Skip to Content
avatar image
Former Member

Deleting CMFK and CMFP data

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 23 at 11:07 AM

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

    Nevertheless, you could

    Add comment
    10|10000 characters needed characters exceeded