Hi Amine,
There are a few points in your code:
1. You are not catching the excetiion when you call the FM.
2. It appears that your value of LOC_VAR_RANGE-LOW is not of type sy-datum. Please check what value you are getting in this value and passing it to FM. Ideally the exception says that day_in_not_valid i.e. your input value is not value. Check the format of LOW_VAR_RANGE-LOW and convert it to sy-datum type by using a conversion exit. Then you should be good.
The Code should be:
-------
DATA: day_in TYPE sy-datum, "declare this variable for input to FM
zdate TYPE sy-datum.
day_in = LOW_VAR_RANGE-LOW. "assign value
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
day_in = day_in
IMPORTING
last_day_of_month = zdate
EXCEPTIONS
day_in_not_valid = 1 "catch exception here
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
-------
Please let me know if you face any issues.
Thanks
Amit