03-23-2010 7:09 AM
Hi
i have an internal table
ID-----FIELD1
11----XX1
11----XX2
22----XX3
I am looping at the ITAB i need that for example since 11 has many occurences i do processing A and else Processing B.
A bit like the DESCRIBE statement which return the No of lines. except that i need to add the ID condition
Can anyone please advise if there is an ABAP keyword to do this
03-23-2010 7:20 AM
Hello
No keyword for this.
Try this logic:
data: itab1 like itab occurs 0.
data: counter type i.
sort itab.
loop at itab.
at new id.
itab1[] = itab[].
delete itab1 where id NE itab-id.
describe table itab1 lines counter.
if counter = 1. " only one record with particular ID
* do anything
else. " some records with ID
* do anything
endif.
refresh itab1.
endat.
endloop.