SAP EXTRACT ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID EXTRACT
• EXTRACT ABAP Statement

EXTRACT
Short Reference

ABAP_SYNTAX_OBS
EXTRACT $[ header $| field_group $].

What does it do?
This statement appends the current content of the fields that were previously included with the statement INSERT in the field group header or field_group to the extract dataset of the program. If no field group is specified after EXTRACT, the field group header is added implicitly.
The extract dataset is created the first time the EXTRACT statement of a program is executed and the first row is added. Once an EXTRACT statement is executed, no other fields can be included in the specified field group field_group using INSERT. Otherwise, an uncatchable exception is raised by the next EXTRACT statement for the same field group.
Fields of the types s, i, and int8 with the minimum value -32768, -2147483648, or -9223372036854775808 are set to the value 0 when extracted to the field group header.



Latest notes:

The field group header is the initial part and sort key of every field group, which means that no more fields can be included in header after EXTRACT is executed for the first time.
The rows of an extract dataset cannot be deleted explicitly and are persisted for as long as the ABAP_ISESS of the program.
In global classes, no field groups can be defined or processed. In methods of local classes of programs other than class pools, the statement EXTRACT is possible for globally defined field groups.
Extracts are obsolete. Internal tables should be used instead.
ABAP_HINT_END



Example ABAP Coding

This example continues the example under INSERT . The fields of the field groups flight_info and flight_date are filled in a nested LOOP and appended to the extract dataset.
ABEXA 00259
ABAP_EXAMPLE_END