‎2009 Apr 14 6:27 AM
Hello Experts,
In my report , i m using sort button.
I explore some code and it is working fine b but i , not able to understand how it is working.
at user-command.
case sy-ucomm.
When 'SORT2'.
get cursor field f offset off
line lin value val length len.
GET CURSOR LINE LIN OFFSET OFF VALUE VAL LENGTH LEN.
if off > 0 and off < 9.
sort t_flight by carrid descending .
elseif off > 9 and off < 16.
sort t_flight by connid descending .
elseif off > 16 and off < 25.
sort t_flight by airpfrom descending .
elseif off > 25 and off < 37.
sort t_flight by cityfrom descending .
elseif off > 37 and off < 45.
sort t_flight by airpto descending .
elseif off > 45 and off < 69.
sort t_flight by cityto descending .
elseif off > 69 and off < 79.
sort t_flight by deptime descending .
elseif off > 79 and off < 91.
sort t_flight by arrtime descending .
elseif off > 91 and off < 104.
sort t_flight by fltime descending .
endif.
Please explain.
Savita
‎2009 Apr 14 6:28 AM
This is not a training forum.
Please debug the program and discover for yourself.
pk
‎2009 Apr 14 6:31 AM
‎2009 Apr 14 6:32 AM
Hi,
Just debug the program and see what's it is doing. If you do not understand what are the key words doing, use F1...
‎2009 Apr 14 6:33 AM
Press F1 on the keyworks and try .
This code will also be avaliable in sample codes in various sources.
‎2009 Apr 14 6:38 AM