Application Development 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: 

Alternative of EXTRACT

Former Member
0 Kudos

Hello All,

Currently i have a report that needs to e enhanced to access the Archived Data. In the process i noticed that the Original (working) object uses INSERT, EXTACT and LOOP ... ENDLOOP key words.

I would like to build a new report and would like to know what would be the Alternative statements for the Above said Key words.

(The Original Object is behaving absurd when run for Multiple times with the same varinat. On the first run it gave 20 rec when i clicked the Back button selected the same varinat and executed the Object i get 'No Records found').

Proposing Alternative steps would be great....

Regards,

-PSK

5 REPLIES 5

Former Member
0 Kudos

Hai Sravan

EXTRACT fg.

Effect

Writes all fields of the field group fg (see FIELD-GROUPS) as one record to a sequential dataset (paging). If a field group HEADER has been defined, its fields prefix each record to form a sort key. You can sort this dataset with SORT and process it with LOOP ... ENDLOOP. After this, EXTRACT cannot be execuuted again.

Note

As soon as the first dataset for a field group has been extracted with EXTRACT , the field group cannot be expanded using INSERT . The field group HEADER , in particular, cannot be expanded after the first EXTRACT (regardless of field group).

Note

Runtime errors

EXTRACT_AFTER_SORT/LOOP : EXTRACT after SORT or LOOP .

EXTRACT_FIELD_TOO_LARGE : Occupied length of a single field is too long.

EXTRACT_HEADER_NOT_UNIQUE : Field group HEADER was modified after records had been extracted with EXTRACT .

EXTRACT_TOO_LARGE : Total data length of a record to be extracted (including HEADER fields) is too long.

Thanks & regards

Sreenivasulu P

abdul_hakim
Active Contributor
0 Kudos

hi sravan,

they have used extract dataset instead of internal table.

the alternative to extract dataset is internal table.

you could use APPEND or INSERT statement when you are dealing with internal table..

Note: Extract dataset is used when the structure of your table will vary,say for eg first record structure is 3 fields and 2nd one with 4 fields and 3rd one with 1 field etc.

But in internal table your structure should be similar...

I would advice you to use internal table instead of extract dataset unless your data volume is high and structure is entirely different for every record...

Cheers,

Abdul Hakim

Former Member
0 Kudos

Sravan,

As Abdul pointed out, EXTRACTS / field groups have been used instead of INTERNAL TABLES. Usually this is done as field groups can handle large amounts of data and still give a better performance.

So, if the results are wrong, I would suggest that you look into the logic and fix the same rather than chaning it to internal tables, which might result in performance issues for higher volumes of data.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

hi sravan,

To insert a line into a database table, regardless of whether the primary key of this line already exists, you use the MODIFY statement.

There are two possibilities:

If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, i.e. the line is added.

If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE, i.e. the line is changed.

regards,

keerthi.

0 Kudos

Hi,

Can someone send me a sample code on how to extract archived data.

Thanks in advance.

Sanju