Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  Data Cluster 

DELETE FROM

Quick Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


DELETE FROM { {MEMORY ID id} 
            | {DATABASE      dbtab(ar) [CLIENT cl] ID id}
            | {SHARED MEMORY dbtab(ar) [CLIENT cl] ID id}
            | {SHARED BUFFER dbtab(ar) [CLIENT cl] ID id} }.

Effect

This statement deletes a data cluster stored in the ABAP memory, in a database table, or in a cross-transaction application buffer of the current AS Instance by the statement EXPORT. The data cluster is identified by its ID id and, except in the case of the ABAP memory, by the name of a database table dbtab, a range ar, and an optional client cl. The same rules apply to dbtab, ar, cl, and id as apply when accessing the appropriate repository with the IMPORT statement.

System Fields

sy-subrc Meaning
0 The specified data cluster was found and deleted.
4 The specified data cluster was not found.


Notes

  • See also Classes for Data Clusters.
  • Since each client represents a self-contained unit, the addition CLIENT must not be used in application programs.

Example

In this example, two fields are written to a data cluster in an application buffer of the current AS Instance, extracted, and then deleted. Accessing the same data cluster again sets sy-subrc to 4.

DATA: id    TYPE c LENGTH 4 VALUE 'TEXT', 
      text1 TYPE string     VALUE 'Tina', 
      text2 TYPE string     VALUE 'Ike'. 

EXPORT p1 = text1 
       p2 = text2 TO SHARED BUFFER demo_indx_blob(XY) ID id. 

IMPORT p1 = text2 
       p2 = text1 FROM SHARED BUFFER demo_indx_blob(XY) ID id. 
ASSERT sy-subrc = 0. 

DELETE FROM SHARED BUFFER demo_indx_blob(XY) ID id. 

IMPORT p1 = text2 
       p2 = text1 FROM SHARED BUFFER demo_indx_blob(XY) ID id. 
ASSERT sy-subrc = 4. 

Exceptions

Handleable Exceptions

CX_SY_EXPIMP_DB_SQL_ERROR

  • Cause: SQL error in deletion from the database.
    Runtime error: DBIF_...

Non-Handleable Exceptions

  • Cause: Error when deleting in cross-transaction application buffer
    Runtime error: DELETE_BUFFER_FAILED
    Runtime error: DELETE_BUFFER_EXTERNAL_ERROR
    Runtime error: DELETE_BUFFER_INTERNAL_ERROR
    Runtime error: DELETE_BUFFER_KEY_NOT_FOUND