2007 Jul 06 10:35 AM
Hello All,
I have a reqmnt,
I want to find out the dates of current academic year using sy-datum, it means if i provide date 06/07/07, the dates i need in return is 31-07-07 and 01-08-06. could anyone suggest how do i go bout it.
thanks,
RS
2007 Jul 06 10:48 AM
HI,
you can get last day of the month using "FM LAST_DAY_OF_MONTHS"
Pass your date current date and you get l;ast day of the month from this fumction module..
I clearly did not understand your requirement can you be please more clear
rewards if useful,
regards,
nazeer
Hello All,
I have a reqmnt,
I want to find out the dates of current academic year using sy-datum, it means if i provide date 06/07/07, the dates i need in return is 31-07-07 and 01-08-06. could anyone suggest how do i go bout it.
thanks,
RS
2007 Jul 06 10:39 AM
Hi Reena,
If you want to find out the dates are in current year or not, then use the split statement and store the year part in a variable and compare with the current year.
Best regards,
Suresh
2007 Jul 06 10:40 AM
Hi Reena,
l_date type sy-datum,
l_date1 type sy-datum,
l_date2 type sy-datum.
l_year(4) type n
l_month(2) type n
pass l_date to SG_PS_GET_LAST_DAY_OF_MONTH you get last day in l_date1.
now
l_year = l_date1(4) - 1.
l_month = l_date1+4(2) +1.
concatenate l_year l_month '01' to l_date2.
Reward points if useful.
Regards,
Atish
Message was edited by:
Atish Sarda
2007 Jul 06 10:40 AM
Hi Reena,
Use FM LAST_DAY_OF_MONTHS, it will give you last date and add 1 to that date. It will give you both the dates
Means,
YOur date => FM => Last date (date1)
date2 = add 1 to last date
Reward if useful!
2007 Jul 06 10:42 AM
Try this FM to get the last day of the given month....
JVA_LAST_DATE_OF_MONTH
Prabhu Rajesh
2007 Jul 06 10:48 AM
HI,
you can get last day of the month using "FM LAST_DAY_OF_MONTHS"
Pass your date current date and you get l;ast day of the month from this fumction module..
I clearly did not understand your requirement can you be please more clear
rewards if useful,
regards,
nazeer
2007 Jul 06 11:11 AM
thanks all for yr replies, but i need to make myself more clear i guess,
i need academic year dates, which mean, if we have past august then academic year dates are 01-08 current year and 31-07 prev year and if have not past the july then its 01-08 of prev year and 31-07 of next year.
2007 Jul 06 11:15 AM
Hi reena,
Try based on the solutions given. You will get logic.
Regards,
Atish
2007 Jul 06 11:12 AM
Hi Reena,
can you try combining the FM RS_VARI_V_1_NEXT_MONTH returns the next months starting date. and the FM LAST_DAY_OF_MONTHS gives the last day.
<b>Reward pts if found usefull.</b>
Regards
Sathish
2007 Jul 06 11:37 AM
DATA:
FROM_DATE LIKE SY-DATUM,
TO_DATE LIKE SY-DATUM,
W_YEAR(4).
parameters:
p_date like sy-datum.
if p_date+4(2) LE '07'.
W_YEAR = P_DATE+0(4).
W_YEAR = W_YEAR - 1.
CONCATENATE W_YEAR '0801' INTO FROM_DATE.
ELSE.
CONCATENATE P_DATE+0(4) '0801' INTO FROM_DATE.
ENDIF.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
MONTHS = 12
OLDDATE = FROM_DATE
IMPORTING
NEWDATE = TO_DATE .
TO_DATE = TO_DATE - 1.
WRITE:/ P_DATE,FROM_DATE,TO_DATE.
2007 Jul 06 11:43 AM
I think the solution i gave, is what you asked for, right? If yes then don't forget to reward points