Data Cluster (ABAP memory)

A data cluster (ABAP Memory) is a group of data objects grouped together for the purpose of storage in a storage medium that can only be edited using ABAP statements. 

  • The data objects are written to the storage medium by the statement EXPORT.
  • The data objects are extracted again by the statement IMPORT.
  • The statement DELETE can be used to delete any storage medium.
  • The statement FREE can be used to delete the ABAP Memory.
  • The statement IMPORT DIRECTORY generates a list of all data objects that have previously been exported to a database table.

EXPORT Syntax 

… {p1 = dobj1 p2 = dobj2 …}
| {p1 FROM dobj1 p2 FROM dobj2 …}
| (ptab) … 

… { DATA BUFFER xstr }
| { INTERNAL TABLE itab }
| { MEMORY ID id }
| { DATABASE dbtab(ar) [FROM wa] [CLIENT cl] ID id }
| { SHARED MEMORY dbtab(ar) [FROM wa] [CLIENT cl] ID id }
| { SHARED BUFFER dbtab(ar) [FROM wa] [CLIENT cl] ID id } … 

Catchable Exceptions for EXPORT

CX_SY_EXPIMP_DB_SQL_ERROR 

  • Cause: SQL error in export to the database.
    Runtime Error: DBIF_…

CX_SY_EXPORT_BUFFER_NO_MEMORY 

  • Cause: During export to the application buffer, data cluster is larger than the entire buffer.
    Runtime Error: EXPORT_BUFFER_NO_MEMORY

CX_SY_EXPORT_NO_SHARED_MEMORY 

  • Cause: During export to the application buffer, the data cluster is larger than the maximum internal buffer limit.
    Runtime Error: EXPORT_NO_SHARED_MEMORY 

IMPORT Syntax 

… {p1 = dobj1 p2 = dobj2 …}
| {p1 TO dobj1 p2 TO dobj2 …}
| (ptab) … 

… { DATA BUFFER xstr }
| { INTERNAL TABLE itab }
| { MEMORY ID id }
| { DATABASE dbtab(ar) [TO wa] [CLIENT cl] ID id }
| { SHARED MEMORY dbtab(ar) [TO wa] [CLIENT cl] ID id }
| { SHARED BUFFER dbtab(ar) [TO wa] [CLIENT cl] ID id } … 

Catchable Exceptions for IMPORT

CX_SY_CONVERSION_CODEPAGE 

  • Cause: Error in conversion.
    Runtime Error: CONNE_IMPORT_CONVERSION_ERROR 

CX_SY_IMPORT_MISMATCH_ERROR 

  • Cause: A component of a structured dataset has a wrong decimal.
    Runtime Error: CONNE_IMPORT_WRONG_COMP_DECS
  • Cause: A component of a structured dataset has a wrong length.
    Runtime Error: CONNE_IMPORT_WRONG_COMP_LENG
  • Cause: A component of a structured type in the dataset has a wrong type.
    Runtime Error: CONNE_IMPORT_WRONG_COMP_TYPE
  • Cause: A field in the dataset has wrong decimal places.
    Runtime Error: CONNE_IMPORT_WRONG_FIELD_DECS
  • – Cause: A field in the dataset has a wrong length.
    Runtime Error: CONNE_IMPORT_WRONG_FIELD_LENG
  • Cause: A field in the dataset has a wrong type.
    Runtime Error: CONNE_IMPORT_WRONG_FIELD_TYPE
  • Cause: Type conflict between simple and structured data types
    Runtime Error: CONNE_IMPORT_WRONG_OBJECT_TYPE
  • Cause: Type conflict between structured object
    Runtime Error: CONNE_IMPORT_WRONG_STRUCTURE
  • Cause: Source and target object have incompatible types.
    Runtime Error: IMPORT_ALIGNMENT_MISMATCH
  • Cause: Dataset has a different length.
    Runtime Error: IMPORT_WRONG_END_POS 

CX_SY_IMPORT_FORMAT_ERROR 

  • Cause: Error in the data write of a stored data object.
    Runtime Error: IMPORT_FORMAT_ERROR
  • Cause: Error in data write in IMPORT.
    Runtime Error: CONNE_IMPORT_ILL_DESCRIPTION

CX_SY_EXPIMP_DB_SQL_ERROR 

  • Cause: SQL error in import from the database.
    Runtime Error: DBIF_… 

FREE DELETE MEMORY

FREE MEMORY ID id. 

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} }. 

System Fields 

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

Catchable Exceptions for DELETE

CX_SY_EXPIMP_DB_SQL_ERROR 

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

Example for ABAP Memory:

SELECTION SCREEN

OUTPUT

Leave a Reply