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

loop through internal table that has 240k records

Former Member
0 Likes
963

Hi Experts,

I am trying to loop through an internal table in my program and this program has 240k records. The program gives a short dump when I run it. Is there a better way of looping through the table. I understand that using key and index are options, but there is no key as such on this table and I am not sure what indexing exactly means.

Can anyone please help me with this.

Your help is greatly appreciated.

Thank you

Hi Experts,

I am trying to loop through an internal table in my program and this program has 240k records. The program gives a short dump when I run it. Is there a better way of looping through the table. I understand that using key and index are options, but there is no key as such on this table and I am not sure what indexing exactly means.

Can anyone please help me with this.

Your help is greatly appreciated.

Thank you

6 REPLIES 6
Read only

Former Member
0 Likes
901

An <b>Index</b> is a set of key fields used for better access to the tables, you can create them on Tx. <b>SE11</b>.

Also you can give some delimeter parameters to your loop...Maybe you don't need to access all the 240k records...

Greetings,

Blag.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
901

What is the short dump given?

REgards,

Rich Heilman

Read only

Former Member
0 Likes
901

Hi

Which dump?

The way of looping depends on how you need to loop it.

If you're using WHERE CONDITION should be better to use SORTED table, otherwise you can use STANDARD table.

See the SAP Help: here it's explain the differents of the sevaral kinds of internal table.

Max

Read only

Former Member
0 Likes
901

Deepthi,

You can also look at the option of using FIELD GROUPS.

Regards,

Ravi

Read only

Former Member
0 Likes
901

What's going on inside the loop?

Rob

Read only

Former Member
0 Likes
901

Deepthi,

Indexing in the context of internal tables is the reading of a particular row by the row identifier. An internal table with 240,000 rows will have rows with identifiers (index values) between 1 and 240,000. When you append rows to an internal table using the APPEND statement, field sy-index gives you the row identifier of the last row added. Similarly, when you want to read a particulr row, you can reference it by the row identifier. For the indexing to work as desired, you would need to sort the table into the correct key sequence.

Can you paste the coding into the message and explain what the structure of the internal table and which

row(s) you are trying to process ?

Regards,

Gary