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: 

field groups vs begin of itab...endof itab..little confusion ..plz suggest

Former Member
0 Kudos

hello all

well i have little confusion between these 2 i.e. filed groups and the internal tables we declare using BEGIN OF ITAB OCCURS 0...........END OF ITAB.

we use field groups for having together different fields from different tables ,ryte ? but same can be achieved in the second case also (according my knowledge of these two!!!!)

so wats the difference betweent hem ?

plz help

thanks in advance.

Nilesh

3 REPLIES 3

Former Member
0 Kudos

<b>field group</b> is like a structure that can hold a set of fields. Its also called as field strings. Field strings can contain only one record. Whenever we update the values in the field group the existing values are overwritten with the new values entered. The field groups can be created using the data statement.

<b>Internal table</b>:when ever we declared in Program and executed in the RUN TIME only control cna allocate internal table ,when ever the Program closed the memory of internal table will be released by control. it means table will be created at RUNTIME only.these are not declared at Underlaying database

<b>field group</b>

field groupa are nothing but a similar type of fields grouped under single name (group).

or grouping of the fields is called field groups.

field groups are like structures in C. We can create multiple variables in single structure.

field group holds single value

<b>Innternal tables</b>

internal tables are strod temp memory/in buferr for the further processing of the fields.

Internal table is a temporary table is stored in RAM(presentation layer).

internal tables holds multiple values

reward points if it is usefull

Girish

Former Member
0 Kudos

Hi

Field-Groups is the differnt concept which is used for fetching data from DB tables

When the Data is large enough which is not possible to handle (means due to some Memory problems) we use field groups.

see the sample code how to use field groups.

REPORT demo_extract.

NODES: spfli, sflight.

FIELD-GROUPS: header, flight_info, flight_date.

START-OF-SELECTION.

INSERT: spfli-carrid spfli-connid sflight-fldate

INTO header,

spfli-cityfrom spfli-cityto

INTO flight_info.

GET spfli.

EXTRACT flight_info.

GET sflight.

EXTRACT flight_date.

END-OF-SELECTION.

SORT STABLE.

LOOP.

AT FIRST.

WRITE / 'Flight list'.

ULINE.

ENDAT.

AT flight_info WITH flight_date.

WRITE: / spfli-carrid , spfli-connid, sflight-fldate,

spfli-cityfrom, spfli-cityto.

ENDAT.

AT flight_date.

WRITE: / spfli-carrid , spfli-connid, sflight-fldate.

ENDAT.

AT LAST.

ULINE.

WRITE: cnt(spfli-carrid), 'Airlines'.

ULINE.

ENDAT.

ENDLOOP.

Reward points for useful Answers

Regards

Anji

former_member235056
Active Contributor
0 Kudos

Hi,

Look field groups are used to group different field symbols(pointers) together whereas internal tables are used to group fiels together not field symbols.

Please do reward points if u feel anything useful frm my answer.

Regards,

Ameet