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: 

Number of records got selected

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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

0 Kudos

Hi

TFILL will give you the total number of records in the internal table after the statment DESCRIBE TABLE, LOOP AT and READ TABLE.

If you want to find the no of records in the internal table better go for DESCRIBE TABLE.

<removed by moderator>

Thanks

Arul

Edited by: Thomas Zloch on Jul 5, 2010 1:45 PM

0 Kudos

Hai

Use this WRITE : SY-DBCNT .

Regards

Sarath P G

Former Member
0 Kudos

your_variable = lines( your_tablename ).

if lines( your_tablname ) gt 0.

etc.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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