Application Development 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: 

what are the parameters for the FM

Former Member
0 Kudos

hi can any one help me how to use this FM HR_ECM_GET_NUMBER_OF_MONTHS

Edited by: kopparapu suresh on Jun 16, 2008 11:15 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi see this..

report .

parameters: p_sdate type sy-datum,

p_edate type sy-datum.

data: l_days type i,

l_months type i,

l_years type i.

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

EXPORTING

BEG_DA = p_sdate

END_DA = p_edate

IMPORTING

NO_DAY = l_days

NO_MONTH = l_months

NO_YEAR = l_years .

write:/ 'Days = ', l_days.

write:/ 'Months = ', l_months.

write:/ 'Years = ', l_years.

or see this..

REPORT ZDATEDIFF.

DATA: EDAYS LIKE VTBBEWE-ATAGE,

EMONTHS LIKE VTBBEWE-ATAGE,

EYEARS LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,

TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

exporting

i_date_from = FROMDATE

i_date_to = TODATE

  • I_FLG_SEPARATE = ' '

IMPORTING

E_DAYS = EDAYS

E_MONTHS = EMONTHS

E_YEARS = EYEARS.

WRITE:/ 'Difference in Days ', EDAYS.

WRITE:/ 'Difference in Months ', EMONTHS.

WRITE:/ 'Difference in Years ', EYEARS.

INITIALIZATION.

FROMDATE = SY-DATUM - 60.

4 REPLIES 4

former_member195383
Active Contributor
0 Kudos

Hi

It gives the difference between two dates...

see the below example.....

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

EXPORTING

BEG_DA = '20080101'

END_DA = '20080416'

IMPORTING

NO_DAY = v_days

NO_MONTH = v_months

NO_YEAR = v_years

NO_CAL_DAY = v_all_days.

write:/ 'Days = ', v_days.

write:/ 'Months = ', v_months.

write:/ 'Years = ', v_years.

write:/ 'All days = ', v_all_days.

u get the differences as above....,

days, months , years..

Reward points if useful...

Former Member
0 Kudos

Hi,

If u go and check in SE37 for the FM ''HR_ECM_GET_NUMBER_OF_MONTHS"

You will find all the parameters required for this as given below:

Local interface:

" IMPORTING

" VALUE(BEGDA) TYPE DATUM

" VALUE(ENDDA) TYPE DATUM

" VALUE(DAYS_MIN) TYPE ECM_DYPRO DEFAULT 0

" VALUE(MESSAGE_HANDLER) TYPE REF TO IF_HRPA_MESSAGE_HANDLER

" EXPORTING

" VALUE(MONTHS) TYPE P

" VALUE(IS_OK) TYPE BOOLE_D

  • to use this u need pass the begin and end date and excute, its period between the dates wil be calcuted and returned in the exporting paramter months*

reward points.

Regards,

mansi.

Former Member
0 Kudos

hi see this..

report .

parameters: p_sdate type sy-datum,

p_edate type sy-datum.

data: l_days type i,

l_months type i,

l_years type i.

CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'

EXPORTING

BEG_DA = p_sdate

END_DA = p_edate

IMPORTING

NO_DAY = l_days

NO_MONTH = l_months

NO_YEAR = l_years .

write:/ 'Days = ', l_days.

write:/ 'Months = ', l_months.

write:/ 'Years = ', l_years.

or see this..

REPORT ZDATEDIFF.

DATA: EDAYS LIKE VTBBEWE-ATAGE,

EMONTHS LIKE VTBBEWE-ATAGE,

EYEARS LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,

TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

exporting

i_date_from = FROMDATE

i_date_to = TODATE

  • I_FLG_SEPARATE = ' '

IMPORTING

E_DAYS = EDAYS

E_MONTHS = EMONTHS

E_YEARS = EYEARS.

WRITE:/ 'Difference in Days ', EDAYS.

WRITE:/ 'Difference in Months ', EMONTHS.

WRITE:/ 'Difference in Years ', EYEARS.

INITIALIZATION.

FROMDATE = SY-DATUM - 60.

Former Member
0 Kudos

this will get the difference in no. of months ..