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: 

Why extracts are used and a simple example of extracts would be helpful.

Former Member
0 Kudos
83

Hi friends,

why extracts are used?

how is it different from reports? advantages?

Plz explain the same with a simple example.

Appreciate your help.

3 REPLIES 3

0 Kudos
49

Since internal tables have fixed line structures, they are not suited to handle data sets with varying structures. For this purpose, ABAP offers the possibility to create so-called extract datasets (extracts, for short).

More Detailed information is available in the below link

http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9ed135c111d1829f0000e829fbfe/content.htm

Sample program

report zfwr0001 no standard page heading.

tables: lfa1, bsik.

field-groups: header, item1, item2.

insert lfa1-lifnr bsik-belnr into header.

insert lfa1-land1 lfa1-name1 into item1.

insert bsik-belnr bsik-budat into item2.

start-of-selection.

get lfa1.

....extract item1.

get bsik.

....extract item2.

end-of-selection.

loop.

....at item1 with item2.

........skip.

........write:/ 'Vendor number:', 28 'Name:', 56 'City:'.

........write: 16 lfa1-lifnr, 33(20) lfa1-name1, 62(20) lfa1-ort01.

........write:/ 'Document no.', 15 'Date'.

....endat.

....at item2.

........write:/ bsik-belnr, 13 bsik-budat.

....endat.

endloop.

Saravanan

Edited by: Saravanan on Apr 23, 2008 12:16 AM

Former Member
0 Kudos
49

Extracts are already saved report output.

Let say, if u have a report which takes lot of time to run,

then for those kind of reports an extract would be created during off peak times by scheduling a job.

Later they can be viewed online so that performance is very fast.

Advantages :

It is very fast compared to running the online report as it does not need to hit the database and perform all the logic needed.

Dis advantages :

It is not upto date with the data. It holds all the data till the point it was run.

former_member156446
Active Contributor
0 Kudos
49

extracts can be used for data migration.. think that ur in a data migration project from 4.6 legacy to 6.0Ecc you need to load data in to ECC by LSMW or BDC or BAPI .. in that case you can use extract programs to extract data from legacy to give a input to the load tools..

if you dont write the data to flat file.. and send it to ALV function modules it will be report..