Skip to Content
avatar image
Former Member

CL_ABAP_TABLEDESCR

How can I use this class to retrieve the number of

records an internal table contains?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 29, 2008 at 07:12 PM

    I think finding number of records in a itab using this class is not possible.

    If you want find the number of fields in an itab then

    g_tabledescr type ref to cl_abap_tabledescr,
    g_tabledescr ?= cl_abap_tabledescr=>describe_by_data( itab ).
    

    But you can try this way

    v_lines = lines( ltab ).
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 29, 2008 at 07:02 PM

    Hello,

    I don't know if it's possible to recover the number of records of an internal table using this class, but I suggest you to use the function LINES( itab ) to do this.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 29, 2008 at 07:10 PM

    hi,

    You can do this way ..

    data : v_lines type i.
    
     describe itab lines v_lines.
     write v_lines.

    Add comment
    10|10000 characters needed characters exceeded