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: 

Month wise splitting

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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