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: 

How to get the greatest number of 4 sales order number??

Former Member
0 Kudos

Hi Experts.

I have 4 sales order number.

say example...

61351,61352,61353,61354 .

I want the greatest number to be chosen from 4 i.e., 61354.

Please let me know.

Thanks in advance.

Regards.

Manu.

4 REPLIES 4

former_member194669
Active Contributor
0 Kudos

sort itab by orderno descending

read table itab index 1.

now itab-orderno contains largest number

aRs

Point are always welcome

Former Member
0 Kudos

Hi,

Sort the Internal table by Descending and get the record with sy-tabix = 1.

eg., Sort ITAB by number descending.

Read table ITAB with key sy-tabix.

Thanks,

Yogesh

Former Member
0 Kudos

If you have those numbers in an Internal table, then

SORT ITAB BY VBELN DESCENDING.

READ TABLE ITAB INDEX 1.

WRITE ITAB-VBELN.

If you have those numbers in a sequence, then you need to compare each value and then get the highest value.

For example,

if vbeln1 gt vbeln2.

....

endif.

Regards,

Pavan.

Former Member
0 Kudos

Hi,

hi,

sort your internal table in decending order

SORT ITAB BY VAL DESCENDING.

READ TABLE ITAB INDEX 1.

WRITE ITAB-VAL.

u will get the greatest.

Regards