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

Sort Code working

Former Member
0 Likes
627

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

5 REPLIES 5
Read only

Former Member
0 Likes
608

This is not a training forum.

Please debug the program and discover for yourself.

pk

Read only

Former Member
0 Likes
608

This message was moderated.

Read only

dev_parbutteea
Active Contributor
0 Likes
608

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

Read only

Former Member
0 Likes
608

Press F1 on the keyworks and try .

This code will also be avaliable in sample codes in various sources.

Read only

Former Member
0 Likes
608

This message was moderated.