Application Development 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: 

Problem with abap enhancement

Former Member
0 Kudos

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!

1 REPLY 1

Former Member
0 Kudos

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>.