Hi,
When you sort, sort operation will follow the order you give the columns if you give SORT by A B C that order will be taken if you give B A C then that order will be followed.
SO thats why you see that result.
Regards,
Sesh
hi Essa,
It would be better if you could sort it with key fields .. and more over the order in which you might have used the sort statement is
sort ITAB by B A C.
Note : Please close your previous theread by marking helpful answers
Regards,
Santosh
Hi,
check this code,
REPORT ZEX31 .
data : begin of itab occurs 0,
f1 type i,
f2 type i,
f3 type i,
end of itab.
itab-f1 = 9 .
itab-f2 = 2.
itab-f3 = 11 .
append itab.
clear itab.
itab-f1 = 4 .
itab-f2 = 9.
itab-f3 = 10 .
append itab.
clear itab.
itab-f1 = 8 .
itab-f2 = 3.
itab-f3 = 7 .
append itab.
clear itab.
loop at itab.
write : / itab-f1 , itab-f2 , itab-f3.
endloop.
sort itab by f1 f2 f3.
skip 2.
loop at itab.
write : / itab-f1 , itab-f2 , itab-f3.
endloop.
sorting will be based on the order u give,
if u give order f1 f2 f3 then first f1 will be checked and sorted in the order of it.
o/p will be
4 9 10
8 3 7
9 2 11
Add a comment