05-13-2010 9:10 AM
I have internal table which has 5 field, i want to sort particular field of int. table, which will not affect whole data of int table.
thanks
man
05-13-2010 9:13 AM
So you mean only a particular field should get re-arranged according to the sort condition without changing the order of other fields?
05-13-2010 9:52 AM
05-13-2010 10:01 AM
I don't think SORT will help you achieve this. You have to write code for this req. :
IT_TEMP[] = IT_DATA[].
SORT IT_TEMP BY F2. "Field based on which you want to sort.
LOOP AT IT_DATA INTO WA_DATA.
READ TABLE IT_TEMP INTO WA_TEMP INDEX SY-INDEX.
IF SY-SUBRC = 0.
MODIFY IT_DATA FROM WA_TEMP TRANSPORTING F2.
ENDIF.
ENDLOOP.
BR,
Suhas
PS: Why do you need it anyways? You data will be messed up completely
05-13-2010 10:16 AM
HI,
Every field has it's relevant record in Database - which we fetch by Internal tables.
So I think Diff. display on Application server & Database server is not possible.
Why don't you try two different internal tables --
One with the field you want to sort
Other will have remainining four fields.
If you want all fields to display in o/p, then merge both ITABs using work area.
05-14-2010 4:57 AM
my internal table is like that
matnr werks date qty lifnr
A AB 1/2/10 12 X
A AB 2/2/10 10 Y
A AB 3/2/10 9 Z
B XY 1/2/10 13 C
B XY 2/2/10 10 E
what i want is sort the date in descending order, always want latest date to pick first, nd acc to that qty nd lifnr will also sort
but keeping matnr and werks as intact, so what i will do, taking two int table, or is any way to sort particular field keeping other data intact. help me on this
05-14-2010 9:26 AM
05-13-2010 11:26 AM
What purpose does this serve.
move teh data of required field to a internal table having only one field and then sort it
07-12-2010 7:23 AM