2021 Sep 01 10:18 AM
Hi
Is it possible to count the number of rows in a filtered table using a build-in FM or BAPI call?
EM_GET_NUMBER_OF_ENTRIES seems to only count total rows in table, but I would like to count, for example, the records in USR02 where GLTGV > '2020-01-01'.
It is possible when working in SE16n by pressing F7, and I'm hoping to do the same but by calling a standard FM or BAPI (without downloading all rows in the table)
Hi
Is it possible to count the number of rows in a filtered table using a build-in FM or BAPI call?
EM_GET_NUMBER_OF_ENTRIES seems to only count total rows in table, but I would like to count, for example, the records in USR02 where GLTGV > '2020-01-01'.
It is possible when working in SE16n by pressing F7, and I'm hoping to do the same but by calling a standard FM or BAPI (without downloading all rows in the table)
2021 Sep 01 2:36 PM
The FM you listed above itself uses a Select Count statement.
Since you need to have a custom filter condition, you will mostly have to write your own Select Count query to get the required count.
2021 Sep 01 2:55 PM
Can't you use SQL?
SELECT COUNT(*) FROM USR02 WHERE GLTGV > '20200101' INTO @DATA(counter).
2021 Sep 01 3:13 PM
I need to use a RFC Enabled BAPI or FM as the call will come from an external system. I.e. can't do ABAP. Thanks!
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |