‎2005 Dec 07 8:56 AM
i need sample documentation and simple examples on field groups
like moving data from one field group to another field group,moving data from one field group to inernal table
‎2005 Dec 07 9:00 AM
hi avinash,
look sample-program with se38: DEMO_DATA_PROCESS_EXTRACT
Andreas
‎2005 Dec 07 9:00 AM
Hi
Check the below link..
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
REgards,
Abdul
‎2005 Dec 07 9:07 AM
Hi
here is sample
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.
There are three field groups. The INSERT statement assigns fields to two of the field groups. During the GET events, the system fills the extract dataset with two different record types. The records of the field group FLIGHT_INFO consist of five fields: SPFLI-CARRID, SPFLI-CONNID, SFLIGHT-FLDATE, SPFLI-CITYFROM, and SPFLI-CITYTO. The first three fields belong to the prefixed field group HEADER. The records of the field group FLIGHT_DATE consist only of the three fields of field group HEADER.
regs
vijay
‎2005 Dec 07 9:09 AM
Hi,
for ABAP book refer to
http://cma.zdnet.com/book/abap/index.htm
========================================================
Extracts
Since internal tables have fixed line structures, they are not suited to handle data sets with
varying structures. Instead, you can use extract datasets for this purpose.
An extract is a sequential dataset in the memory area of the program. You can only address the
entries in the dataset within a special loop. The index or key access permitted with internal
tables is not allowed. You may only create one extract in any ABAP program. The size of an
extract dataset is, in principle, unlimited. Extracts larger than 500KB are stored in operating
system files. The practical size of an extract is up to 2GB, as long as there is enough space in
the filesystem.
An extract dataset consists of a sequence of records of a pre-defined structure. However, the
structure need not be identical for all records. In one extract dataset, you can store records of
different length and structure one after the other. You need not create an individual dataset for
each different structure you want to store. This fact reduces the maintenance effort considerably.
In contrast to internal tables, the system partly compresses extract datasets when storing them.
This reduces the storage space required. In addition, you need not specify the structure of an
extract dataset at the beginning of the program, but you can determine it dynamically during the
flow of the program.
You can use control level processing with extracts just as you can with internal tables. The
internal administration for extract datasets is optimized so that it is quicker to use an extract for
control level processing than an internal table.
Procedure for creating an extract:
1. Define the record types that you want to use in your extract by declaring them as field
groups. The structure is defined by including fields in each field group.
Defining an Extract
2. Fill the extract line by line by extracting the required data.
Filling an Extract with Data
3. Once you have filled the extract, you can sort it and process it in a loop. At this stage,
you can no longer change the contents of the extract.
Processing Extracts
==============
1)Defining an 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.
The program is linked to the logical database F1S. The NODES
statement declares the corresponding interface work areas
There are three field groups. The INSERT statement assigns fields to two of the field
groups.
2)Filling an Extract with Data
Assume the following program is linked to the logical database F1S.
REPORT DEMO.
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.
There are three field groups. The INSERT statement assigns fields to two of the field
groups. During the GET events, the system fills the extract dataset with
two different record types.
3)processing extract
Assume the following program is linked to the logical database F1S.
REPORT DEMO.
NODES: SPFLI, SFLIGHT.
FIELD-GROUPS: HEADER, FLIGHT_INFO, FLIGHT_DATE.
BC - ABAP Programming SAP AG
Reading an Extract
October2004 258
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.
END-OF-SELECTION.
LOOP.
AT FIRST.
WRITE / 'Start of LOOP'.
ULINE.
ENDAT.
AT FLIGHT_INFO WITH FLIGHT_DATE.
WRITE: / 'Info:',
SPFLI-CARRID, SPFLI-CONNID, SFLIGHT-FLDATE,
SPFLI-CITYFROM, SPFLI-CITYTO.
ENDAT.
AT FLIGHT_DATE.
WRITE: / 'Date:',
SPFLI-CARRID, SPFLI-CONNID, SFLIGHT-FLDATE.
ENDAT.
AT LAST.
ULINE.
WRITE / 'End of LOOP'.
ENDAT.
ENDLOOP.
The extract dataset is created and filled in the same way as shown in the example
for Filling an Extract with Data . The data retrieval ends before the ENDOF-
SELECTION event, in which the dataset is read once using a loop.
The control statements AT FIRST and AT LAST instruct the system to write one line
and one underscore line in the list, once at the beginning of the loop and once at the
end.
The control statement AT <fgi> tells the system to output the fields corresponding to
each of the two record types. The WITH FLIGHT_DATE option means that the
system only displays the records of field group FLIGHT_INFO if at least one record
of field group FLIGHT_DATE follows; that is, if the logical database passed at least
one date for a flight.
‎2005 Dec 07 9:20 AM
i want to use the select statment to populate the field group how should i do that