Application Development 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: 

Field Symbol to internal table

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

If the value of event->column_key is the name of field for sorting:

SORT <fs> BY (event->column_key) DESCENDING.

Max

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

Hi Ravikumar,

Sorry it doesn't work. Thanks for your help.

Allan

Former Member
0 Kudos

Hi

If the value of event->column_key is the name of field for sorting:

SORT <fs> BY (event->column_key) DESCENDING.

Max

0 Kudos

Hi max,

You're right it solves my problem.

Thanks, Allan.