This is a common requirement, and there are several ways to achieve this. The most commonly used methods are these:
You could transform the entire data structure to XML, or rather asXML which is ABAP data serialized in XML format. It's fairly easy, just use
CALL TRANSFORMATION
with the built-in transformation namedid
. The downside of this is that XML can be very verbose - this can easily blow up your dataset by a factor of 2-4 (YMMV).You can use a so-called data cluster. This stores the data in a binary format which can optionally be compressed as well via an internal undocumented ABAP compression algorithm. This is an efficient process regarding both execution time and storage size, but it has the disadvantage that you can't read the data without using the ABAP statements for decompressing. While you can always dump some XML file for further investigation, the internal storage format of data clusters is virtually illegible.