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

Former Member
0 Likes
469

Hello,

I am having problems sorting a table.

The internal table has following data:

Doc_num..........ver_num

TEST123.............02

TEST123.............01

TESTXYZ.............02

TESTXYZ.............03

TESTXYZ.............01

TESTXYZ.............04

Now I am using statement :

SORT itab by doc_num ver_num.

Now this does sort the data according to correct doc_num but not according to ver_num.

Please help.

Thanks.

Regards,

Rajesh

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
450

I think result will be after sorting

TEST123 01

TEST123 02

TESTXYZ 01

TESTXYZ 02

TESTXYZ 03

TESTXYZ 04

is it correct ?

a®

4 REPLIES 4
Read only

Former Member
0 Likes
450

What do you want to see and what do you see?

Rob

Read only

former_member194669
Active Contributor
0 Likes
451

I think result will be after sorting

TEST123 01

TEST123 02

TESTXYZ 01

TESTXYZ 02

TESTXYZ 03

TESTXYZ 04

is it correct ?

a®

Read only

0 Likes
450

Note: I have defined doc_num and ver_num s string....

My input is:

TEST123.............1

TEST123.............2

TESTXYZ.............1

TESTXYZ.............20

TESTXYZ.............10

TESTXYZ.............2

I am seeing following:

TEST123.............1

TEST123.............1

TESTXYZ.............1

TESTXYZ.............10

TESTXYZ.............20

TESTXYZ.............2

I want to see as follows:

TEST123.............1

TEST123.............2

TESTXYZ.............1

TESTXYZ.............2

TESTXYZ.............10

TESTXYZ.............20

Read only

0 Likes
450

Then you'll have to define the version as some sort of number.

Rob