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
484

I want to sum up 3 different fields from a table using aggregate function "sum". But in a single select stmt.

e.g In table PLPO i want to sum up 3 different quantity fields i.e.

vgw01 vgw02 vgw03 in a single select stmt and not 3 select stmts.

e.g.

for summing up one column.......................

select sum( vgw01 ) from plpo

into corresponding fields of table t_assem_cal

where plnnr = itab-plnnr.

can i sum up all above column in one select stmt.

3 REPLIES 3
Read only

Former Member
0 Likes
454

Hi,

Please use COLLECT STATMENT will achive ur requirement...

Regards,

Sreenivasa sarma k.

Read only

Former Member
0 Likes
454

Try this code ho[pe it will help.....

select sum( vgw01 )

sum( vgw02 )

sum( vgw03 )

plnnr

into corresponding fields of table t_assem_cal

from plpo

where plnnr = itab-plnnr

group by plnnr.

Reward if helpful

-Sudhanshu

Read only

0 Likes
454

Thank you so much.