Application Development and Automation 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: 
Read only

DATE REANGES REPORT

Former Member
0 Likes
467

Hi Abapers,

I have this logic breaking my head.Can anyone give me a sample code.

How can I for a given date range, get the total amount of all the invoices

For everyday,

every week of the month,

Every month of the year

and yearly

Thanks

Hi Abapers,

I have this logic breaking my head.Can anyone give me a sample code.

How can I for a given date range, get the total amount of all the invoices

For everyday,

every week of the month,

Every month of the year

and yearly

Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
447

Hi

you can try this way...

make the date field as the first field of the internal table.

sort the internal table on date field

construct loop on the internal table.

use at new control event. keep storing the pervious date value in a variable and week number of the date(use FM)

when the date changes, u can get the total for the date its a straight forward sum key word.

when the date changes, get the new week number value of the date compare the previous stored week value and

current week value, if both are same then both the dates are in same week, if not u can print the total for week.

and similarly keep comparing for month n year also.

Its a wild guess. I dont have access to SAP system. If not i would have given u exact answer.

all the best

Read only

Former Member
0 Likes
447

Hi,

in vbrk table fkdat field is the invoice date

netwr is the value of invoice

declate it as

data itab like vbrk occurs 0 with header line.
select-options fkdat for vbrk-fkdat.

use select query to fetch all the invoices

select * from vbrk into corresponding fields of table itab where fkdat in fkdat.

Regards,

V.Balaji

Reward if Usefull...