on 2011 Mar 23 10:24 AM
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?
Request clarification before answering.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
21 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.