EXTRACT
Basic form
EXTRACT fg.
Effect
Writes all fields of the field group
fg (see FIELD-GROUPS)
as one record to a sequential dataset (paging). If a field group HEADER
has been defined, its fields prefix each record to form a sort key. You can then sort
this dataset using SORT
and process it with LOOP ... ENDLOOP. After this, EXTRACT cannot be executed again.
Notes
General:
-
As soon as the first dataset for a field group has been extracted with EXTRACT,
the field group cannot be expanded using INSERT.
The field group HEADER, in particular, cannot be expanded after the first EXTRACT (regardless of field group).
-
Large extract datasets are not kept in main memory; instead, they are written to an external help file.
You can specify the directory in which this file is to be stored using the SAP profile parameter DIR_EXTRACT. By default, the system uses the SAP file directory SAP profile parameter DIR_DATA).
Non-Catchable Exceptions
-
Cause: EXTRACT
to SORT or LOOP.
Runtime Error: EXTRACT_AFTER_SORT/LOOP
-
Cause: Occupied length of a single field is too large.
Runtime Error: EXTRACT_FIELD_TOO_LARGE
-
Cause: Field group HEADER
was modified after records were extracted using EXTRACT.
Runtime Error: EXTRACT_HEADER_NOT_UNIQUE
-
Cause: Error opening the external extract dataset file.
Runtime Error: EXTRACT_OPEN_EXTRACTFILE_OPEN
-
Cause: Entire data length of a record to be extracted (including
HEADER fields) too large.
Runtime Error: EXTRACT_TOO_LARGE
Additional help
Filling an Extract with Data