Skip to Content
author's profile photo
Former Member

record count in internal table

i want to know record count for the records stored in

internal table.

do we have any system field to display record count?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Posted on Jan 14, 2005 at 09:19 AM

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

    or

    check the keyword DESCRIBE TABLE IntTab LINES lin.

    Regds, Murugesh AS

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      <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

  • author's profile photo
    Former Member
    Posted on Jan 14, 2005 at 09:17 AM

    Hi,

    Try this:

    Data: count_lines type i.

    describe table my_table lines count_lines.

    Regards,

    Arjan

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jan 14, 2005 at 12:04 PM

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

    Add comment
    10|10000 characters needed characters exceeded

    • 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