‎2006 Oct 27 12:29 PM
friends,
i have an internal table which has 10 rows....in that, i need to sort the 1st column and the 8th col ascending wise...both are numeric fields only, i.e.,
sort itab by sloc days...but it's not working..where am i going wrong? thanks all
‎2006 Oct 27 12:35 PM
hi,
Check out this way ..
sort ascending itab by sloc days.Regards,
santosh
‎2006 Oct 27 12:35 PM
hi,
Check out this way ..
sort ascending itab by sloc days.Regards,
santosh
‎2006 Oct 27 12:35 PM
Hi,
This is the help on sort.
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3800358411d1829f0000e829fbfe/frameset.htm
Eddy
‎2006 Oct 27 12:46 PM
Hi,
one observation..
Do one thing just comment 2...7 fields in ur itab ..
and sort only 1 and 8 field ..
sort itab by 1(field).
now check the o/p ..
if it's correct as per ur expectations then some of the field from 2..7 is affecting the sort criteria..
im guessing this cause i dont know ur fields or itab structure .
regards,
Vijay
Message was edited by: Vijay
‎2006 Oct 27 12:56 PM
Satish,
SORT ITAB BY field1 field8.
The above should work...when you say it is not working can you describe the problem(with values) ?
Regards
Anurag
‎2006 Oct 27 1:39 PM
Satish,
sort ascending should work in this situation.
have a look at following code for some idea.
DATA: BEGIN OF t_t OCCURS 0,
v1(2) type n,
v2(2) type n,
v3(2) type n,
END OF t_t.
start-of-selection.
t_t-v1 = 10.
t_t-v2 = 10.
t_t-v3 = 10.
append t_t.
clear t_t.
t_t-v1 = 20.
t_t-v2 = 10.
t_t-v3 = 10.
append t_t.
clear t_t.
t_t-v1 = 30.
t_t-v2 = 20.
t_t-v3 = 10.
append t_t.
clear t_t.
t_t-v1 = 30.
t_t-v2 = 10.
t_t-v3 = 20.
append t_t.
clear t_t.
sort t_t ascending by v1 v3.
loop at t_t.
write:/ t_t-v1, space, t_t-v2, space, t_t-v3.
endloop.
-Anu