‎2007 Aug 21 4:56 AM
Hi Experts,
I have to create a functional module which gives output as-
in first column year, next month, next days of that month like 1,2,3---
Thanks in advance, Points sure.
‎2007 Aug 21 5:15 AM
Hi Anshu,
Is there any input to the function module (Like DATE) or is it just you want year, month and days of that month as output?
If date would be the input, in the function module define year and month as exporting parameters and for days you can define tables parameter.
To get the year from date: e_year = i_date+0(4).
To get the month from date: e_month = i_date+5(2).
To get days of the month: you can use the function module
"NUMBER_OF_DAYS_PER_MONTH_GET" by passing the year and month. This will return if it is 30 or 31 or 28. Depending on which you can update your tables parameter with numbers (by incrementing the counter according to number of days).
This would give you the required data using which you can design them as you want.
<i><b>Reward points if helpful.</b></i>
Best Regards,
Ram.
‎2007 Aug 21 5:34 AM
i just want year , monyh of that year, days of that month as my output. If u hav any sample code plz provide.
Thanks.
‎2007 Aug 21 5:50 AM
Hi Anshu,
Use the help of FM "CONVERT_DATE_TO_INTERNAL ".
Regards
Sourabh Verma
‎2007 Aug 21 5:15 AM
Anshu,
Use this Function Module.
HRCM_TIME_PERIOD_CALCULATE
K.Kiran.
‎2007 Aug 21 5:32 AM
pata nahi yaaaaar kaise banega .........sala kahin humse bol de dipak ki banao bete banao .abhi chaiye .........
‎2007 Aug 21 6:35 AM
Hi Anshu,
Below code will satisfy your requirement.
REPORT ZKK_YEAR.
data: v_month like T009B-BUMON,
v_year like T009B-BDATJ,
v_days like T009B-BUTAG.
move: sy-datum+4(2) to v_month,
sy-datum+0(4) to v_year.
CALL FUNCTION 'NUMBER_OF_DAYS_PER_MONTH_GET'
EXPORTING
par_month = v_month
par_year = v_year
IMPORTING
PAR_DAYS = v_days.
write: /5 'Year : ',
15 v_year,
25 'Month : ',
40 v_month,
50 'Days : ',
60 v_days.