09-24-2007 7:45 AM
hi friends ,
how to read internal table n times
for EG: i have 5 records in itab
1. 1st time i should read record 1, 2, 3
2. 2nd time i should read record 2, 3 ,
3. 3rd time i sould read record 3,4, 5.
4. 4th time i sould read record 4, 5,1.
5. 5th time i should read record 5,1 , 2 ,3.
pls suggest me some logic to acheive this
regards
soorya
09-24-2007 7:51 AM
pls tell me clearly.
u get output like that or any thing.
u want see the records in itab
goto debugging /h that time u know clearly what happend in the loop ok
regards
kk.
09-24-2007 7:53 AM
can u explain ur query more
coz sometimes u r reading 2 records
sometimes 3 and sometimes 4.
plz explain
09-24-2007 7:53 AM
Soorya,
A READ only reads 1 line at a time. So if u wanna read 3 lines at once, u will have to write as many READs as u need with the INDEX addition.
Reward points for useful Answers
Regards
Karthik
09-24-2007 7:55 AM
use this to get data from a range of rows in an internal table
loop at itab into wa from 1 to 3.
append wa to...
endloop.
use this to get data from a particular row in an internal table
read table itab into wa index 1.
append wa to...
09-24-2007 7:58 AM
hi
use read key word
read table itab index 4
DO 10 TIMES.
READ TABLE ITAB sy-index INTO ITAB_WA..
IF sy-subrc <> 0.
EXIT.
ENDIF.
...
ENDDO.
regards
Nagesh.Paruchuri