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.
1. Select count(*)... is used to get count from table.
2. Select <field list> from <table> into table <internal table> is used to get full data of table into internal table.
3. describe table <internal table> lines <var> used to count the no. of lines in internal table.
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.