07-24-2008 3:38 AM
Hi experts
I have and enhancement for 0MAT_SALES_ATTR. I am trying to select one single row from table A901, based on the max value for field DATBI.
Can somebody tell me what's wrong with my code, or an other way for getting the result inttended.
select MAX( DATBI ) KNUMH into (fecha, v_cvecond)
from A901
where MATNR eq wa_mat-matnr and
VKORG eq wa_mat-vkorg and
PLTYP eq 'XA' and
DATBI eq fecha
GROUP BY DATBI KNUMH.
Thanks!
07-24-2008 6:03 AM
Hi,
1.select MAX( DATBI )
INTO <INTERNALE TABLE 1>
from A901
where MATNR eq wa_mat-matnr and
VKORG eq wa_mat-vkorg and
PLTYP eq 'XA' and
DATBI eq fecha
GROUP BY DATBI KNUMH.
2. Now use FOR ALL ENTRIES
select DATBI KNUMH
INTO <INTERNALE TABLE 2>
from A901
FOR ALL ENTRIES IN <INTERNALE TABLE 1>
WHERE DATBI = <INT_TABLI1-DATBI>.