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

Sorting Alfa Numeric Value

Former Member
0 Likes
572

Hi,

I want to sort PF account Number in ascending order.

I m using : SORT itab_final BY eepfn.

It is giving -

DL/15467/1073

DL/15467/1132

DL/15467/1134

DL/15467/115

DL/15467/118

DL/15467/16

I want to sort value after ' DL/15467/ '.

Kindly help me out.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
438

Hi Pooja

One thing you can do is to add an integer type field to you itab_final say nsort

Then


LOOP AT itab_final.
SPLIT itab_final-eepfn AT '/' INTO lv_dummy lv_dummy itab_final-nsort.
"maybe here you could a TRANSLATE stattement too but I'm not very sure how to use that
MODIFY itab_final INDEX sy-tabix.
ENDLOOP.

SORT itab_final BY nsort.

Pushpraj

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
438

Try this way

Create one more field say LEN in table itab_final.


loop at itab_final.
  itab_final-len   = strlen( eepfn ).
  modify itab_final.
endloop.
SORT itab_final BY len eepfn.

a®

Read only

0 Likes
438

Thanks a lot.

Read only

Former Member
0 Likes
439

Hi Pooja

One thing you can do is to add an integer type field to you itab_final say nsort

Then


LOOP AT itab_final.
SPLIT itab_final-eepfn AT '/' INTO lv_dummy lv_dummy itab_final-nsort.
"maybe here you could a TRANSLATE stattement too but I'm not very sure how to use that
MODIFY itab_final INDEX sy-tabix.
ENDLOOP.

SORT itab_final BY nsort.

Pushpraj