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: 

check select syntax

Former Member
0 Kudos

hi,

may i know if the syntax is correct.

thanks

select avbeln aposnr amatnr sum( akwmeng ) sum( b~rfmng )

into corresponding fields of table it_qty

from vbap as a inner join vbfa as b

on avbeln = bvbelv and

aposnr = bposnv and

b~vbtyp_n = 'J'

for all entries in it_delivery

where a~vbeln = it_delivery-vgbel

group by avbeln aposnr a~matnr

order by avbeln aposnr a~matnr.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If you have FOR ALL ENTRIES.. you cannot have aggregate functions..other than COUNT(*)

Thanks,

Naren

5 REPLIES 5

Former Member
0 Kudos

HI..,

there is no problem in your syntax!!

what is your problem with that ??

regards,

sai ramesh

Former Member
0 Kudos

Hi,

If you have FOR ALL ENTRIES.. you cannot have aggregate functions..other than COUNT(*)

Thanks,

Naren

0 Kudos

hi naren,

both for all entries and aggregate cannot be together?

can have example?

thanks

points already given

Former Member
0 Kudos

Hi,

I cant find any prob with that select stmt

Former Member
0 Kudos

hi ..

here the problem is with aggregate functions..

If the list in the SELECT clause (excepting aggregate expressions) contains one or more field names, the field names must also be listed in the GROUP BY clause. The aggregate functions do not then apply to all of the selected lines, but to the individual groups of lines.

use the<b> ORDER BY</b> Clause in the select query.

also see the following link.

http://help.sap.com/saphelp_nw04s/helpdata/en/f1/0a564ce09411d2acb90000e829fbfe/frameset.htm

Reward points if useful...

Suresh......