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

Problem when using SUM

Former Member
0 Likes
772

I have this senario:


report zfappm513 line-size  900     
line-count 58 
no standard page heading.

loop at itab.
  at new name.
    write:/ itab-name.
  endat.
  at end of name.
    sum.
    write:/ itab-total.
  endat.
  at last.
    sum.
    write:/ itab-total.
  endat.
endloop.

The problem occurs whenever I had a page break, the value of <b>itab-total</b> inside the <b>at end</b> will reflect the grand total.

The grand total should only display when it reaches the <b>at last</b>. Please advise. Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
696

I tested the same program , interestingly I did not find this issue.

Read only

0 Likes
696

When I remove the <b>line-count</b>, everything is normal. Is that a bug??

Read only

andreas_mann3
Active Contributor
0 Likes
696

Hi Jefery,

i think, the reason is your line-size , which is > 255.

plz -> F1 on report / LINE-SIZE col

cheers Andreas

Read only

0 Likes
696

Thanks for your help, Andreas.

I've tried to reduce the <b>line-size</b> to less than 255 but the problems still occur.

Read only

nablan_umar
Product and Topic Expert
Product and Topic Expert
0 Likes
696

Hello Jefery,

If you want the grand total displayed only on the last page, to not write itab-total when you are at end of name.