DATA lv_years TYPE i.
PARAMETERS pa_first LIKE sy-datum.
CALL FUNCTION 'COMPUTE_YEARS_BETWEEN_DATES'
EXPORTING
first_date = pa_first
modify_interval = ' '
second_date = sy-datum
IMPORTING
years_between_dates = lv_years
EXCEPTIONS
sequence_of_dates_not_valid = 1
OTHERS = 2.
WRITE: / 'Difference:', lv_years.
PARAMETERS pa_first LIKE sy-datum.
CALL FUNCTION 'COMPUTE_YEARS_BETWEEN_DATES'
EXPORTING
first_date = pa_first
modify_interval = ' '
second_date = sy-datum
IMPORTING
years_between_dates = lv_years
EXCEPTIONS
sequence_of_dates_not_valid = 1
OTHERS = 2.
WRITE: / 'Difference:', lv_years.