Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Count number of rows in table


1. How can you through ABAP and select statements count the number of rows in one table?

2. I want to read all rows from one table to an internal table. Can this be done dynamically or do I first have to count the number of rows in the table and then declare an internal table with the number of rows counted.





No you don't have to count number of rows first, Internal table size will increase dynamically. you have to declare this with initial size like this.

<b>data: itab type standard table of bkpf initial size 0.

SELECT * FROM bkpf into table itab.</b>

All values from bkpf will be inserted into table internal table itab.


0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question