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

record count in internal table

Former Member
0 Likes
1,000

i want to know record count for the records stored in

internal table.

do we have any system field to display record count?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
862

Loop in IntTab and you get the count in sy-tabix.

or

check the keyword DESCRIBE TABLE IntTab LINES lin.

Regds, Murugesh AS

5 REPLIES 5
Read only

Former Member
0 Likes
862

Hi,

Try this:

Data: count_lines type i.

describe table my_table lines count_lines.

Regards,

Arjan

Read only

Former Member
0 Likes
863

Loop in IntTab and you get the count in sy-tabix.

or

check the keyword DESCRIBE TABLE IntTab LINES lin.

Regds, Murugesh AS

Read only

0 Likes
862

<b>DESCRIBE TABLE <i>itab</i> LINES <i>v_lines</i></b>

is the best way to do it. It is performancewise better.

Regards,

Achirangshu De

Read only

Former Member
0 Likes
862

Hi,

There is also a built-in function, LINES( ) which returns number of lines in an internal table :

data: lv_no_of_lines type i,

lt_flights type table of sflight.

lv_no_of_lines = LINES( lt_flights ).

Read only

0 Likes
862

LINES( ) is a nice feature, however it's only available for WAS. For 46C it's not available, so you can only use DESCRIBE TABLE LINES.

Actually you can implement a class for this with DESCRIBE TABLE LINES, and use syntax ZMYCLASS=>LINES( ). Almost as cool as in WAS:-)

Peter