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: 

Count entries in different tables

Former Member
0 Kudos

Dear forum members,

I`ve written a program that selects some specific entries from different database tables if they exist. Now I need to know how to count the lines that have been read from those tables.

Here´s a part of my coding:

...

SELECT bukrs FROM EVER appending TABLE lt_tab

WHERE bukrs = '2101'.

SELECT bukrs FROM KNB1 appending TABLE lt_tab

WHERE bukrs = '2101'.

DESCRIBE TABLE lt_tab LINES n.

IF n = 0.

...

Now I need the number of the lines of the tables to be shown (that have been read in ever or in KNB1) !?

Thank`s in advance

5 REPLIES 5

Former Member
0 Kudos

After each SELECT you can check the value of SY-DBCNT. Thsi returns the number of records selected.

0 Kudos

Ok, let me give it a try...

0 Kudos

ok, Now I understand. Thank`s.

Former Member
0 Kudos

Moderator message - Please do not ask or answer basic questions - thread locked Rob

brad_bohn
Active Contributor
0 Kudos

Might I suggest that if you're an inexperienced developer that you read the help files as you program? This answer is explained clearly in the help files for SELECT - you'll become a better developer if you do this...