04-24-2006 11:30 AM
concatenate '01' z_param5 z_param1(4) into z_date_m.
(z_date_m type sy-datum in the example is : 01092005)
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = z_date_m
IMPORTING
LAST_DAY_OF_MONTH = z_date_ml.
04-24-2006 11:33 AM
concatenate z_param1(4)z_param5 '01'into z_date_m.
(z_date_m type sy-datum in the example is : 20050901)
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = z_date_m
IMPORTING
LAST_DAY_OF_MONTH = z_date_ml.
04-24-2006 11:33 AM
concatenate z_param1(4)z_param5 '01'into z_date_m.
(z_date_m type sy-datum in the example is : 20050901)
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = z_date_m
IMPORTING
LAST_DAY_OF_MONTH = z_date_ml.
04-24-2006 11:42 AM
Hai Look at this code
The date format should be in 'YYYYMMDD'
data : v_last_day like sy-datum,
v_in_date like sy-datum.
v_in_date = '20050109'.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = v_in_date
IMPORTING
LAST_DAY_OF_MONTH = v_last_day
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write : / v_last_day.
Thanks & regards
Sreenivasulu P
04-24-2006 11:45 AM
Hi Liat,
Sy-datum will be stored as yyyymmdd but will be displayed on console as mmddyyyy format.
Just check the value of z_date_m once.
concatenatte z_param1(4) z-param5 '01' into z_date_m.
For proper values of z_date_m(01092005), the FM is giving exact results. I executed this FM, its working fine for value 01092005 as input.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = z_date_m
IMPORTING
LAST_DAY_OF_MONTH = z_date_ml.
Thanks,
Vinay
04-24-2006 11:45 AM
04-24-2006 11:48 AM
Hi Liat,
The day_in parameter is of the format yyyymmdd.
Pass the parameter in that format.
Thanks
Susmitha.
04-24-2006 11:49 AM
data: xt247 type t247.
parameters: s_date type sy-datum,
e_date type sy-datum,
monthn(30) type c.
at selection-screen.
call function 'RP_LAST_DAY_OF_MONTHS'
exporting
day_in = s_date
importing
last_day_of_month = e_date.
select single * from t247 into xt247
where spras = sy-langu
and mnr = e_date+4(2).
monthn = xt247-ltx.
regards
vinod