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

aggregate function

Former Member
0 Likes
563

Hi All,

I have a select statment from COPA,

SELECT

frwae

perio

SUM( VV123 ) as VV123

FROM CE1XXXX

INTO corresponding fields of table t_CE1XXXX

group by frwae perio.

I wish the each line of VV123 divided by the each KURSF and output the SUM.

I try

SELECT

frwae

perio

SUM( VV123 / KURSF ) as VV123

FROM CE1XXXX

INTO corresponding fields of table t_CE1XXXX

group by frwae perio.

but not work,

many thanks to all, points will be reward.

3 REPLIES 3
Read only

Sougata
Active Contributor
0 Likes
500

No, the ABAP syntax will not allow it. Basically you are confusing the Run-time first by specifying SUM but then calling a division function within it. First get the result by division then use SUM or first SUM then use division but you cannot use the aggregate function like that with ABAP.

Cheers,

Sougata.

Read only

Former Member
0 Likes
500

Thanks, problem solved.

1. I will

Select vv010, KURSF from CE1XXX into Itab.

2. Then

Loop.

Result = VV010 / KURSF.

ENDLOOP.

Read only

Former Member
0 Likes
500

Hi!!

Y are you trying to sum up in the select query itself.Better way will be use select query only for picking up the data in internal table.

Then loop at internal table.Divide each data by KURSF and then SUM them.

Hope this helps..if i understood ur query in write way.

Kindly reward points if helpful.

Regards

Deepika

Edited by: Deepika Singh on Apr 24, 2008 6:00 AM