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

field groups

Former Member
0 Likes
1,093

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

5 REPLIES 5
Read only

andreas_mann3
Active Contributor
0 Likes
763

hi avinash,

look sample-program with se38: DEMO_DATA_PROCESS_EXTRACT

Andreas

Read only

abdul_hakim
Active Contributor
Read only

Former Member
0 Likes
763

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

Read only

Former Member
0 Likes
763

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.

Read only

0 Likes
763

i want to use the select statment to populate the field group how should i do that