Moving parameters in other with differenct data type
I want to check if it's possible to convert one parameter in an other.
For example when I want to move a string to a data, the move should go in exception.
I was trying this with following code, but the code is just converting a string in a data, without going in exception.
DATA: lv_var1 type String.
DATA: lv_var2 type DATUM.
lv_var1 = 'Test'
MOVE lv_var1 TO lv_var2.
CATCH cx_sy_conversion_error into Exception
Result: lv_var2 = 'Test'
=> I want the program to check 2 parameters and return an exception, but this is not happening