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: 

count number of records in a internal table

Former Member
0 Kudos
8,283

hi

i want to count number of records in internal table

pls let me know how to count the number of records in a internal table.

regards

Arora

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,138

hi

data field type i.

Decribe table itab lines field

10 REPLIES 10

Former Member
0 Kudos
1,139

hi

data field type i.

Decribe table itab lines field

Former Member
0 Kudos
1,138

<b>data l1 type i.

describe table itab lines l1.

or sy-tfill</b>

h_senden2
Active Contributor
0 Kudos
1,138

data: l_count type i.

l_count = lines( itab ).

regards,

Hans

Former Member
0 Kudos
1,138

Hi Arora,

You can use any of the following:

1. data ws_cnt type i.

Describe table itab lines ws_cnt.

2. Incase if you forming the Itab using the append statement then,

cnt = 0.

loop at ....

....

.....

Append itab.

cnt = cnt + 1.

endloop.

Reward if useful.

Regards,

Chitra

Former Member
0 Kudos
1,138

DESCRIBE <itab> lines <variable>

Former Member
0 Kudos
1,138

Hi,

describe table itab lines l1.

regards,

Omkar.

Former Member
0 Kudos
1,138

Hi,

Use DESCRIBE TABLE itab LINES v_tab_lines.

Declare v_tab_lines of type I.

This would surely help you.

Thanks and Regards,

Krithika

Former Member
0 Kudos
1,138

Hi,

display the SY-TABIX value after the query...

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

regards,

Vinod Samuel.

Former Member
0 Kudos
1,138

hi

one way is

data field type i.

Decribe table itab lines field.

write: / field.

displays the no of records in tha internal table

or if u want to write logic.

data:

w_count type i.

loop at itab.

w_count = w_count + 1.

endloop.

write: / w_count.

displays the no of records.

reward points if useful.

Former Member
0 Kudos
1,138

answered