EXTRACT (ABAP Keyword)

EXTRACT (ABAP Keyword) introduction & details

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 sort this dataset with SORT and process it with LOOP … ENDLOOP. After
this, EXTRACT cannot be execuuted again.

Note
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).

Note
Runtime errors

EXTRACT_AFTER_SORT/LOOP : EXTRACT
after SORT or LOOP .

EXTRACT_FIELD_TOO_LARGE : Occupied length of a
single field is too long.

EXTRACT_HEADER_NOT_UNIQUE : Field group
HEADER was modified after records had been extracted with EXTRACT
.

EXTRACT_TOO_LARGE : Total data length of a record to be extracted
(including HEADER fields) is too long.