Google Search - Blog...........

ABAP - How To Get Sum For A Particular Field In Classical Reports

REPORT test_report.

tables:pa0008.

data: begin of itab occurs 0 ,
pernr like pa0008-pernr,
ansal like pa0008-ansal,
bet01 like pa0008-bet01 ,
end of itab .

data: v_sum type pa0008-bet01 .

select-options:s_pernr for pa0008-pernr .

start-of-selection .

select pernr
ansal
bet01
from pa0008
into table itab
where pernr in s_pernr .

loop at itab .
v_sum = v_sum + itab-bet01.
at end of pernr .
write:/ itab-pernr ,
itab-ansal,
v_sum.
endat .

endloop.

No comments:

Post a Comment