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: 

Select max of internal table

Former Member
0 Kudos
5,155

Hi.

How i can do a select max of a internal table.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,222

internal table only has a field.

6 REPLIES 6

Former Member
0 Kudos
1,222

say internal table has fields F1 and F2 and u want to selet Max F1

sort itab by f1 descending f2.
read table itab index 1.
write : itab-f1.     " u can get MaX F1 here

0 Kudos
1,222

Hi Chandrasekar

How can I get the max value in a row of an internal table ? What u told will sort column wise btu not row wise.

Pl. help

Thanks in advance

Former Member
0 Kudos
1,223

internal table only has a field.

0 Kudos
1,222

then this will work

sort itab by f1 descending.
read table itab index 1.
write : itab-f1.     " u can get MaX F1 here

0 Kudos
1,222

hi andres,

sort itab by [field] descending

read table itab index 1.

with regards,

suresh babu

Former Member
0 Kudos
1,222

hii,

use this code

sort itab descending.

read table itab index 1.

write : itab-f1.

award if of any use

regards vikaas