Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How can i use SUM aggregate in select query?

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.

Former Member
Not what you were looking for? View more on this topic or Ask a question