10-20-2006 8:24 PM
Hi folks...
Is there any straight FM to get the last date of the previous month. For eg if current date is 04/30/2006 then i should get 03/31/2006. <b>NOT</b> 03/30/2006.
The same can be achieved by using 2 FM's. But I am looking for a single FM to suffice this requirement.
Early response is appreciated.
Regards,
Bhanu
10-20-2006 8:27 PM
10-20-2006 8:26 PM
Hi,
You can use FM RP_LAST_DAY_OF_MONTHS.
DATA: WA_DATE LIKE SY-DATUM,
WA_LDATE LIKE SY-DATUM.
WA_DATE = SY-DATUM - 30.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = WA_DATE
IMPORTING
LAST_DAY_OF_MONTH = WA_LDATE
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
WRITE: / WA_LDATE.
Regards,
Ferry Lianto
10-20-2006 8:27 PM
10-21-2006 7:39 AM
Hi bhanu ,
try this fm ..
parameters : date1 like sy-datum.
CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'
EXPORTING
I_DATE_OLD = date1
IMPORTING
E_DATE_NEW = date1 .
write:/ date1.
just check if this fm is present in ur verison.
hope this helps .
regards,
Vijay.
yeah got it
use this fm ...
RS_VARI_V_L_LAST_MONTH
pass this as default in ur fm
S OP LOW HIGH
I EQ 0 0
the output is last day of previous month .
regards,
Vijay.
Message was edited by: Vijay
10-22-2006 10:30 AM
Hi Bhanu ,
just execute this.
data :date like sy-datum.
data :begin of it occurs 0.
include structure RSINTRANGE.
data: end of it.
CALL FUNCTION 'RS_VARI_V_L_LAST_MONTH'
IMPORTING
P_DATE = date
TABLES
p_intrange = it.
write 😕 date.
regards,
Vijay