Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Deleting Table entries

Dear All,

I need to delete ALL THE entries in the table marc that contains entries in the mara table.

Pls. let me know how to code this.

Thanks in Advance,

CR

Tags:
Former Member
replied

Hi,

REPORT  ZTEST_Delete  MESSAGE-ID ZZ   .
TABLES: DD02L.
data: tablename type dd02l-tabname.
DATA: IT_DBLOG LIKE DBTABLOG OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS: S_TABLE FOR DD02L-TABNAME NO INTERVALS.

AT SELECTION-SCREEN.

  LOOP AT S_TABLE.
    tablename = S_TABLE-LOW.
    IF tablename <> 'KONP' and tablename <> 'YMTOL_I696_MAINF'.
      MESSAGE E000 WITH 'enter valid tab name'.
    ENDIF.
  ENDLOOP.

  SELECT * FROM DBTABLOG
          INTO TABLE IT_DBLOG
          WHERE TABNAME IN S_TABLE.
  IF SY-SUBRC = 0.
    DELETE DBTABLOG FROM TABLE IT_DBLOG.
  ENDIF.

Regards

vijay

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question