I first use this FM in a HR ABAP program. For checking specifiy qualification to an employee.The result of this FM is present as year , month and day. Below is the sample code
METHOD check_qualifications.
DATA: l_v_beg_da TYPE D,
l_v_end_da TYPE D.
DATA: l_v_no_day TYPE I,
l_v_no_month TYPE I,
l_v_no_year TYPE I,
l_v_no_cal_day TYPE I.
l_v_beg_da = l_v_dat01.
l_v_end_da = l_v_endda.
CALL FUNCTION ' HR_SGPBS_YRS_MTHS_DAYS '
EXPORTING
BEG_DA = l_v_beg_da
END_DA = l_v_end_da
IMPORTING
NO_DAY = l_v_no_day
NO_MONTH = l_v_no_month
NO_YEAR = l_v_no_year
NO_CAL_DAY = l_v_no_cal_day
EXCEPTIONS
DATEINT_ERROR = 1
OTHERS = 2 .
IF l_v_no_month GE 3 OR l_v_no_year GE 1 .
l_v_subrc = 0 .
ELSE.
l_v_subrc = 1 .
ENDIF.
ENDMETHOD. " check_qualifications
DATA: l_v_beg_da TYPE D,
l_v_end_da TYPE D.
DATA: l_v_no_day TYPE I,
l_v_no_month TYPE I,
l_v_no_year TYPE I,
l_v_no_cal_day TYPE I.
l_v_beg_da = l_v_dat01.
l_v_end_da = l_v_endda.
CALL FUNCTION ' HR_SGPBS_YRS_MTHS_DAYS '
EXPORTING
BEG_DA = l_v_beg_da
END_DA = l_v_end_da
IMPORTING
NO_DAY = l_v_no_day
NO_MONTH = l_v_no_month
NO_YEAR = l_v_no_year
NO_CAL_DAY = l_v_no_cal_day
EXCEPTIONS
DATEINT_ERROR = 1
OTHERS = 2 .
IF l_v_no_month GE 3 OR l_v_no_year GE 1 .
l_v_subrc = 0 .
ELSE.
l_v_subrc = 1 .
ENDIF.
ENDMETHOD. " check_qualifications