04-03-2009 4:07 PM
Hi,
i have an internal table with 5 fields. Last field is flag. In my internal table lot many records are there. i want to count only the records with flag 'E'. How to count the total records with 'E'.
Mohana
04-03-2009 4:19 PM
itab_temp[] = itab[].
delete itab_temp where flag NE 'E'.
describe table itab_temp line lv_lines.
04-03-2009 4:15 PM
Hi,
You can do this by a logic.
Put a loop at table and checking the condition .
Loop at itab.
If itab-field5 is 'E'.
count = count +1.
Endif.
Endloop.
Regards,
Anuj
04-03-2009 4:16 PM
Try like this,
Data: c type i.
Loop at itab into wa.
if wa-flag = 'E'.
c = c + 1.
endif.
Endloop.
Write:/ 'Total records', c.
OR
LOOP AT itab WHERE flag = 'E'.
c = c + 1.
ENDLOOP.
Edited by: Sap Fan on Apr 3, 2009 5:21 PM
04-03-2009 4:19 PM
itab_temp[] = itab[].
delete itab_temp where flag NE 'E'.
describe table itab_temp line lv_lines.