04-23-2007 7:09 AM
Hi
I am working on a report which will list out Month wise totals in each row.
How should i select the Months with in a date range and do the sum ( User may select the date range for N number of years also. Example : 01/10/2000 to 01/01/2010 )
Thanks in advance
Thanks®ards
Mrudula
04-23-2007 7:13 AM
Hi
Use the following code:
data: l_date(8) value '03042007',
l_mname type t247-ktx,
l_c(25).
select single ktx from t247
into l_mname
where spras = sy-langu
and mnr = l_date+2(2).
concatenate l_mname l_date+6(2)
into l_c." SEPARATED BY space.
data: g_date(10) type c. " Processing date of Report
g_date = sy-datum.
concatenate g_date0(4) g_date4(2) g_date+6(2) into g_date.
data: g_date1(10) type c.
g_date1 = so_verab-high.
concatenate g_date10(4) g_date14(2) g_date1+6(2) into g_date1.
Regards,
Sreeram
04-23-2007 7:14 AM
HI
CHECK THE FOLLOWING LINK
http://help.sap.com/saphelp_nw04s/helpdata/en/da/71eec80cbf4e59948a29aa74c0c2b4/frameset.htm
REWARD IF HELPFULL
04-23-2007 7:15 AM
If user is entering date in specified / System format then simply take the MMYYYY from the date value of both Starting & Ending. Then Bifurcate each month starting from first then increasing by one , when reaching 12 the next increase MM = 1 and YYYY increase it by 1. Append this to an internal table. You have the monthly range you required. I hope this helps you.
Now based on this you can bifurcate you data also. If you want the code do tell me.
Raj
04-23-2007 7:17 AM
Hi,
You have to segregate the months from the Data range entered on sel screen and have to display the related sums
like If date+4(2) = '01' January
If date+4(2) = '02' February
Or you can use the MONAT will be there in finance tables) field for periods to calculate the sums.
reward if useful
regards,
ANJI