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: 

Sorting of Internal Tables

Former Member
0 Kudos

Hi All,

I have a small problem in sorting the internal table,

The scenario is like this:

I have 2 internal tables.

1st internal table contains 2 fileds like TRKORR , AS4TEXT. Here TRKORR values are unique.

2nd internal table contains 3 fields like TRKORR , TIMESTAMP , USERNAME.Here one TRKORR value has multiple values of TIMESTAMP ,

I need to get the lastest TRKORR with respect to TIMESTAMP and ignore the rest of the values .

Note: The timestamp values are jumbled........

can anyone suggest a small logic for this..

Thanks in advance

2 REPLIES 2

former_member386202
Active Contributor
0 Kudos

Hi,

try like this

sort itab2 by TRKORR TIMESTAMP descending.

Regards,

Prashant

Former Member
0 Kudos

Sort itab2 descending by TIMESTAMP.

read itab2 into wa index 1. " This will get the desired trkorr value.

Lokesh