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: 

SELECT COUNT(*) ... where ... <---- for internal tables

Former Member
0 Kudos
792

Hi,

Similar to SELECT COUNT(*) in SQL, is there a way to do a count on internal table which meet a certain criteria?

DESCRIBE displays the count of all rows in the internal table.

Thanks.

ss

3 REPLIES 3

Former Member
0 Kudos
88

Hi, I don't think there is a directly way to achieve your requirement.

You can use LOOP AT XXX WHERE. to filter the entry which meet the criteria into a new internal table, and do a DESCRIBE to get the entries count.

Hope this reply can satisfy you.

thanks

0 Kudos
88

data: count type i .

clear count .

loop at itab where <logical expression> .

count = count + 1 .

endloop .

Regards

Raja

Former Member
0 Kudos
88

Even SY-TABIX CAN BE USED TO READ THE CONTENTS OF THE INTERNAL TABLE.

IM not quite sure about your requirement if you can be more specific would be great!

Regards

sumit