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: 

Unknown colunmn name - Abap code error

bhat_vaidya2
Active Participant
0 Kudos
1,603

Hi

I have this error in my code.

Unknown column name "SUM(EKBE-MENGE)" field list. field list. field

My code

*Select sum(ekbe-menge)

into MCSTRUCT-ZQuant

from ekbe*

How do I resolve this.

thanks

10 REPLIES 10

Former Member
0 Kudos
211

try like this

*Select sum(menge)

into MCSTRUCT-ZQuant

from ekbe*

Former Member
0 Kudos
211

Hi,

Do not use the table name with in the braces, only use the field name

Thanks

Sudheer

Former Member
0 Kudos
211

use just columnname. maybe you even need a space before and after it.

Edited by: Florian Kemmer on May 27, 2009 10:11 AM

Former Member
0 Kudos
211

Hi Bhat Vaidya,

DATA : v_menge TYPE ekbe-menge.

SELECT SUM( menge )
INTO v_menge
FROM ekbe.

Regards,

Suneel G

Former Member
0 Kudos
211

hi,


Select sum(menge) into MCSTRUCT-ZQuant from ekbe .
endselect.

0 Kudos
211

are you sure an aggregate function will work with an select endselect?

0 Kudos
211

i m sorry.


data : begin of it_data occures 0,
          ebeln like ekbe-ebeln,
          ebelp like ekbe-ebelp,
          menge like ekbe-menge,
          end of it_data .

Select ebeln ebelp sum(menge) into it_data from ekbe  Group by ebeln, ebelp .



0 Kudos
211

Hi experts

Thanks all for your help

I used this code with space and apersand and it resolve the issue.

SELECT SUM( ekbe~menge )

Much appreciated.

thanks

0 Kudos
211

Hi,

If you use tilde you will hit performance issue.

DATA : v_menge TYPE ekbe-menge.

SELECT SUM( ekbe~menge )
INTO v_menge
FROM ekbe.

Regards,

Suneel G

Former Member
0 Kudos
211

Select sum*(* ekbe-menge *)*
into MCSTRUCT-ZQuant
from ekbe

maintain the single space between the field and the brackets. that should do.