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

Maximum amount to be selected

Former Member
0 Likes
630

Hi Friends,

I want to select maximum amount record from the internal table, can any one tell me how to extract that maximum record.

Regards,

Line

Hi Friends,

I want to select maximum amount record from the internal table, can any one tell me how to extract that maximum record.

Regards,

Line

5 REPLIES 5
Read only

Former Member
0 Likes
609

Hi Friends,

I coded in this way but cannot

SELECT MAX( trans ) status

INTO (v_trans v_status ) from lt_final.

Regards,

Line

Read only

0 Likes
609

Hi Line,

Try this.

SELECT MAX( trans ) status

INTO (v_trans v_status ) from lt_final.

GROUP BY trans

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
609

Hi Line Turbin,

Let me tell you one simple way..

sort the internal table descending by the amount.

then loop at the internable table and if sy-tabix = 1. then exit

example:

sort i_tab by wmbtr descending.

loop at i_tab.

if sy-tabix = 1.

move the hight value into variable or the row into something

exit.

endloop.

award points if useful

Read only

0 Likes
609

Hi there,

Can we move a record by using one statement.

Regards,

Line

Read only

0 Likes
609

Hi Line,

The best way is to select the maximum value using select query itself so that there will be less amount of data selected in the internal table and no need to do further processing on it.

Regards,

Atish