‎2008 Jun 20 11:13 AM
Hi Guru,
I want one function module which can convert period to date.
means if I am giving 06-2008. Then I should get as out put as
01-06-2008 and 30-06-2008. I shouls get the first and last date for that period.
Max pts will be rewarded.
Thanks,
Sandeep Garg
‎2008 Jun 20 11:16 AM
BAPI_CCODE_GET_FIRSTDAY_PERIOD.
last date is next period first date -1.
‎2008 Jun 20 11:18 AM
Hi!
For the first day of the month, you only have to concatenate '01' to the text, remove formatting and put it into a date field.
Then use RP_LAST_DAY_OF_MONTHS fm.
And at the last step, put back the formatting.
Regards
Tamá
‎2008 Jun 20 11:19 AM
‎2008 Jun 20 11:20 AM
hiii
use following FM
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = g_year *Fiscal year
i_periv = g_periv *Fiscal year varaint
i_poper = g_month *Period
IMPORTING
e_date = w_period-ssdate
EXCEPTIONS
input_false = 1
t009_notfound = 2
t009b_notfound = 3
OTHERS = 4.reward if useful
thx
twinkal
‎2008 Jun 20 11:37 AM
try using ...
CALL FUNCTION 'CY_GET_BEGIN_AND_END_OF_PERIOD'
EXPORTING
PERIOD_TEXT = 06 " month
PERIOD_TYPE = D " D for period type month
IMPORTING
ENDDATE =
STARTDATE =
‎2008 Jun 20 12:18 PM
Hi,
Use the FM 'OIL_MONTH_GET_FIRST_LAST' as below
********************************
Import parameters
I_MONTH 06
I_YEAR 2008
and u will get below dates
Export parameters
E_FIRST_DAY 01.06.2008
E_LAST_DAY 30.06.2008
***********************************
One more FM 'OIUREP_MONTH_FIRST_LAST' which has similar Import parameters
Import parameters Value
I_MONTH 06
I_YEAR 2008
Hope this helps...
Regards,
Murali.
Edited by: Murali Mohan on Jun 20, 2008 1:20 PM
‎2008 Jun 20 12:30 PM
Hi,
U can use the FMs
HRPP_CCODE_GET_FIRSTDAY_PERIOD
and
RP_LAST_DAY_OF_MONTHS
Or
FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET
Regards,
Bhanu
Edited by: nanduri bhanu on Jun 20, 2008 1:32 PM
‎2008 Jun 20 12:50 PM
Hi Sandeep,
There are many function modules.
(1) MC_PERIO_GET_FIRST_AND_LASTDAY.
(or)
(2) BAPI_CCODE_GET_FIRSTDAY_PERIOD.
(or)
(3) FIRST_DAY_IN_PERIOD_GET.
(or)
(4) LAST_DAY_IN_PERIOD_GET.
(or)
(4) CY_GET_BEGIN_AND_END_OF_PERIOD.
(or)
(5) OIL_MONTH_GET_FIRST_LAST.
(or)
(6)HRPP_CCODE_GET_FIRSTDAY_PERIOD.
(or)
(7)RP_LAST_DAY_OF_MONTHS.
First u see all the function modules. See the export and import parameter. And choose the FM which is suitalble to your requirement.
For example see the below FMs.
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = g_year *Fiscal year
i_periv = g_periv *Fiscal year varaint
i_poper = g_month *Period
IMPORTING
e_date = w_period-ssdate
EXCEPTIONS
input_false = 1
t009_notfound = 2
t009b_notfound = 3
OTHERS = 4.
(or)
CALL FUNCTION 'CY_GET_BEGIN_AND_END_OF_PERIOD'
EXPORTING
PERIOD_TEXT = 06 " month
PERIOD_TYPE = D " D for period type month
IMPORTING
ENDDATE =
STARTDATE =
Play these FMs like these and you can easily find out ur requirement.
If it is useful Reward me.