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: 

package size in select statement

Former Member
0 Kudos

Hi Experts,

In my program i have 4 select statements.

in first select i am getting 6 lacks records.

2nd select i am getting 5 lacks records.in this statement i am using for all entries in above table.

3 rd select i am getting 99 lacks records in this statement i am using for all enries in 2 nd internal table

4th select i am getting 5 lacks records in this statement i am using for all entries in 3rd internal table.

select f1 f2 f3 from database table into internal table

package sige 10000

for all.......

where ..........

append lines of internal table to final internal table.

refresh internal table.

Endselect.

i am following this way..

if i follow like this it will improve my program performence.

or is there any other way to improve my program performence.

please any body answer my question its very urgent.

thanks in advance.

Tharangini.K

7 REPLIES 7

former_member194613
Active Contributor
0 Kudos

Try to use one join.

Former Member
0 Kudos

Hi,

using package size will restrcit the data entries during the fetch. it will pullout the data in chunks. it will help improving the performance. why dont u avoid select-end select. instead append the data into final internal table once the data selection is over!! and since you are retrieving large data, keep your memory usage in optimal level. free the internal table once process (using that int. table) is over.

regards,

madhu

0 Kudos

Hi Madhu,

I am not very clear what you are saying can you please alobarate that.

thanks,

Tharangini

0 Kudos

hI,

Go you have select-endselet to populate your inetrnal table? if so avoid it. you can populate the data in different internal tables into the final one using append lines of ..statement.

I'm just cautioning you, if you have so many internal tables involved with lots of records in it, then it the program will consume lotsof memory. In order to avoid that, release the memory of the internal table, which you'll not use later in that program.

ie. say of you are using ITAB to populate data into ITAB_FINAL.

ie append lines of itab into itab_final.

now if you are not going to use itab any further in your program use: FREE ITAB. to release the memory space used by ITAB.

regards,

madhu

0 Kudos

Hi Madhu,

How to avoid the select and endselect.

if we use package size then we have to use select and endselect na.

Please clear my doubt

Thanks,

Tharangini

0 Kudos

Hi,

select f1 f2 .... from dbtable

appending corresponding fields of table internal table

package size 10000

where ......

endselect.

select f1 f2 .... from dbtable

into corresponding fields of table internal table

package size 10000

where ......

append lines of internal table to final internal table

free internal.

endselect.

which method is best one.

please tell me quickly.

Thanks,

Tharangini

former_member194613
Active Contributor
0 Kudos

again why don't you use a join!

I don't think that the for all entries will work with the package size. The FAE read duplicates internediately but takes care that there are no duplicates at the end. This can not work with a package size.

Your selects are very large, the FAE works only small blocks so it will be anyway slow.

If you can program it with a join the solution can be faster by several orders, i.e factor 100 or 1000!

A FAE is only in exceptional cases better than a join, that are the cases where the optimizer is confused and chooses the wrong index for one or more tables of the join. In most cases it should work. To decide it, the details are necessary.

Read my blogs and you will see, that I know what I am talking about.

Siegfried