2008 Nov 24 4:48 AM
Dear Experts,
I want the following result. I have a date parameter. I want to
get the last / end date of the previous month
for any given date which the user inputs.
For ex:
If user puts the date 15.06.2008
then i want to get the previous month end date i.e. 31.05.2008.
The reason being i am creating a program for updating Opening and Closing Stocks of every month in a ZTABLE. The user will put the date in the parameter and system will bring the closing stock of previous month and then calculate for the current month.
I hope i am not complicating matters too much....
Basic funda is to arrive at the end date of the previous month for any date which the user puts.
Please help me... it is mission critical..
Thanks & Regards,
Jitesh M Nair
2008 Nov 24 5:06 AM
Hello,
You can use the following Function module to get the last day of the previous Month.
OIL_LAST_DAY_OF_PREVIOUS_MONTH
Regards
Arindam
Edited by: Arindam Ganguly on Nov 24, 2008 6:13 AM
2008 Nov 24 4:53 AM
hi,
use this to get last month end date.
ex:
data: d2 like sy-datum.
d2 = sy-datum.
d2+6(2) = '01'.
d2 = d2 - 1. "prev mnth last date
write:/ d2.
2008 Nov 24 4:55 AM
2008 Nov 24 5:01 AM
2008 Nov 24 5:06 AM
Hello,
You can use the following Function module to get the last day of the previous Month.
OIL_LAST_DAY_OF_PREVIOUS_MONTH
Regards
Arindam
Edited by: Arindam Ganguly on Nov 24, 2008 6:13 AM
2008 Nov 24 5:22 AM
Hi,
There are lot of function module you can find it in se37 month and press f4 find the function module which coincides with your requirement...
Thanks,
Thiru. R
2008 Nov 24 8:03 AM
Hi,
subtract 1 from the current months 1st date.
Thanks & Regards,
Sudheer
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |