2006 Mar 31 9:05 AM
Hi all,
I need to fill in a table without konwing in advance its structure. The solution is to use a field symbol and assign its content and <b>that works</b>.
DATA : TAB_DATA TYPE REF TO DATA ...
FIELD-SYMBOLS: <fs> TYPE ANY TABLE ...
ASSIGN tab_data->* TO <fs> ...
OK, I can read the content of my table directly from <fs> and display it in the layout of my BSP.
<b>But Now</b> : I want to sort this table when a user click on the header column of my BSP.
The problem it's that I don't know the structure of my table and the following code :
SORT <fs> BY event->column_key DESCENDING.
gives me the following error :
The specified type has no structure and therefore no component called "EVENT".
Any idea to solve this problem ?
Regards.
2006 Mar 31 9:26 AM
Hi
If the value of event->column_key is the name of field for sorting:
SORT <fs> BY (event->column_key) DESCENDING.
Max
2006 Mar 31 9:22 AM
Allan,
I am assuming that somehow you will be able to know the name of the column on which the user has clicked at runtime.
See if you can use something like this, provided you can get the name of the column at runtime.
data : column(10) type c value 'Column name'.
sort t_data by (column) descending.
regards,
Ravi
Note : Please mark the helpful answers.
Message was edited by: Ravikumar Allampallam
2006 Mar 31 9:50 AM
Hi Ravikumar,
Sorry it doesn't work. Thanks for your help.
Allan
2006 Mar 31 9:26 AM
Hi
If the value of event->column_key is the name of field for sorting:
SORT <fs> BY (event->column_key) DESCENDING.
Max
2006 Mar 31 9:51 AM