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

fetching the index value

Former Member
0 Likes
640

Hi

I have sorted MATNR in desceding order

I need to fetch the highest material number that is first index.

i need the syntax for that.

Regards,

Jayashree.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
622

sort itab by matnr descending.

read table itab index 1.

if sy-subrc = 0.

< process >

endif.

regards,

madhumitha

sort itab by matnr descending.

read table itab index 1.

if sy-subrc = 0.

< process >

endif.

regards,

madhumitha

4 REPLIES 4
Read only

Former Member
0 Likes
622

sort itab by matnr descending.

read table itab index 1.

get the highest matnr from itab-matnr.

Read only

Former Member
0 Likes
622

sort itab descending matnr.

Matnr should be first field in itab.

After sorting the table in descending order use below statement:

Read table itab into work_area index 1.

Best Regards,

Vibha

Please mark all the helpful answers

Read only

Former Member
0 Likes
623

sort itab by matnr descending.

read table itab index 1.

if sy-subrc = 0.

< process >

endif.

regards,

madhumitha

Read only

anub
Participant
0 Likes
622

Hi,

I think the answer is already given...

Please close this issue if answered.

Regards,

Anu.