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

Former Member
0 Likes
591

<b></b>Hi All,

Please let me know about the funda of using an EXTRACT statement.

3 REPLIES 3
Read only

Former Member
0 Likes
553

Hi,

EXTRACT

Syntax

EXTRACT [ header | field_group ].

Effect

This statement links the current content of the fields, which were until then included in the field group header resp. field_group via the statement INSERT , to the extract dataset of the program. If there is no field group specified after EXTRACT, then the field group header is implicitly added.

At the first execution of the EXTRACT-statement of a program, the extract datset is created and the first line added. After execution of an EXTRACT-statement, it is not allowed to incorporate other fields to the specified field group field_group with the INSERT statement. If you do so, an uncatchable exception will be raised at the next EXTRACT-statement for the same field group.

Notes

As the field group header is the beginning part and sort key of every field group, it is not allowed to incorporate fields into header after execution of the first EXTRACT statement.

The lines of an extract dataset cannot be explicitly deleted and will be kept alive as long as the internal mode of the program.

Example

This example continues the example under INSERT. If the executable program is linked to a fitting logical data base, the fields of the field groups flight_info and flight_date are attached to the extract dataset during the GET-events.

REPORT demo_extract.

NODES: spfli, sflight.

FIELD-GROUPS: header, flight_info, flight_date.

START-OF-SELECTION.

INSERT: spfli-carrid spfli-connid sflight-fldate

INTO header,

spfli-cityfrom spfli-cityto

INTO flight_info.

GET spfli.

EXTRACT flight_info.

GET sflight.

EXTRACT flight_date.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ed135c111d1829f0000e829fbfe/frameset.htm

<b><REMOVED BY MODERATOR></b>

Pritha.

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
553

HI,,

From f1 help....

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

Check this.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/extract.htm

Regards

vasu

Read only

Former Member
0 Likes
553

Ramya,

Simple thing...

If you need some documentation regarding any of the key words or statements....

just go to se38 in some dummy report type the keyword....

like EXTRACT in this case select the line and go with F1 it will give you lot of sap help.....

That would be much helpful 4 u I guess...