05-14-2011 9:49 AM
Hi All,
I have developed a report( weekly report) to get total number of the contents inside an internal table in a particular Date range. suppose if the date range is 01/01/2010 to 29/01/2010 ,the user first enter the date from the select-option then a weekly report in ALV appears to him. the dates like for example :
01/01/2010
08/01/2010
15/01/2010
22/01/2010
29/01/2010.
After getting these dates I have to find the sum of the contents inside that range between:
01/01/2010 & 08/01/2010 >>> total number of (Bookings) = 432132 (e.g)
09/01/2010 & 15/01/2010 >>>.....
16/01/2010 & 22/01/2010>>>>....
23/01/2010 & 29/01/2010.>>>.....
and so on,
i have manage to get the total sum of all the field contents but the date is the problem. it's getting the sum daily not weekly.
in the report that will be displayed in the ALV, the date type is D. and in the internal table to manipulate the data, I declaired (auth_date(2) type n). then i have used (auth_date+6(2) ) to get the weekly days.
Experts please help me to find a solution for this report.
05-14-2011 1:19 PM
Hi Eman,
you may add a WEEK field to your list, use
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = <date>
IMPORTING
WEEK = <week>
EXCEPTIONS
DATE_INVALID = 1
* OTHERS = 2
.
set sort on that field in ALV, create subtotal and total for what you want to know weekly.
Regards,
Clemens
05-15-2011 6:28 AM
Thank you Sir,
although this way is good but it's not applicable to my code...
Can I do it manually instead of using a function?
05-15-2011 3:23 PM
Hi Eman,
manually? Donwload to excel, use excel (week & sum) functions.
Regards,
Clemens
06-04-2011 8:57 AM