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 table containing single row as display

Former Member
0 Likes
1,103

Dear Experts,

Can anyone let me know how to sort table containing single row as display.

The scenario is i have to show lastest text (comment) in the top following by its previous.

Here in text i have "date" "time" "userid" -"comment".

PS: i'm append one line having '________' after every row and my table has only 1-Row

PFB the details

Thanks

SK

Dear Experts,

Can anyone let me know how to sort table containing single row as display.

The scenario is i have to show lastest text (comment) in the top following by its previous.

Here in text i have "date" "time" "userid" -"comment".

PS: i'm append one line having '________' after every row and my table has only 1-Row

PFB the details

Thanks

SK

3 REPLIES 3
Read only

Former Member
0 Likes
995

HI

Is your database table also having one record only..?

regards

laxman

Read only

matt
Active Contributor
0 Likes
995

Sorting this kind of data is the wrong approach. Get your data in order using the original data then construct your table.

SORT original_data BY date descending time descending.

LOOP AT original_data INTO record.

   row = record-date && record-time && record-username && record-comment.

  insert row into table rows.

  insert row_of_underlines into table rows.

ENDLOOP.

Not exactly complicated ABAP is it?

Read only

Former Member
0 Likes
995

Do you mean your table has only 1 column right?

but multiple rows still.

You can build another table having date, time, row id as columns, extract data from your table and fill this, and then sort based on date & time and then fetch row id and rearrange your original internal table.