Application Development and Automation 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: 
Read only

check select syntax

Former Member
0 Likes
716

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
Read only

Former Member
0 Likes
676

Hi,

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

Thanks,

Naren

5 REPLIES 5
Read only

Former Member
0 Likes
676

HI..,

there is no problem in your syntax!!

what is your problem with that ??

regards,

sai ramesh

Read only

Former Member
0 Likes
677

Hi,

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

Thanks,

Naren

Read only

0 Likes
676

hi naren,

both for all entries and aggregate cannot be together?

can have example?

thanks

points already given

Read only

Former Member
0 Likes
676

Hi,

I cant find any prob with that select stmt

Read only

Former Member
0 Likes
676

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