10-21-2008 7:19 AM
Hi,
I did a report to get details of customers based on invoice date. Now I have to modify the report to get month wise splitting of columns based on invoice dates. In the selection screen if the user selects a range of dates for 3 months based on the invoice date i have to get data by month wise like eg...
customer no. may(price) june july
19 100 200 20
20 0 10 300. in this the output should come. how should i write the code to get month wise splitting based on invoice date. Kindly suggest.
regards,
Rakesh
10-21-2008 7:29 AM
Hi,
For getting your desired you have to use dynamic internal table.
where your fields will be based on the date range given.
Check out saptechnical.com for help in creating dynamic internal table.
As coding will be huge.
10-21-2008 8:05 AM
i will be using for max range of 12 months only so i don't require dynamic internal table. my doubt is how to split on month wise based on invoice date. how to keep control on month in the invoice date. any clues
10-21-2008 8:27 AM
Hi,
For example user given date range like 01.01.2007 to 20.05.2008
we can get month and year by using the fuction module like
CACS_DATE_GET_YEAR_MONTH.
if pass 01.01.2007 we will get month like 01.
if pass 20.05.2008 we will get month like 05.
define internal table with 12 months
if you are using ALV bulid the fieldcatalog dynamically .
lv_var = 05 - 01.
add 1 to lv_var.
do lv_var times.
bulid the fieldcatalog .
enddo.
Regards,
Suresh.
10-21-2008 8:13 AM
Hi,
Then capture the value of month by using offset and use fm 'IDWT_READ_MONTH_TEXT' to get the months name. Then in the field of invoice date...replace the dates by the name of months.
then sort the table by month and use at end of month to add up the pricing values.....you will have like this...
customer no date price
<some value> jan 10.00
<some value> feb 20.00
and so on....then create another table the way you want and use case to fill up the values...
Hope this will help you.
Regards
Debarshi