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

sort FUNC

Former Member
0 Likes
858

i have itab with

werks lgort and matnr lbkum

1000 10 11111 2323

..........................

i want to get the min value of lbkum

per matnr in werks

the final list need to be like this

werks matnr lbkum

10000 11111 2

20000 11111 3

30000 11111 1

40000 22222 1

8 REPLIES 8
Read only

Former Member
0 Likes
824

sort itab by WERKS ascending

MATNR ascending

LBKUM descedning.

Read only

Former Member
0 Likes
824

SORT itab BY werks matnr lbkum ascending.

Read only

Former Member
0 Likes
824

sort itab by WERKS MATNR ascending

LBKUM descedning.

Read only

Former Member
0 Likes
824

Rani,

The order of LBKUM is neither in ascending / descending order in the output you have displayed.

If you can specify whether it ASC / DESC, then you can do.

SORT ITAB WERKS ASC MATNR ASC LBKUM DESC.

Regards,

Ravi

Read only

0 Likes
824

hi,

as far as i understand ur requirement:

sort itab by WERKS MATNR ascending

LBKUM descedning.

rgds,

latheesh

Read only

Former Member
0 Likes
824
First put lgort field at last in itab
sort itab by werks matnr lkbum

declare another itab1 with only  fields werks matnr lkbum

loop at itab.
  at new matnr.
     move-corresponding itab to itab1.
     append itab1.
     clear itab1.
endloop.

this will give u minimum lkbum per matnr per werks in itab1

<b>have u tried mine</b>

Message was edited by: Sekhar

Message was edited by: Sekhar

Read only

Former Member
0 Likes
824

Hai Rani

sort itab by WERKS MATNR LBKUM Asdending.

Thanks & regards

Sreenivasulu P

Read only

0 Likes
824

i tried all the example and it not work