09-04-2007 9:49 AM
Hello expert
how to get the last day of fiscal period input.
the fiscal period inculdes 1-16
when fiscal period is greater than 12, only calculate the last day of 12nd month
your solution will be apprecaited, FM existing?
thank you
Kevin
09-04-2007 9:53 AM
Hi,
when you give a particular date in any month
the following fm will give you the last date of that month
here you can give
R_FDATE-HIGH as 01 and month as the period you wnat and year for current year
concatenates '01' month year into r_fdate-high separated by '.'.
then it will give g_ltdt for that month and year which wil be the last date of that month
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = R_FDATE-HIGH
IMPORTING
LAST_DAY_OF_MONTH = G_LTDT
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.
thanks & regards,
Venkatesh
09-04-2007 9:53 AM
Hi..
Call the FM
RKE_GET_LAST_DAY_IN_PERIOD
CALL FUNCTION 'RKE_GET_LAST_DAY_IN_PERIOD'
EXPORTING PERFLAG = PERFLAG2
PERIV = PERIV2
PERIO = WORK-ALTPERIO
IMPORTING DATE = LAST_ALTPERIO_DATE.
<b>reward if Helpful</b>
09-04-2007 10:15 AM
09-04-2007 10:20 AM
IF vperiod >= '12'.
ldf_month = '12'.
ELSE.
ldf_month = vperiod + 1.
ENDIF.
IF ldf_month < 10.
CONCATENATE '0' ldf_month INTO ldf_month.
ENDIF.
CONCATENATE vyear ldf_month '01' INTO ldf_firstdate.
ldf_lastdate = ldf_firstdate - 1.
CONCATENATE ldf_lastdate(4)
'年'
ldf_lastdate+4(2)
'月'
ldf_lastdate+6(2)
'日'
INTO vdate .