‎2007 Apr 14 5:21 AM
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.
‎2007 Apr 14 5:29 AM
Hi,
If you have FOR ALL ENTRIES.. you cannot have aggregate functions..other than COUNT(*)
Thanks,
Naren
‎2007 Apr 14 5:27 AM
HI..,
there is no problem in your syntax!!
what is your problem with that ??
regards,
sai ramesh
‎2007 Apr 14 5:29 AM
Hi,
If you have FOR ALL ENTRIES.. you cannot have aggregate functions..other than COUNT(*)
Thanks,
Naren
‎2007 Apr 14 5:51 AM
hi naren,
both for all entries and aggregate cannot be together?
can have example?
thanks
points already given
‎2007 Apr 14 5:41 AM
‎2007 Apr 14 6:12 AM
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......