I have a requirement to find unused trading partner numbers . Trading partner is 6 digit numeric value stored in table T880. I have to find all the numbers from 10000 to 99999 which are not there in rcomp field of T880. I am this logic.
select rcomp from t880 into corresponding fields of table lt_t880.
lv_count = 9999.
do 90000 times.
lv_count = lv_count + 1.
read table lt_t880 into wa_t880 with key rcomp = lv_count.
if sy-subrc ne 0.
wa_range-rcomp = lv_count.
append wa_range to lt_range.
I am trying to avoid Do loop. Please suggest.