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: 

FM to calculate months btw two dates

Former Member
0 Kudos

Hi,

I know theres plently of function modules to do the above but does anyone know one that calculates the amount of CALENDER months between two dates. I need to count the amount of payroll periods between two dates and then work from there.

Thanks

4 REPLIES 4

Former Member
0 Kudos

Hello,

See this fm FIMA_DAYS_AND_MONTHS_AND_YEARS.

Regards.

Former Member
0 Kudos

Hi, again that strictly goes by days...e.g from 05/01/08 to 07/01/2008 gives back one month which is correct but not for my calculations. A month needs to be a calender month, e.g 01/01/08 to 05/02/08 means all of January is covered e.g one FULL month

Former Member
0 Kudos
Data v_month type I.

CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
  EXPORTING
    beg_da           = 01.01.2008
    end_da           = 05.02.2008
 IMPORTING
*   NO_DAY           =
   NO_MONTH       = v_month
*   NO_YEAR         =
*   NO_CAL_DAY   =
          .

Former Member
0 Kudos

Hi, tried that one before. If you for example had 05/01/2008 to 25/02/2008 its say one month but its not one payroll month which is from the first to last (1st Jan to 31st Jan)

Anyone else have ideas?