2007 Apr 30 4:52 AM
Hi Experts,
I am getting one amount field between two dates.But i need for a particular year i need to calculate amount.It will use in the next steps.
For example,
Loop at itab where w_date bt two dates.
a = a + b.
endloop.
i need the amount 'a' to particular year.
Urgent!!!!!
Hi Experts,
I am getting one amount field between two dates.But i need for a particular year i need to calculate amount.It will use in the next steps.
For example,
Loop at itab where w_date bt two dates.
a = a + b.
endloop.
i need the amount 'a' to particular year.
Urgent!!!!!
2007 Apr 30 5:16 AM
Extract the year according your date format and put it in the condition:
if the date format is 'DD.MM.YYYY'.
Loop at itab where w_date+6(4) bt two year.
a = a + b.
endloop.
2007 Apr 30 5:52 AM
Hi
Get the first 4 characters of the date field which gives the year.
segregate the date into two years.or you can use Fiscal year field in most of the FI tables for this.
or take the posting date and from it take the year and seggregate the amounts.
in the loop.
if date+0(4) = year1.
amount = a.
else.
amount = b.
endif.
endloop.
rewar points if useful
regards
Anji
2007 Apr 30 8:12 AM
Actually i am calculating the amount between two dates.
for example 01.01.2003 to 03.05.2008 .here I need like
amount for 2003
and amount for 2004............till 2008.Individually i want.
have u understand.......?
2007 Apr 30 5:57 AM
HI..
Say..ur date is '4th April,2007' and your years are 2007 and 2008.
<b>data:</b>
w_low like sy-datum,
w_high like sy-datum.
w_low = '01.01.2007'. * ur systems date format..
w_high = '01.01.2008'.
loop at itab whee <b>p_date between w_low and w_high.</b>
a = a+ b.
endloop.
write: a.
2007 Apr 30 7:43 AM
Hi Rammohan ,
Actually i am calculating the amount between two dates.
for example 01.01.2003 to 03.05.2008 .here I need like
amount for 2003
and amount for 2004............till 2008.Individually i want.
have u understand.......?
2007 Apr 30 7:02 AM
hi,
check the snippet once
code]parameters : val(30) type c.
data : final(30) type c,
cnt type i,
v type c,
n type i.
cnt = strlen( val ).
do cnt times.
move val+n(1) to v.
if v ca '.0123456789'. "Bring in the values
move v to final+n(1).
*elseif v = ',' or v = '$'. "<---no need of this
*continue. "<----no need
endif.
n = n + 1.
enddo.
condense final no-gaps.
write:/ final .[/code]
regards
2007 Apr 30 8:23 AM
Hi Lava ,
First u have to find out how many years are there for a given date range:
inpot = 01.01.2007 -31.12.2009.
here u have to get 3 years data
2007 = 10
2008 = 20
2009 = 30.
for this , u have to bulit year tables:make use this fm CSCP_PARA1_GET_PERIODS.
or any FM which gives no of years.
2.then u have to loop to get the sum.
loop at year.
loop at itab where date+0(4) = year-year.
a = a + itab-amount.
endloop.
modify year.
endloop.
Regards
Prabhu
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |