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: 

Diff Between Internal Table with Occurs 0 & Field Groups

Former Member
0 Kudos

Hi,

Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?

Could anybody please give some information regarding above question?

Thanks,

Mohan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Surya,

The main difference to use OCCURS 0 is, it is optimistic, because need not allocate memory space,it will allocate memory space at the run time,

EXAMPLE:

*************

OCCURS 100 means the program allocate 100 records memory space, if we have only 50 records, at that time the remaining 50 records memory space will waste, best example is BUS.

This kind of problem will not come in OCCURS 0.

IF USEFULL REWARD

6 REPLIES 6

Former Member
0 Kudos

Hi ,

Decide whether to use <b>field-groups</b> or something else (like <b>internal tables</b>). If you expect the size of your list to be greater than the amount of memory you want your program to use, then use field-groups (actually, if you use internal tables, and the number of records exceeds the number of records in your OCCURS statement, the system just writes those extra records to the paging space. So is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups?

According to Gareth M. de Bruyn and Robert Lyfareff in Introduction to ABAP/4 Programming for SAP, field-groups are stored more efficiently, and have better performance. They recommend field-groups for lists of 100,000 or more records).

<b>Reward pts if found usefull :)</b>

Regards

Sathish

Former Member
0 Kudos

Hi,

please refer this thread.

<b>reward points if helpful.</b>

rgds,

bharat.

Former Member
0 Kudos

Hi Surya,

The main difference to use OCCURS 0 is, it is optimistic, because need not allocate memory space,it will allocate memory space at the run time,

EXAMPLE:

*************

OCCURS 100 means the program allocate 100 records memory space, if we have only 50 records, at that time the remaining 50 records memory space will waste, best example is BUS.

This kind of problem will not come in OCCURS 0.

IF USEFULL REWARD

Former Member
0 Kudos

hi there,

occurs 0 means the internal table will be with header line, only 8kb memory space

is occupied by the table if we use occurs 0.

feild group can also be used

on your ABAP prgram feild group will be more effective, check the analysis in

SE30

hope it helps you

thnkx

bhanu

Former Member
0 Kudos

hi,

occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.

i.e data: itab like mara occurs 0 with header line.

can take data only from mara table

we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.

for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.

filed symbols works more faster than internal tables.

if helpful reward some points.

with regards,

Suresh.A

Former Member
0 Kudos

Hi Suryakiran,

Occurs 0 used for optimised memory .If we know how many records is there in an internal table then we use occurs(num.) but when we don't know how many record are there in an internal table then we use occurs 0.because it does not place amemory lacation.if we useoccurs 100 then it means the internal table uses a space of 100 records once it fills then it uses an other 100 rows.so besides using occurs 100 we use occurs 0 so thst it does't use memory space.

I Think your problem is resolve.

If useful reward me with points.

Thanks

Sanket.