⚠️ This code works only if range values are restricted to Include Equal (I EQ) and domain values are not range of values.
Example of calling code :
DATA : lv_wrong_value TYPE domvalue_l.
PERFORM f_check_range_val_from_domain USING 'MTART'
s_mtart[]
CHANGING lv_wrong_value.
IF lv_wrong_value IS NOT INITIAL.
SET CURSOR FIELD 'S_MTART-LOW' ##NO_TEXT.
MESSAGE i001(zz) WITH lv_wrong_value DISPLAY LIKE 'E'.
" Material type &1 is not valid
ENDIF.