‎2006 Nov 29 6:45 AM
Hi,
Function Module on the Last working Date of a month and Last day of th emonth based on the company code and period.
‎2006 Nov 29 7:09 AM
HI,
We want to fill the two selection screen fields p_fromdate and p_todate
with the first and last date of the previous month.
DATA:
l_monthn(2) TYPE n,
l_yearn(4) TYPE n.
Find current month and year
MOVE sy-datum+4(2) TO l_monthn.
MOVE sy-datum+0(4) TO l_yearn.
If current month > 1 subtract 1 from then month
IF l_monthn > 1.
l_monthn = l_monthn - 1.
ELSE.
l_monthn = 12.
l_yearn = l_yearn - 1.
ENDIF.
First date of month
CONCATENATE l_yearn l_monthn '01' INTO p_fromdate.
Last date of month
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = p_fromdate
IMPORTING
last_day_of_month = p_todate
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
Regards,
Laxmi.
‎2006 Nov 29 6:51 AM
hi,
for last and first day.
data:f_date type sy-datum,
l_date type sydatum.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = f_date
EV_MONTH_END_DATE = l_date.last working day
TM_DATE_CHECK_WORKING_DAYrgds
Anver
if hlped pls mark poin ts
‎2006 Nov 29 7:09 AM
HI,
We want to fill the two selection screen fields p_fromdate and p_todate
with the first and last date of the previous month.
DATA:
l_monthn(2) TYPE n,
l_yearn(4) TYPE n.
Find current month and year
MOVE sy-datum+4(2) TO l_monthn.
MOVE sy-datum+0(4) TO l_yearn.
If current month > 1 subtract 1 from then month
IF l_monthn > 1.
l_monthn = l_monthn - 1.
ELSE.
l_monthn = 12.
l_yearn = l_yearn - 1.
ENDIF.
First date of month
CONCATENATE l_yearn l_monthn '01' INTO p_fromdate.
Last date of month
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = p_fromdate
IMPORTING
last_day_of_month = p_todate
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
Regards,
Laxmi.