cancel
Showing results for 
Search instead for 
Did you mean: 

How does sy-tabix affect by binary search transforming no fields?

Former Member
0 Kudos
206

1 report ztx1110.

2 data: begin of it occurs 3,

3 f1(2) type n,

4 f2 type i,

5 f3(2) type c,

6 f4 type p,

7 end of it.

8

9 it-f1 = '40'. it-f3 = 'DD'. it-f2 = it-f4 = 4. append it.

10 it-f1 = '20'. it-f3 = 'BB'. it-f2 = it-f4 = 2. append it.

11

12 sort it by f1.

13 do 5 times.

14 it-f1 = sy-index * 10.

15 it-f3 = 'XX'.

16 it-f2 = it-f4 = sy-index.

17 read table it

18 with key f1 = it-f1

19 binary search

20 transporting no fields.

21 if sy-subrc <> 0.

22 insert it index sy-tabix.

23 endif.

24 enddo.

25

26 loop at it.

27 write: / it-f1, it-f2, it-f3, it-f4.

28 endloop.

in this program changing value of sy-tabix as such sy-index.

means in it's first loop it's value is 1, on second loop it's 2, and so on up to 5.

okay that is due to binary search.

but why binary search affecting this system variable?

View Entire Topic
anilsonesar
Explorer
0 Kudos

This message was moderated.