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: 

ALV numerically column sorting

Former Member
0 Kudos
186

Hello All,

In an ALV list is a colum of type char(5), when the list is sortend by this column, it is sorted alfabethically.

How to specify in the ALV when that column is sorted to be sorted numerically?(not alfabeticaly).

Thank you

Bogdan

6 REPLIES 6

Former Member
0 Kudos
96

Hi,

Specify on what column basis u have to sort.

If u specify based on char column it will sort alphabetically, if u give by numeric column then it will do so.

So specify some numeric column name for sorting.

0 Kudos
96

Hi Judith,

The Column which must be numerically sorted is of type char, and the problem is that i can not modify its type to a numerically one.

Thank u

Bogdan

0 Kudos
96

Hi,

If it is of type CHAR then how come u can sort numerically?

0 Kudos
96

if it is char field and you want to sort numerically

keep numerical values in that field like

00001

00002

00003...

00099...

then if your sort this alphabetically u can the numeric sort...

while diaplaying u need to only value without zeros in front of values, then use CONVERSION_EXIT_ALPHA_OUTPUT to achive this.

regds

gv

0 Kudos
96

A sort example:

Values for cost center:

100, 200, 203, 1001, 1004, Not assigned,.. etc.

value "not assigned" can not be stored in a numeric field.

So if sorted those values:

100,1001,1004,200,203,Not assigned..

and i need

100,200,203,1001,1004,Not assigned..

thnks

Bogdan

0 Kudos
96

Hi Bogdan,

There is nothing much you can do about that, I guess.

A character field will be sorted as a character.

If you didnt have alphabets, then may be we could have changed some properties in fieldcatalog and achieved ur goal. In this case, I dont think there is a way out.

Remember 2 reward points to answers that were very helpful for you.

Reg,

Prash,.