07-02-2008 9:48 PM
Hi All,
Can someone of you tell me, how to do the following in the ABAP Query. I want to get the count of records retreived during the query execution and display it in the output.
example::: Select count(*) from VBRK.
Thanks a lot.
Thanks!
Puneet.
07-02-2008 9:53 PM
From help doc:
Note
The SELECT COUNT( * ) FROM ... statement returns a result table containing a single line with the result 0 if there are no records in the database table that meet the selection criteria. In an exception to the above rule, SY-SUBRC is set to 4 in this case, and SY-DBCNT to zero.
You can just run SELECT COUNT (*) FROM TABLE
Number of rows is returned in SY-DBCNT
Edited by: Kevin Lin on Jul 2, 2008 10:55 PM
07-02-2008 9:55 PM
Hi,
I want to do it in ABAP Query using the transaction SQ01 (query creation).
Thanks!
Puneet.
07-03-2008 2:39 AM
select * from ....into interner table , then you can use sy-dbcnt to get the count of the select result.