2012 Sep 18 7:36 PM
Hi Abap Gurus,
I am facing a apparently simple question but i can not found the answer
I need to select the maximum year and then select the maximum month
for exemple matnr year month
b-12 2012 2
b-12 2012 3
b-11 2011 7
I want to get
b-12 2012 3
b-11 2011 7
How can i get this using select max?
Or do you have another purpose?
Thank You and Best Regards
João Fernandes
2012 Sep 18 9:25 PM
Hello Joao,
I would try to use "GROUP BY":
SELECT matnr MAX( year ) MAX( MONTH ) FROM ztable
WHERE ...
GROUP BY matnr fiscyear month.
Kind regards,
Hendrik
2012 Sep 19 7:04 AM
select max( ERSDA ) from mara upto 2 rows.
where "your where condition.
will select any no of rows u want.