Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extract Statement.

Former Member
0 Likes
626

Hi ,

What does an EXTRACT statement do in ABAP?

Regards,

Sirisha.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
536

From f1 help....

<i>

EXTRACT

Basic form

EXTRACT fg.

Effect

Writes all fields of the field group fg (FIELD-GROUPS) as an entry in asequential dataset. If you have defined a field group HEADER,its fields precede each entry as a sort key. Afterwards, you canuse SORT and LOOP ... ENDLOOP to sort or process the datasetrespectively. No further EXTRACT statements are possible afterthis.

Notes

General:

As soon as you have extracted a dataset using EXTRACT, you canno longer extend the field group using INSERT. In particular, you cannot change the HEADERfield group at all after the first EXTRACT (regardless of thefield group to which it applied).

Large extract datasets are not stored in main memory. Instead, theyare kept in an external auxiliary file. You can set the directory inwhich this file is created using the SAP profile parameterDIR_EXTRACT. The default directory is the SAP data directory(SAP profile parameter DIR_DATA).

Notes

Runtime errors:

EXTRACT_AFTER_SORT/LOOP: EXTRACT after SORT, orLOOP. EXTRACT_BUFFER_NO_ROLL: Unable to create the required main

EXTRACT_FIELD_TOO_LARGE: Occupied length of a field is toolarge.

EXTRACT_HEADER_NOT_UNIQUE: Field group HEADER wasmodified after an EXTRACT statement.

EXTRACT_OPEN_EXTRACTFILE_OPEN:

Error opening the external extract dataset file.

EXTRACT_RESOURCEHANDLER_FAILED: Error deleting the externalextract dataset file.

EXTRACT_TOO_LARGE: Total length of the entry for extraction(including HEADER fields) is too large.

Additional help

Filling anExtract with Data

</i>

Regards,

Rich Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
Read only

suresh_datti
Active Contributor
0 Likes
536

PL look up the SAP help on Filed-Groups. The EXTRACT key word writes all fields of the field group fg (see FIELD-GROUPS) as one record to a sequential dataset.

~Suresh