12-13-2008 6:44 PM
Hello!.
I need to get records count of internal table with condition.
for example like loop works:
LOOP AT int_table WHERE row > 0.
ENDLOOP.
but I don't need to get records of table, I just need to count it.
Do you know how to get it ?
04-29-2015 4:55 PM
Hello Paul,
You can simply try this.
data : lv_count type i.
lv_count = lines( lt_itab ).
Thanks and Regards,
Nandan
12-13-2008 6:46 PM
12-13-2008 6:53 PM
As I understand DESCRIBE TABLE operator count lines of all table,
and I need to count just number of records with WHERE condition.
12-13-2008 6:57 PM
Hi there..
int_table_1[] = int_table[].
delete int_table_1 where row > 1.
describe table int_table_1 lines lv_lines.
refresh int_table_1[].
12-13-2008 7:07 PM
Hi J@Y.
I have an internal table with large number records..
creation of new table, copying of contents and then deletion of unnecessary records is very complicated, do you know much simpler way to do that ?
12-13-2008 7:09 PM
data: int_table_1 type standard table of int_table. "<< this is easy
int_table_1[] = int_table[].
hits very less on the performance.. Infact very very little.. dont bother much about this... ABAP has some limitations.. you got to over come that with performance.. ABAP 7.0 is gonna over come with all these issue..
what is the large number you are talking about..? how big is the number?
J@Y
12-13-2008 7:10 PM
12-13-2008 7:11 PM
if you don't want to copy to another table
then you have to use loop with condition
otherwise while making SELECT from table itself you need to use WHERE conditon
a®s
12-13-2008 7:16 PM
>> what is the large number you are talking about..? how big is the number?
I meant many records in the table
thank you for your answer, I thought it is not less on the performance )).
So I will use your advise.
12-13-2008 8:44 PM
you can try this as well:
DATA : count TYPE i.
LOOP AT itab WHERE condition TRANSPORTING NO FIELDS.
count = count + 1.
ENDLOOP.
12-29-2014 11:57 AM
12-15-2008 3:40 AM
Hi Paul,
To count number of records based upon any condition, use code:-
DATA : lines_count TYPE i. "for counting number of lines
LOOP AT itab WHERE condition TRANSPORTING NO FIELDS. "this will not move any records into work area
lines_count = lines_count + 1. "increment counter
ENDLOOP.
WRITE : / 'Lines :', lines_count. "print
Hope this solves your problem.
Thanks & Regards
Tarun Gambhir
04-29-2015 4:55 PM
Hello Paul,
You can simply try this.
data : lv_count type i.
lv_count = lines( lt_itab ).
Thanks and Regards,
Nandan
03-23-2016 4:34 PM
11-01-2021 1:25 PM