Skip to Content
0
Former Member
Oct 19, 2011 at 05:16 AM

How do I avoid Do loop.

18 Views

Hello Experts,

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.

CLEAR LV_COUNT.

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.

endif.

enddo.

I am trying to avoid Do loop. Please suggest.