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: 

Sort a DB table

Former Member
0 Kudos

Hello Experts,

Could you please tell me how to sort a Data base table.. The "SORT " in ABAP works on the internal table.. but how do i sort a Database table..

Please help..

Thanking you in advance.

Regards/-

Tamanna K

7 REPLIES 7

Former Member
0 Kudos

Hello,

But why do you want to do that?

Vikranth

Former Member
0 Kudos

>

> Hello Experts,

>

> Could you please tell me how to sort a Data base table.. The "SORT " in ABAP works on the internal table.. but how do i sort a Database table..

> Please help..

>

>

> Thanking you in advance.

>

> Regards/-

> Tamanna K

hmm...strange requirements!!!,Strange Becuase already the data exists in sorted order in the database based on its primary key fields...

Could you please tell me why you need to sort a DATABASE table??

Vishwa.

Former Member
0 Kudos

Hi Tamanna,

This idea looks quite vague. This isnt possible.

You can get the data into an internal table & manipulate as per your requirement.

Hope it helps.

Cheerz

Abhii

former_member206377
Active Contributor
0 Kudos

Use ORDER BY in your select query

Or you can even select your data into an itab and then use SORT.

but if you want to sort the DB table itself, then i dont think it would be possible because the DB table rows are not held in any particular order, the order is applied when you fetch the data from the table.

Former Member
0 Kudos

Hi,

Rather sorting the database table,

You can Select the data from that

table into an internal table and then

sort that internal table by as many fields.

Hope it helps

Regards

Mansi

former_member404244
Active Contributor
0 Kudos

Hi,

once you see the contents of the db table in SE11 in the screen it self you can find sort either by ascending or descending. the fields ....

Please elaborate your requirement .. I don't see any need sorting a database table....

Regards,

Nagaraj

0 Kudos

Thank you All

Regards,

Tamanna.