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 Deep Structure internal table

Former Member
0 Likes
1,604

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.

4 REPLIES 4
Read only

Former Member
0 Likes
814

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

Read only

0 Likes
814

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

Read only

Former Member
0 Likes
814

Hi,

You have to move the values to a differnt internal table and then sort it...

Read only

Former Member
0 Likes
814

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.