Skip to Content
0
Former Member
Sep 08, 2008 at 01:15 PM

How can i use SUM aggregate in select query?

3193 Views

HI,

GURUS,

How can i use SUM function in Select Query and i want to store that value into itab.

for ex:

TABLES: vbap.

types: begin of ty_vbap,

incluse type vbap,

sum type string,

end of ty_vbap.

data: i_vbap type TABLE OF ty_vbap,

w_vbap type ty_vbap.

SELECT sum(posnr) FROM vbap into table i_vbap up to 5 rows.

(or)

SELECT sum(posnr) FROM vbap into table i_vbap group by vbeln.

loop at i_vbap into w_vbap

" which variable have to use to display summed value.

endloop.

if above code is not understandable pleas give ome sample code on above query.

Thank u,

shabeer ahmed.