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
695

Hi all,

What is the main purpose of EXTRACT Statment.

Thanks in advance,

Alex.

1 ACCEPTED SOLUTION
Read only

Pawan_Kesari
Active Contributor
0 Likes
676

It is related to FIELD-GROUPS.

Purpose : Writes all fields of the field group as an entry in a sequential dataset. As soon as you have extracted a dataset using EXTRACT, you canno longer extend the field group using INSERT.

5 REPLIES 5
Read only

Former Member
0 Likes
676

Hi,

See following link :

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ede35c111d1829f0000e829fbfe/content.htm

Reward points if helpful.

Regards.

Srikanta Gope

Read only

Former Member
Read only

Former Member
0 Likes
676

hi,

REPORT demo_extract_extract.

NODES: spfli, sflight.

FIELD-GROUPS: header, flight_info, flight_date.

INSERT: spfli-carrid spfli-connid sflight-fldate

INTO header,

spfli-cityfrom spfli-cityto

INTO flight_info.

START-OF-SELECTION.

GET spfli.

EXTRACT flight_info.

GET sflight.

EXTRACT flight_date.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9f0535c111d1829f0000e829fbfe/content.htm

Read only

Former Member
0 Likes
676

Once you have declared the possible record types as field groups and defined their structure, you can fill the extract dataset using the following statements:

EXTRACT <fg>.

When the first EXTRACT statement occurs in a program, the system creates the extract dataset and adds the first extract record to it. In each subsequent EXTRACT statement, the new extract record is added to the dataset

EXTRACT HEADER.

When you extract the data, the record is filled with the current values of the corresponding fields.

As soon as the system has processed the first EXTRACT statement for a field group <fg>, the structure of the corresponding extract record in the extract dataset is fixed. You can no longer insert new fields into the field groups <fg> and HEADER. If you try to modify one of the field groups afterwards and use it in another EXTRACT statement, a runtime error occurs.

By processing EXTRACT statements several times using different field groups, you fill the extract dataset with records of different length and structure. Since you can modify field groups dynamically up to their first usage in an EXTRACT statement, extract datasets provide the advantage that you need not determine the structure at the beginning of the program.

regards,

srinivas

<b>*reward for useful answers*</b>

Read only

Pawan_Kesari
Active Contributor
0 Likes
677

It is related to FIELD-GROUPS.

Purpose : Writes all fields of the field group as an entry in a sequential dataset. As soon as you have extracted a dataset using EXTRACT, you canno longer extend the field group using INSERT.