ABAP Keyword Documentation →  ABAP − Reference →  Obsolete Language Elements →  Obsolete Extracts → 

EXTRACT  Syntax Diagram

Short Reference

Obsolete Syntax

EXTRACT [ header | field_group ].

Effect

This statement appends the current content of the fields previously included in the field group header or field_group using the statement INSERT to the extract dataset of the program. If there is no field group specified after EXTRACT, the field group header is added implicitly.

The extract dataset is created the first time EXTRACT is executed and the first row added. Once an EXTRACT statement is executed, no other fields can be included in the specified field group field_group using INSERT. If not, an unhandleable exception is raised by the next EXTRACT statement for the same field group.

Notes

Example

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.

REPORT ...

DATA: spfli_wa TYPE spfli,
      sflight_wa  TYPE sflight,
      spfli_tab   LIKE TABLE OF spfli_wa,
      sflight_tab LIKE TABLE OF sflight_wa.

FIELD-GROUPS: header, flight_info, flight_date.

START-OF-SELECTION.
  INSERT: spfli_wa-carrid spfli_wa-connid sflight_wa-fldate
            INTO header,
          spfli_wa-cityfrom spfli_wa-cityto
            INTO flight_info.

  SELECT *
         FROM spfli
         INTO TABLE spfli_tab.

  SELECT *
         FROM sflight
         INTO TABLE sflight_tab.

  LOOP AT spfli_tab INTO spfli_wa.
    sflight_wa-fldate ='--------'.
    EXTRACT flight_info.
    LOOP AT sflight_tab INTO sflight_wa
            WHERE carrid = spfli_wa-carrid AND
                  connid = spfli_wa-connid.
      EXTRACT flight_date.
    ENDLOOP.
  ENDLOOP.

Exceptions

Non-Catchable Exceptions