Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Module

Former Member
0 Likes
1,028

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

8 REPLIES 8
Read only

Former Member
0 Likes
799

BAPI_CCODE_GET_FIRSTDAY_PERIOD.

last date is next period first date -1.

Read only

Former Member
0 Likes
799

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á

Read only

Former Member
0 Likes
799

Hi,

Check the FM 'MC_PERIO_GET_FIRST_AND_LASTDAY'

Rgds,

Bujji

Read only

Former Member
0 Likes
799

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

Read only

Former Member
0 Likes
799

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 =

Read only

Former Member
0 Likes
799

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

Read only

former_member556412
Active Participant
0 Likes
799

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

Read only

Former Member
0 Likes
799

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.