04-02-2009 8:03 AM
Hello
I have the following situation: In my coding I have a generic table containing any data and I know the corresponding table type stored in a string. Now I'm looking for a way to sort such generic internal table by a component.
Any help is appreciated.
Thanks,
Mathias
04-02-2009 8:13 AM
can u paste some code of urs so that the problem becomes clear....
04-02-2009 8:25 AM
I found a solution:
DATA: lt_data TYPE data.
FIELD-SYMBOLS:
<lt_data> TYPE any TABLE.
assign lt_data to <lt_data>.
try.
sort <lt_data> by ('TYPE') ASCENDING.
04-02-2009 8:31 AM
Hi Mathias,
You can sort a standard or hashed table in a program.If the table is a generic sorted table, the SORT statement causes a runtime error if the sort key is not the same as an extract of the beginning of the table key.The SORT statement is only allowed for generic internal tables, if it does not violate the internal sort order.
I hope , this information should useful to you.
by
Prasad GVK.