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

FM

jayant_kumar
Explorer
0 Likes
460

Hi,

functional module for sum of values in an internal table.

Thanks

jayant

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
435

Hi,

No FM...jst loop the internal table to sum up the values...

Regards,

Vamshi

3 REPLIES 3
Read only

Former Member
0 Likes
436

Hi,

No FM...jst loop the internal table to sum up the values...

Regards,

Vamshi

Read only

naveen_inuganti2
Active Contributor
0 Likes
435

Hi...,

Declare one variable or parameter for SUM and pass sum into that parameter.

Thanks,

Naveen.i

Read only

Former Member
0 Likes
435

Try bellow example.


REPORT  zrnd5003.
DATA: BEGIN OF it_itab OCCURS 0,
      val TYPE p,
      END OF it_itab.

it_itab-val = 100.
APPEND it_itab.

it_itab-val = 400.
APPEND it_itab.

it_itab-val = 600.
APPEND it_itab.


it_itab-val = 800.
APPEND it_itab.

it_itab-val = 150.
APPEND it_itab.

LOOP AT it_itab.
  WRITE:/ it_itab-val.
  AT LAST.
    SUM.
    WRITE:/ '-------------------------------------'.
    WRITE:/ it_itab-val.
  ENDAT.
ENDLOOP.