Application Development 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: 

FM

jayant_kumar
Explorer
0 Kudos

Hi,

functional module for sum of values in an internal table.

Thanks

jayant

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

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

Regards,

Vamshi

3 REPLIES 3

Former Member
0 Kudos

Hi,

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

Regards,

Vamshi

naveen_inuganti2
Active Contributor
0 Kudos

Hi...,

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

Thanks,

Naveen.i

Former Member
0 Kudos

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.