Skip to Content
author's profile photo Former Member
Former Member

Number of records got selected

Hi ,

How to know how many number of records got selected .

describe table is the best method or how to use sy-tfill.

Please help me .

Thanks

Cinde

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2010 at 10:47 AM

    Hi

    TFILL will also give the total number of records in internal table.

    If you have more than one internal tables make use of DESCRIBE statement to get the number of records for each select querry.

    Regards,

    Pravin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2010 at 11:30 AM

    your_variable = lines( your_tablename ).

    if lines( your_tablname ) gt 0.

    etc.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2010 at 11:53 AM

    Hi cinde,

    You can go for either sy-dbcnt or describe statement. Sy-dbcnt gives the number of database lines processed. Describe statement can give you the number of lines or rows in an internal table. Youn can use any one of these statements after your select stament.

    Thanks,

    Jerry Jerome

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2010 at 12:11 PM

    Hi,

    If you have more than one ITAB or specially some NESTED structure of ITAB don't go for TFILL.

    Describe table is always preferred.

    DESCRIBE TABLE it_final LINES t_cnt.
    CONDENSE t_cnt.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2010 at 01:48 PM

    Moderator message - Welcome to SCN. But please do not ask basic questions. Unfortunately, this forum is not a place to learn ABAP. I suggest that you get one of the good ABAP books that are out there and maybe join an internet forum that caters to beginners. Also, Please read and and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again. Locked Rob

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.