Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reading record from itab

Former Member
0 Likes
738

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

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

5 REPLIES 5
Read only

Former Member
0 Likes
714

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.

Read only

0 Likes
714

can u explain ur query more

coz sometimes u r reading 2 records

sometimes 3 and sometimes 4.

plz explain

Read only

former_member189629
Active Contributor
0 Likes
714

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

Read only

former_member189059
Active Contributor
0 Likes
714

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...

Read only

paruchuri_nagesh
Active Contributor
0 Likes
714

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