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: 

sum of values of a intenal table field

Former Member
0 Kudos

Hi,

I have a requirement that in a internal table there are number_of_days_in_month*48 records in which for each day there will be 48 intervals , i have to add the 48 intervals of a day into single value so that i can create a internal table containing number_of_days_in_month records,please suggest me a helpful answer.

Thanks in advance.

Moderator Message: What is your effort in solving this problem? Don't expect the community to spoon-feed you!

Message was edited by: Suhas Saha

3 REPLIES 3

koolspy_ultimate
Active Contributor
0 Kudos

Hi, try to use at end of event ... end at and sum it for every day and append it into another internal table, so that it meets your requirement.

Regards,

madhumahesh.

Kartik2
Contributor
0 Kudos

Dear Chetan,

Find out about the control processing statement AT END OF... ENDAT.

Prerequisite - The internal table should be sorted based on the field that you are using for statement AT END OF....

It will solve your purpose. Thank you.

Regards,

kartik

MarcinPciak
Active Contributor
0 Kudos

As suggested, either control break statement should be used here (AT NEW, AT END OF ...) or sample logic like:

For selected month

     For each record (day) within month

           Check record for this day exists in target table

                  If yes collect data under this existing record (from current source record)

                  If no append data to target table (from current source record)

At the output you should have number_of_days_in_month internal table, each record holding day collected values.

Important note!

Pay attention to key fields whe using collect stamtement

Regards

Marcin