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

Compare three values.

Former Member
0 Likes
587

i m having some 6 values in My internal table i want to compare the value & get the highest value.

I m using field symbol.

How to implement field symbol in this.

Field1 Field2

a 12

b 3

c 11

d 16

e 10

f 4

i have to compare & get the highest value record. here i have to get d 16

Thanls in advance.

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
480

How about sorting the table in decending order and reading the first record.

sort itab by field2 descending.
read table itab index 1.
write:/ itab-field1, itab-field2.

Regards,

Rich Heilman

Read only

0 Likes
480

thanks for ur quick response.

My table is hashed table i cant use index.

Maya

Read only

0 Likes
480

HI,

sort itab by field2 descending.

loop at itab.

value = d.

value1 = 16.

exit.

endloop.

Thanks

mahesh