my requirement is i have month and year which i am getiing in select option from the user
in the format eg: '11.2007' and '06.2007' (he enters in the screen) i have to find the months
between and do some calculation.
i have the function module for it HR_HK_DIFF_BT_2_DATES .my problem is i concatenated and passed two days in the format like '20071101' and '20070630' but its not showing the month between .is that the format i give is wrong...plz help me
Here is the code:
data: v_date like p0001-begda,
v_date1 like p0001-endda,
v_months like P0347-SCRMM.
v_date = p_date.
v_date1 = p_date1.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
DATE1 = v_date
DATE2 = v_date1
OUTPUT_FORMAT = '08'
MONTHS = v_months
INVALID_DATES_SPECIFIED = 1
OTHERS = 2
IF SY-SUBRC <> 0.
And I am passing 20071101 to P_date and 20070601 to p_date1.
I am thinking the way you defined your date parameters may be wrong.