To read data objects from an ABAP program into ABAP memory, use the following statement:
Syntax
EXPORT <f1> [FROM <g 1>] <f 2> [FROM <g 2>] ... TO MEMORY ID <key>.
This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM <f
i >, the data object <f i > is saved under its own name. If you use the FROM <g i > option, the data objet <g i > is saved under the name <f i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.The EXPORT statement always completely overwrites the contents of any existing data cluster with the same name <key>.
If you are using internal tables with header lines, you can only store the table itself, not the header line. In the EXPORT statement, the table name is interpreted as the table. This is an exception to the general rule, under which statements normally interpret the table name as a table work area (see
PROGRAM SAPMZTS1.
DATA TEXT1(10) VALUE 'Exporting'.
DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
DO 5 TIMES.
ITAB-BOOKID = 100 + SY-INDEX.
APPEND ITAB.
ENDDO.
EXPORT TEXT1
TEXT2 FROM 'Literal'
TO MEMORY ID 'text'.
EXPORT ITAB
TO MEMORY ID 'table'.
In this example, the text fields TEXT1 and TEXT2 are stored in the ABAP memory of program SAPMZTS1 under the name "text". The internal table ITAB is stored under the name "table".