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 internal table

Former Member
0 Likes
654

Hi

i want to sort an internal table ascending by some fields if any to records matches then sort in descending order by some other fields,

please help me to do this.

Thankas&Regards,

venkat

5 REPLIES 5
Read only

Former Member
0 Likes
605
Read only

Former Member
0 Likes
605

hi see thse threads

U can sort by specifying ascending and descending on seperate fields in same statements but not sure abt the condition thing u mentined so see these threads

in the above thread somebody ahs given suggestion to use

C140_TABLE_DYNAMIC_SORT

U can try it, i cannot try it now as i am not on sap right now.

Edited by: kartik tarla on Jan 18, 2009 4:35 PM

Read only

Former Member
0 Likes
605

HI ,

the syntax for sorting an internal table .

sort itab by <field name> ascending.

sort itab by <field name> descending.

regards

chinnaiya

Read only

Sandra_Rossi
Active Contributor
0 Likes
605

Hi Venkat, I saw your last posts and I advise you to be more accurate in your questions (for example, give initial data and expected result) AND close your threads with a feedback, so that you may receive accurate answers in the future ; read [rules of engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]

Read only

Former Member
0 Likes
605

Hi,

First sort internal table abter that use 'AT' commads and modify as per your requirement.

Regards

Md.MahaboobKhan