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: 

Is it possible to summate the values of multiple rows of an internal table to one variable?

walkerist
Participant
0 Kudos
493

Can I summate the value of INV_DTE to one variable?

2 REPLIES 2

Andreas_Huber
Explorer
409

F.e. the field EKBE-WRBTR you can do the sum like this:

DATA(sum) = REDUCE wrbtr( INIT x = 0 FOR ls_ekbe IN t_ekbe NEXT x = x + ls_ekbe-wrbtr ).

See also examples of REDUCE

Sandra_Rossi
Active Contributor
0 Kudos
409

I guess you know how to loop at an internal table, how to use a variable and how to use the + operator.

I think it's the most simple algorithm of the world.

What is your difficulty?