Skip to Content

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

Count number of rows in table

Hi!

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.

regards

Baran

Tags:
replied

HI,

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.

Regards,

0 View this answer in context

Helpful Answer

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