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: 

record count in internal table

Former Member
0 Kudos

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

former_member214131
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

Try this:

Data: count_lines type i.

describe table my_table lines count_lines.

Regards,

Arjan

former_member214131
Active Contributor
0 Kudos

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

or

check the keyword DESCRIBE TABLE IntTab LINES lin.

Regds, Murugesh AS

0 Kudos

<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

Former Member
0 Kudos

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 ).

0 Kudos

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