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

Please help

Former Member
0 Likes
542

I'm using LINV table in my select stat. I'd like to satisfy this condition that ( if matnr, batch and storage bin are same then it should pick only one latest record). Please help.

for example,

storage bin matnr batch date

10009 10000121 31.03.2003 10009 10000121 01.04.2003

10010 10000121 01.04.2003

so the result should be

storage bin matnr batch date

10009 10000121 01.04.2003

10010 10000121 01.04.2003

1 ACCEPTED SOLUTION
Read only

rahulkavuri
Active Contributor
0 Likes
451

hi

For doing this first u need to sort ur internal table records by first 3 fields...

SORT ITAB BY MATNR STORAGEBIN BATCH .

this will bring all your fields in descending order with batchdate also sorted.

Next...

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR STORAGEBIN.

This will delete all ur records which are having same MATNR STORAGEBIN.

This will have your highest date record at the top

please award points if this solves your problem

2 REPLIES 2
Read only

rahulkavuri
Active Contributor
0 Likes
452

hi

For doing this first u need to sort ur internal table records by first 3 fields...

SORT ITAB BY MATNR STORAGEBIN BATCH .

this will bring all your fields in descending order with batchdate also sorted.

Next...

DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR STORAGEBIN.

This will delete all ur records which are having same MATNR STORAGEBIN.

This will have your highest date record at the top

please award points if this solves your problem

Read only

Former Member
0 Likes
451

batch date u have to sort by descending

SORT ITAB BY MATNR STORAGEBIN BATCH <b> descending.</b>