‎2009 Jun 17 1:48 PM
Hi
I have an internal table of a particular table type, say X. This table type has one field which is of another table type, say Y.
I need to sort table X based on a field in Y.
Is there any way to do that?
Thanks and Regards
Arnab.
‎2009 Jun 17 1:50 PM
HI,
Create another internal table like X, then move the values from the deep structure (only from table X) to the newly created internal table then SORT it and move back the values to the original internal table.
Thanks
Sudheer
‎2009 Jun 17 1:53 PM
Hi,
Thanks for the reply. I am already aware of this option. I am looking for a more smpler option, like some variation of the sort statement, etc.
Regards,
Arnab
‎2009 Jun 17 1:55 PM
Hi,
You have to move the values to a differnt internal table and then sort it...
‎2009 Jun 17 3:17 PM
Add extra field in internal table, to store value of field in Y while populating.
Then sort by that extra field name.
If you do not want to change the structure of internal table, create another internal table which contains key field of original internal table, and one extra field. This itab can be used as kind of secondary index, on basis of which, you can order original itab records.