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: 

find number of month between to date

Former Member
0 Kudos

Hi,

i have 2 date in yyyymmdd and i wont to find all time how month Between them what is the best way to do that ?

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use FM : HR_HK_DIFF_BT_2_DATES

14 REPLIES 14

Former Member
0 Kudos

Use FM

HR_SGPBS_YRS_MTHS_DAYS

Former Member
0 Kudos

Use FM : HR_HK_DIFF_BT_2_DATES

0 Kudos

Hi,

i need if i put 01/012/008 - 01/05/2009 Get 15 month there is Fm that do that?

Regards

0 Kudos

hi,

Use this

HR_PT_GET_MONTHS

0 Kudos

If you input

01/05/2009 and 01/01/2008 the difference would be 16 months

subtract 1 from the result .. (as it includes both months)

pass '04' to parameter OUTPUT_FORMAT in the FM ...

0 Kudos

hi,

i try it with :

01012008

01052009

04

and i get : Exception INVALID_DATES_SPECIFIED

what i miss?

Regards

0 Kudos

first enter end date 01052009 and then

01012008

Former Member
0 Kudos

Hi,

Use any of the function modules.

HR_GBSXP_GET_MONTHS

HR_PT_GET_MONTHS

Edited by: Velangini Showry Maria Kumar Bandanadham on May 13, 2008 10:57 AM

Former Member
0 Kudos

hi

use this FM

HR_PT_COMPUTE_MONTHS

cheers

snehi chouhan

Former Member
0 Kudos

Hi,

Use the FM HR_CALC_YEAR_MONTH_DAY or HR_HK_DIFF_BT_2_DATES

Regards,

Santosh

0 Kudos

MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.

0 Kudos

hi ,

thanks but i have to put in I_KZ_INCL_BIS field?

Regards

Former Member
0 Kudos

hi check this..

HR_HK_DIFF_BT_2_DATES".

or

SD_DATETIME_DIFFERENCE

or CSCP_PARA1_GET_PERIODS

or HR_CALC_YEAR_MONTH_DAY

or HR_HK_DIFF_BT_2_DATES

report zrich_0003

no standard page heading.

data: duration_in_months type i.

parameters: s_date type sy-datum,

e_date type sy-datum.

call function 'DURATION_DETERMINE'

exporting

unit = 'MON'

factory_calendar = 'P6' " Your factory calendar

importing

duration = duration_in_months

changing

start_date = s_date

end_date = e_date

exceptions

factory_calendar_not_found = 1

date_out_of_calendar_range = 2

date_not_valid = 3

unit_conversion_error = 4

si_unit_missing = 5

parameters_not_valid = 6

others = 7.

write:/ duration_in_months.

regards,

venkat

Former Member
0 Kudos

Hi,

Use FM

CALL FUNCTION 'FIMA_DAYS_BETWEEN_TWO_DATES'

EXPORTING

i_datum_von = it_crmd_orderadm_h-zzrodate

i_datum_bis = v_sydatum

i_kz_incl_bis = '1'

i_kz_ult_bis = 'X'

i_stgmeth = '2'

i_szbmeth = '6'

IMPORTING

e_tage = no_days.

Award point if it helps