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

find maximum document number for each document

Former Member
0 Likes
739

HI All,

How to find date wise maximum document number for each document (purchase,sales,Finance) .

Thks

Shailesh

4 REPLIES 4
Read only

Former Member
0 Likes
690

Hi Shailesh,

you may try using "max" and "group by" in your select.

i.e you'd be selecting the max(<field name for document no.>) from ... group by <date field>.

regards

Read only

0 Likes
690

but in cluster table aggregate functions are not allowed.

Regds

Shailesh

Read only

Former Member
0 Likes
690

Hi Shailesh,

I am assuming you have data already selected.

Once you select the data, sort internal table as follows.

sort itab by doc_type descending date.

delete adjacent duplicates from itab comapring doc_type.

This will give each latest document no.

Hope ti will help you.

Regards,

Anil

Read only

0 Likes
690

ok