how to get last po number ?

Question: Hi all ,
someone can tell me how to use group by to get last po number ?

I write code like this , but it always get all record

SELECT MAX( EBELN )
INTO ITAB_EKKO-EBELN
FROM EKPO
WHERE MATNR IN S_MATNR
GROUP BY EBELN .
WRITE : /01(10) ITAB_EKKO-EBELN ,
ENDSELECT .

Answer:
Why not use this one instead?

Code A:
The GROUP BY clause fields1 combines groups of lines into single lines of the result table. A group is a set of records with the same value of each database field listed in the GROUP BY clause.

_________________
Regards,

Quasar(PH)
Copyright ?2007 - 2008 www.jt77.com