2008 Mar 27 4:34 PM
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
2008 Mar 27 6:24 PM
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
2008 Mar 28 2:25 AM
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...
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |